[Nut-upsuser] Problem with NUT and an Eaton 5PX UPS, usbhid-ups won't start
Kris Jordan
nut.kj at sagebrushnetworks.com
Fri Feb 8 20:53:46 UTC 2013
Stefan wrote, On 2/8/2013 12:16 PM:
> 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.
I normally reply only to the list.
> "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.
lsusb for mine takes,
real 0m4.891s
5s would be cutting it close.
Perhaps that's also why it's not working on Windows.
> Now where do I bug report this?
They're on this list, but they've been quiet for a while.
More information about the Nut-upsuser
mailing list