Subject: Re: UPS with USB support?
To: Steven M. Bellovin <smb@cs.columbia.edu>
From: Nathan J. Williams <nathanw@wasabisystems.com>
List: netbsd-users
Date: 07/20/2005 09:00:43
"Steven M. Bellovin" <smb@cs.columbia.edu> writes:

> Thanks.  Any particular problem compiling it under NetBSD?  The pkgsrc 
> version is 3.8.6nb4; you seem to be running 3.11.3, and the 
> documentation with the package says that USB support is only in 3.9.4 
> or later.

I built the same package the old fashioned way (./configure; make;
make install) without any difficulty, and it talks fine to my APC
Back-UPS ES 500. I found apcupsd functional but annoyingly chatty,
especially since the UPS clicks on and off about every ten minutes,
when my AC compressor cycles.

I had to apply the following patch to uhid.c to force the device to
attach as "ugen" rather than "uhid":

Index: uhidev.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/uhidev.c,v
retrieving revision 1.27
diff -u -r1.27 uhidev.c
--- uhidev.c    19 Jun 2005 10:29:47 -0000      1.27
+++ uhidev.c    20 Jul 2005 12:59:54 -0000
@@ -94,6 +94,9 @@
 
        if (uaa->iface == NULL)
                return (UMATCH_NONE);
+       /* APC UPS devices are better as ugen */
+       if (uaa->vendor == USB_VENDOR_APC)
+               return (UMATCH_NONE);
        id = usbd_get_interface_descriptor(uaa->iface);
        if (id == NULL || id->bInterfaceClass != UICLASS_HID)
                return (UMATCH_NONE);


        - Nathan