Scott.B.Dorsey at nasa.gov
2016-Oct-10 12:53 UTC
[Nut-upsuser] trouble building nut for HID-USB
I have a user running centos 6.8 with a brand new Tripplite HID (protocol 4016) UPS. So I installed nut 6.5 from EPEL and it sometimes worked, and it sometimes didn't, and it seemed to be very inconsistent about loading the device driver. So, looking around and after spending some time looking at things that had nothing to do with the real problem, I instead wiped the full install, downloaded http://www.networkupstools.org/source/2.7/nut-2.7.4.tar.gz and built it from source. The problem is, even if I do a ./configure --with-usb=yes I don't get any usb drivers installed on the system. usbhid-ups is no where to be found. So, does anyone either know of a prebuilt kit of a recent version that will work, or does anyone know what I need to be adding to that .gz file in order to have the complete source that I will need to make it work? --scott
[please use Reply-All - this list does not modify the reply-to header.]> On Oct 10, 2016, at 8:53 AM, Scott.B.Dorsey at nasa.gov wrote: > > I have a user running centos 6.8 with a brand new Tripplite HID (protocol 4016) > UPS. So I installed nut 6.5 from EPEL and it sometimes worked, and it > sometimes didn't, and it seemed to be very inconsistent about loading the > device driver.Protocol 4016 is a new one for us. If you run "lsusb -d 09ae:", does it show something like this? (this is from a protocol 3016 unit) $ lsusb -d 09ae: Bus 006 Device 008: ID 09ae:3016 Tripp Lite Assuming nothing drastic has changed in this protocol, there are two places where the new protocol number needs to be added. The driver has a table of known protocol numbers (USB VendorID:ProductID pairs, really, but aside from PID 0001, Tripp Lite tends to keep the protocol numbers and ProductIDs in sync), but you can try adding the "-x productid=4016" command line option (or add "productid=4016" to ups.conf). The second place is in the udev configuration files. When the UPS is first plugged into the USB port, the system looks up the VID:PID (and possibly some more attributes) in the udev configuration directories (/lib/udev/rules.d and /etc/udev/rules.d, if it's similar to Debian's layout), and NUT adds a configuration file to change ownership of the device node to allow the unprivileged NUT driver to control the UPS. Probably the easiest test would be to reinstall the package, check for the udev file (named /lib/udev/rules.d/52-nut-usbups.rules[*] in Ubuntu 14.04) and add a line for your protocol number (copying the 3015 entry). Then you can run "udevadm trigger --subsystem-match=usb --action=change" as root to reload the new udev file. [*] yours might have 62 instead, which could also be part of the problem - the number needs to be lower in order to override some later-numbered rules. We're erring on the side of caution with the USB product IDs - in many cases, vendors have other random USB devices besides UPSes, so we don't just do a wildcard entry for everything with Tripp Lite's VendorID. Also, many Tripp Lite devices have what I would consider to be bugs in the HID descriptor, and so many values end up being reported in the wrong units (Hz*100 for frequency, microvolts for voltage measurements, etc.). When we add a product ID to the table, we also try to correct for the obvious typos. If this doesn't work, please save the logs and let us know what failed.> So, looking around and after spending some time looking at things that had > nothing to do with the real problem, I instead wiped the full install, > downloaded http://www.networkupstools.org/source/2.7/nut-2.7.4.tar.gz > and built it from source. > > The problem is, even if I do a ./configure --with-usb=yes I don't get any > usb drivers installed on the system. usbhid-ups is no where to be found.Centos probably comes with the runtime libraries for libusb installed by default, but you will also need libusb*-devel packages to build from source. We are finishing up testing a libusb-1.0 branch of NUT, and if you encounter problems with the 2.6.5 package (plus the configuration changes mentioned above), it might be worthwhile to test with the new branch. We haven't narrowed down the exact problem, but some combination of the following has been problematic: - TL Protocol 3016 - Server-class motherboards - Older Linux kernels (< 4.0?) - libusb-0.1 For some reason, our snapshots on Buildbot aren't being properly indexed by branch, but this build is what I am currently testing: http://buildbot.networkupstools.org/public/nut/builders/Debian-x64-gcc/builds/664 -- Charles Lepple clepple at gmail
Dorsey, Scott B. (LARC-D316)[LITES II]
2016-Oct-12 18:00 UTC
[Nut-upsuser] trouble building nut for HID-USB
It does in fact show exactly what you describe. Udev is working properly with the device file being assigned to group dialout, which the nut user is in. You were correct about my having had to install the libusb-devel kit to make 2.7.4 build, but it does build properly and everything seems to be working well, except that the driver only sometimes loads. About 25% of the time I get this:> NUT Starting UPS model drivers: Network UPS Tools - UPS driver controller 2.7.4 > Network UPS Tools - Generic HID driver 0.41 (2.7.4) > USB communication driver 0.33 > Using subdriver: TrippLite HID 0.82and the rest of the time I get this:> NUT Starting UPS model drivers: Network UPS Tools - UPS driver controller 2.7.4 > Network UPS Tools - Generic HID driver 0.41 (2.7.4) > USB communication driver 0.33 > No matching HID UPS found > Driver failed to start (exit status=1)Which, sadly, is the same problem I was having with 2.6.5, although I think it is starting more often with 2.7.4. It is very disturbing, though, to see something that only sometimes works and I am not sure how to diagnose it from this point. Also.... I had to write a new startup script to make 2.7.4 work with Centos 6.8. It should work with all Centos 6. Do you want a copy of it? I am not sure I can donate it but I will see. --scott