Subject: Nut-ups with USB
To: None <netbsd-users@netbsd.org>
From: M. Parsons <mrparsons@gmail.com>
List: netbsd-users
Date: 09/08/2006 18:01:43
Hello,

Has anyone successfully gotten nut-ups working with a USB based UPS?  I have
googled around a lot, and there doesnt seem to be many success stories.

On my system I get:

Waiting for notifications...
upsdrv_updateinfo...
Waiting for notifications...
upsdrv_updateinfo...
Waiting for notifications...
upsdrv_updateinfo...
Waiting for notifications...

with a newhidups -u root -DDDDD /dev/usb0 command line. (using /dev/ugen0
produces exact same output)

>From googling, it seems netbsd needs a 'patched' libusb to add a O_NONBLOCK
to bsd.c (http://wiki.botka.homeunix.org/bin/view/Main/NetworkUpsToolsUsb).
I have managed to do that, but then I get:

Waiting for notifications...
USB error: can't open /dev/ugen0.01 for bulk read: Device not configured
usb_interrupt_read: got negative open file descriptor for endpoint 01
upsdrv_updateinfo...
Waiting for notifications...
USB error: can't open /dev/ugen0.01 for bulk read: Device not configured
usb_interrupt_read: got negative open file descriptor for endpoint 01


I can post full newhidups outputs, but I dont know if that will help any as
it does seem to detect my Belkin UPS.

I have gotten APCUPSD working with an APC UPS, so I believe my kernel is
configured correctly for USB based UPS's.  Too bad I need the Belkin on my
netbsd machine. :(

bash-3.1# usbdevs -d
addr 1: UHCI root hub, VIA Technologies
  uhub0
 addr 2: Belkin UPS, Belkin
   ugen0
addr 1: UHCI root hub, VIA Technologies
  uhub1


Any ideas?

Thanks.

Mark