[Nut-upsuser] USB UPS Question...

Philippe Daoust pdaoust@sympatico.ca
Wed, 22 Jun 2005 23:27:20 -0400


Hello,

I have been trying to get a TrippLite Internet Office 750 UPS to talk to 
my Linux PBX for a couple of evenings now and I'm getting nowhere...  I 
tried searching the list archives before posting here (I'm sure I'm not 
the first one to try to get this going) but they seem to be offline...

The UPS is unfortunately USB based but I thought I'd give it a try 
anyway.  Here is what I was able to do so far...

I see my UPS comming up on hiddev1:

Jun 22 23:11:31 mypbx devlabel: devlabel service started/restarted
Jun 22 23:11:35 mypbx kernel: hub.c: new USB device 00:1d.0-1, assigned 
address 4
Jun 22 23:11:35 mypbx kernel: hiddev1: USB HID v1.00 Pointer [TRIPP LITE 
TRIPP LITE INTERNET725U       ] on usb1:4.0
Jun 22 23:11:38 mypbx /etc/hotplug/usb.agent: Setup hid for USB product 
9ae/1/1
Jun 22 23:11:38 mypbx devlabel: devlabel's temporary ignore list 
/etc/sysconfig/devlabel.d/ignore_list has been emptied due to a change 
in device configuration.
Jun 22 23:11:39 mypbx devlabel: devlabel service started/restarted

I configured nut to use the hidups driver with the correct port:

[root@mypbx nut-2.0.1]# more /usr/local/ups/etc/ups.conf
[TippLite1]
                driver = hidups
                port = /dev/usb/hiddev1
                desc = "PBX"

When I start the server I get this:

[root@mypbx bin]# /usr/local/ups/bin/upsdrvctl start
Network UPS Tools - UPS driver controller 2.0.1
Network UPS Tools: HID UPS driver 0.13 (2.0.1)

Warning: This is an experimental driver.
Some features may not function correctly.

/dev/usb/hiddev1 is not a UPS

Driver failed to start (exit status=1)

I tried using the "newhidups" driver but I can't get it to compile:

[root@mypbx drivers]# make newhidups
gcc -I../include -O -Wall -Wsign-compare  -o newhidups newhidups.o 
main.o dstate.o \
        ../common/state.o ../common/upsconf.o ../common/parseconf.o \
        ../common/common.o     libhid.o libusb.o hidparser.o
libusb.o(.text+0x1c): In function `libusb_open':
: undefined reference to `usb_init'
libusb.o(.text+0x21): In function `libusb_open':
: undefined reference to `usb_find_busses'
libusb.o(.text+0x26): In function `libusb_open':
: undefined reference to `usb_find_devices'
libusb.o(.text+0x2b): In function `libusb_open':
: undefined reference to `usb_busses'
libusb.o(.text+0x75): In function `libusb_open':
: undefined reference to `usb_open'
libusb.o(.text+0x14a): In function `libusb_open':
: undefined reference to `usb_set_altinterface'
libusb.o(.text+0x15a): In function `libusb_open':
: undefined reference to `usb_claim_interface'
libusb.o(.text+0x17e): In function `libusb_open':
: undefined reference to `usb_control_msg'
libusb.o(.text+0x192): In function `libusb_open':
: undefined reference to `usb_strerror'
libusb.o(.text+0x203): In function `libusb_open':
: undefined reference to `usb_get_string_simple'
libusb.o(.text+0x2a5): In function `libusb_open':
: undefined reference to `usb_get_string_simple'
libusb.o(.text+0x341): In function `libusb_open':
: undefined reference to `usb_get_string_simple'
libusb.o(.text+0x3dc): In function `libusb_open':
: undefined reference to `usb_control_msg'
libusb.o(.text+0x418): In function `libusb_open':
: undefined reference to `usb_close'
libusb.o(.text+0x4f4): In function `libusb_get_report':
: undefined reference to `usb_control_msg'
libusb.o(.text+0x531): In function `libusb_set_report':
: undefined reference to `usb_control_msg'
libusb.o(.text+0x553): In function `libusb_get_string':
: undefined reference to `usb_get_string_simple'
libusb.o(.text+0x5b8): In function `libusb_close':
: undefined reference to `usb_release_interface'
libusb.o(.text+0x5c6): In function `libusb_close':
: undefined reference to `usb_close'
collect2: ld returned 1 exit status
make: *** [newhidups] Error 1

I do have the libraries AFAIK:

[root@mypbx nut-2.0.1]# rpm -qa |grep usb
usbutils-0.11-1
libusb-devel-0.1.6-3
libusb-0.1.6-3

I am running CentOS 3 (this is what installs with Asterisk@Home):

[root@mypbx nut-2.0.1]# uname -a
Linux mypbx.homeip.net 2.4.21-27.0.1.EL #1 Fri Dec 24 02:04:03 GMT 2004 
i686 i686 i386 GNU/Linux

Any help GREATLY appreciated!  :-)