[Nut-upsuser] Problem with NUT and an Eaton 5PX UPS, usbhid-ups won't start
Stefan
stevenbg at gmail.com
Fri Feb 8 20:16:15 UTC 2013
Hey, thanks for answering. I haven't used a mailing list before and
I'm not sure where to send my reply. Anyway I found the problem.
"lsusb -v -s 006:002" returned the ups descriptor just fine, so I
figured there is something wrong in usbhid-ups. Thing is, lsusb takes
about 5 seconds to run, while usbhid-ups clearly has a 4 seconds
timeout for getting the FULL descriptor. I did some snooping with
usbmon and I found out that 4 seconds are not enough to receive the
whole descriptor (it got to 2312 of 2580 bytes).
I downloaded the nut source and did some digging.
In file /root/nut-2.6.5/drivers/libusb.c
somebody lowered the default timeout:
/* USB standard state 5000, but we've decreased it to
* improve reactivity */
#define USB_TIMEOUT 4000
So here are those 4 seconds ruining my day. I increased the timeout to
8000, compiled and everything runs fine now:
0.263313 Checking device (0463/FFFF) (006/002)
0.566989 - VendorID: 0463
0.567026 - ProductID: ffff
0.567043 - Manufacturer: EATON
0.567060 - Product: Eaton 5PX
0.567076 - Serial Number: G097C22040
0.567092 - Bus: 006
0.567107 Trying to match device
0.567129 Device matches
0.619001 HID descriptor, method 1: (9 bytes) => 09 21 10 01 21
01 22 14 0a
0.619026 i=0, extra[i]=09, extra[i+1]=21
0.619051 HID descriptor, method 2: (9 bytes) => 09 21 10 01 21
01 22 14 0a
0.619069 HID descriptor length 2580
5.073991 Report Descriptor size = 2580
5.074039 Report Descriptor: (2580 bytes) => 05 84 09 04 a1 01
09 10 a1 00 09 12 a1
(snipped)
Turns out it was a matter of 0.4s, so the USB standard 5 seconds would
have worked as expected.
Now where do I bug report this?
On 8 February 2013 05:59, Kris Jordan <nut.kj at sagebrushnetworks.com> wrote:
> I couldn't get a 5PX1500RT to work with NUT 2.6.5-4 on Windows using usbhid.
>
> In your Log,
> 4.805060 No appropriate HID device found
> 4.805087 No matching HID UPS found
>
> I got those on my Windows test machine.
>
> I recently compiled NUT 2.6.5-4 on Centos 5. It seems to be working with
> usbhid-ups. Not sure why it doesn't on Windows. Though, I still do get some
> errors,
>
> Warning: report descriptor too short (expected 2580, got 2312)
> libusb_get_report: Connection timed out
> Can't retrieve Report 28: Connection timed out
> libusb_get_interrupt: Connection timed out
>
> and
>
> USBDEVFS_CONTROL failed cmd usbhid-ups rqt 161 rq 1 len 2 ret -110
>
> kernel messages. A higher pollinterval doesn't eliminate that. Seems to only
> happen when the driver starts.
>
> Try updating NUT to 2.6.5, you could also try mge-shut (I'm using the newer
> mge-shut driver) over serial, that seems to work fine (on my Windows machine
> anyway).
>
> Stefan wrote, On 2/7/2013 3:33 PM:
>>
>> Hello,
>>
>> I have trouble connecting to an Eaton 5PX UPS via the usbhid-ups
>> driver. It is supposed to be fully working according to the
>> compatibility list (support level 5).
>>
>> OS: A fresh Debian stable install. Then changed the apt source to
>> unstable and did "aptitute update" and "aptitude install nut". Nothing
>> else. I did that, because the "unstable" package is a more recent
>> version and I've already tried with "stable" a few days before. The
>> hard drive was changed, so there are no old version leftovers to worry
>> about.
>>
>> NUT version: the Debian package says 2.6.4-2.3
>>
>> NUT installation method: Debian unstable package
>> (http://packages.debian.org/sid/nut)
>>
>> UPS info: Eaton 5PX3000iRT3U, which is the European (220V) version of
>> 5PX3000RT3U.
>> http://powerquality.eaton.com/5PX3000iRT3U.aspx?CX=101
>>
>> I tried to power cycle the machine, as well as the UPS.
>>
>> Permissions seem fine:
>> root at backup:/usr/share/doc/nut# ls -al /dev/bus/usb/006/002
>> crw-rw-r-- 1 root nut 189, 641 Feb 8 01:26 /dev/bus/usb/006/002
>>
>> /lib/nut/usbhid-ups -DDDD -a myups
>> whole log: http://pastebin.com/Xc57QUft
>> relevant part:
>> 0.265426 Checking device (0463/FFFF) (006/002)
>> 0.570524 - VendorID: 0463
>> 0.570560 - ProductID: ffff
>> 0.570578 - Manufacturer: EATON
>> 0.570595 - Product: Eaton 5PX
>> 0.570612 - Serial Number: G097C22040
>> 0.570629 - Bus: 006
>> 0.570646 Trying to match device
>> 0.570678 Device matches
>> 0.621532 HID descriptor, method 1: (9 bytes) => 09 21 10 01 21
>> 01 22 14 0a
>> 0.621569 i=0, extra[i]=09, extra[i+1]=21
>> 0.621595 HID descriptor, method 2: (9 bytes) => 09 21 10 01 21
>> 01 22 14 0a
>> 0.621614 HID descriptor length 2580
>> 4.622305 Unable to get Report descriptor: Connection timed out
>>
>> I don't know how to provide more info about that connection timeout.
>>
>> Steven
>
>
> _______________________________________________
> Nut-upsuser mailing list
> Nut-upsuser at lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser
More information about the Nut-upsuser
mailing list