Valentin Merkulov
2018-Aug-19 19:03 UTC
[Nut-upsuser] TrippLite SMX1500LCDT FreeBSD 11.2 trouble
Here is what I get: # usbconfig -u 1 -a 3 dump_curr_config_desc ugen1.3: <Tripp Lite TRIPP LITE UPS> at usbus1, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON (100mA) Configuration index 0 bLength = 0x0009 bDescriptorType = 0x0002 wTotalLength = 0x0022 bNumInterfaces = 0x0001 bConfigurationValue = 0x0001 iConfiguration = 0x0000 <no string> bmAttributes = 0x00a0 bMaxPower = 0x0032 Interface 0 bLength = 0x0009 bDescriptorType = 0x0004 bInterfaceNumber = 0x0000 bAlternateSetting = 0x0000 bNumEndpoints = 0x0001 bInterfaceClass = 0x0003 <HID device> bInterfaceSubClass = 0x0000 bInterfaceProtocol = 0x0000 iInterface = 0x0000 <no string> Additional Descriptor bLength = 0x09 bDescriptorType = 0x21 bDescriptorSubType = 0x11 RAW dump: 0x00 | 0x09, 0x21, 0x11, 0x01, 0x00, 0x01, 0x22, 0x68, 0x08 | 0x03 Endpoint 0 bLength = 0x0007 bDescriptorType = 0x0005 bEndpointAddress = 0x0081 <IN> bmAttributes = 0x0003 <INTERRUPT> wMaxPacketSize = 0x0008 bInterval = 0x000c bRefresh = 0x0000 bSynchAddress = 0x0000 # usbconfig -u 1 -a 3 do_request 0x81 0x06 0x2200 0 0x100 REQUEST = <0x05 0x84 0x09 0x04 0xa1 0x01 0x09 0x24 0xa1 0x00 0x85 0x28 0x09 0xfe 0x79 0x01 0x75 0x08 0x95 0x01 0x15 0x00 0x26 0xff 0x00 0xb1 0x03 0x85 0x29 0x09 0xff 0x79 0x05 0xb1 0x03 0x85 0x2b 0x09 0xfd 0x79 0x03 0xb1 0x03 0x09 0x1a 0xa1 0x02 0x85 0x30 0x09 0x40 0x67 0x21 0xd1 0xf0 0x00 0x55 0x07 0xb1 0x83 0x85 0x31 0x09 0x30 0x75 0x10 0x95 0x01 0x15 0x00 0x27 0xff 0xff 0x00 0x00 0x67 0x21 0xd1 0xf0 0x00 0x55 0x01 0xb1 0x02 0xc0 0x85 0x11 0x09 0x5a 0x75 0x08 0x95 0x01 0x15 0x01 0x25 0x03 0x65 0x00 0x55 0x00 0xb1 0x82 0x09 0x02 0xa1 0x02 0x85 0x32 0x75 0x01 0x95 0x07 0x15 0x00 0x25 0x01 0x81 0x03 0xb1 0x03 0x09 0x62 0x95 0x01 0xb1 0xa2 0x09 0x62 0x81 0xa2 0xb1 0x01 0x81 0x01 0x09 0x69 0xb1 0xa2 0x09 0x69 0x81 0xa2 0x95 0x06 0xb1 0x01 0x81 0x01 0x05 0x85 0x09 0xd0 0x95 0x01 0x81 0xa2 0x09 0xd0 0xb1 0xa2 0x81 0x01 0xb1 0x01 0x95 0x06 0x09 0x42 0x09 0x46 0x09 0x44 0x09 0x45 0x09 0x47 0x09 0x4b 0x81 0xa2 0x09 0x42 0x09 0x46 0x09 0x44 0x09 0x45 0x09 0x47 0x09 0x4b 0xb1 0xa2 0xc0 0x85 0x2a 0x09 0x89 0x79 0x07 0x75 0x08 0x95 0x01 0x15 0x00 0x26 0xff 0x00 0xb1 0x03 0x85 0x62 0x09 0x8f 0x79 0x08 0xb1 0x03 0x85 0x33 0x09 0x2c 0xb1 0x03 0x85 0x34 0x09 0x66 0x81 0xa2 0x09 0x66 0xb1 0xa2 0x85 0x37 0x09 0x67 0xb1 0x03 0x85 0x36 0x09 0x83 0xb1 0x03 0x85 0x38 0x09 0x8c 0xb1 0xa2 0x85><$(yu&)y+y0 at g!U10u'g!UZu%eU2u%bbiiBFDEGKBFDEGK*yu&by3,4ff7g68> On Sun, Aug 19, 2018 at 9:00 PM, Charles Lepple <clepple at gmail.com> wrote:> On Aug 19, 2018, at 2:04 AM, Valentin Merkulov <schnobel at ickis.net> wrote: >> >> Hi Everyone, >> >> I'm having trouble getting TrippLite SMX1500LCDT to work on FreeBSD >> 11.2, nut 2.7.4 installed from FreeBSD port. >> >> The debug output is rather big when I'm starting usbhid-ups initially, >> Please find that attached (gzipped to comply with message size limit). >> >> Subsequently, until I unplug and replug the USB cable, I'm geting a >> shorter debug output, like this: >> >> Network UPS Tools - Generic HID driver 0.41 (2.7.4) >> USB communication driver 0.33 >> 0.000000 debug level is '4' >> 0.001278 upsdrv_initups... >> 0.001596 Checking device (09AE/3016) (/dev/usb//dev/ugen1.3) >> 0.034084 - VendorID: 09ae >> 0.034093 - ProductID: 3016 > > The Tripp-Lite 3016 Protocol devices have been problematic. It seems as though they are particularly sensitive to cable quality, and also tend to exhibit problems with motherboards from the last few years (around the time that USB 3.0 was introduced, though the UPS is only using USB 1.1 at 1.5 Mbit/sec). Several people have proposed workarounds that involve programmatically disconnecting the USB port for the UPS, which is clever, but probably not the sort of thing you would want to rely on. You may have better luck using a different system running the NUT driver, such as a Raspberry Pi or Beaglebone Black, as ARM boards seem less affected (but not 100% reliable) with 3016 devices. > > Can you try the following commands as root? > > usbconfig -u 1 -a 3 dump_curr_config_desc > > usbconfig -u 1 -a 3 do_request 0x81 0x06 0x2200 0 0x100 > > (The "-u" and "-a" options are based on the /dev/ugen1.3 line above - adjust the numbers as appropriate after unplugging and re-plugging the USB cable.) > > Since usbconfig is part of the base FreeBSD distribution, and not part of NUT, this should identify whether the problem is with NUT's USB/HID implementation, or with the kernel/motherboard combination.
Charles Lepple
2018-Aug-20 01:33 UTC
[Nut-upsuser] TrippLite SMX1500LCDT FreeBSD 11.2 trouble
On Aug 19, 2018, at 3:03 PM, Valentin Merkulov <schnobel at ickis.net> wrote:> > Here is what I get: > > # usbconfig -u 1 -a 3 dump_curr_config_desc > ugen1.3: <Tripp Lite TRIPP LITE UPS> at usbus1, cfg=0 md=HOST spd=LOW > (1.5Mbps) pwr=ON (100mA) >[...] Hmm, that may be an issue on the NUT side, then. (You might see issues if you run those commands repeatedly, though.) We are working on another branch that uses the newer libusb-1.0 APIs. I haven't had to modify a ports tree package in a while, but it should be possible to substitute one of our snapshots from that branch. You can grab a tarball from here: http://buildbot.networkupstools.org/~buildbot/docker-debian-jessie/snapshot/libusb-compat-1.0/rb14c3b4fe2540a6b4181918fb89678b68733a814-887/nut-v2.7.4-603-gb14c3b42.7.4.1.tar.gz and use that instead of the official NUT 2.7.4 tarball. SHA256(nut-v2.7.4-603-gb14c3b42.7.4.1.tar.gz)= 4d67212669d777961f5a0c9215f1853004997cf225abeba3360453439390c6bd Some history of that branch (and other related branches) here: https://github.com/networkupstools/nut/issues/300
Valentin Merkulov
2018-Aug-20 05:03 UTC
[Nut-upsuser] TrippLite SMX1500LCDT FreeBSD 11.2 trouble
OK, from this build I get the following: # /usr/local/ups/bin/usbhid-ups -a ups -DDDD Network UPS Tools - Generic HID driver 0.53 (v2.7.4-603-gb14c3b42.7.4.1) USB communication driver 0.37 0.000000 [D1] debug level is '4' 0.001299 [D1] upsdrv_initups... 0.001450 [D2] nut_libusb_open: checking device 1 of 1. 0.033333 [D2] nut_libusb_open: - VendorID: 09ae. 0.033345 [D2] nut_libusb_open: - ProductID: 3016. 0.033350 [D2] nut_libusb_open: - Manufacturer: Tripp Lite. 0.033353 [D2] nut_libusb_open: - Product: TRIPP LITE UPS. 0.033357 [D2] nut_libusb_open: - Serial Number: unknown. 0.033361 [D2] nut_libusb_open: - Bus: 001. 0.033365 [D2] nut_libusb_open: - Device release number: 0002. 0.033368 [D2] nut_libusb_open: trying to match device... 0.033386 [D2] nut_libusb_open: device matches. 0.033399 [D3] nut_usb_claim_interface: libusb_kernel_driver_active() returned 1 (driver active). 0.033404 [D3] nut_usb_claim_interface: successfully set kernel driver auto-detach flag. 0.033412 [D3] nut_usb_claim_interface: failed to claim USB device (Other error). 0.033417 [D3] nut_usb_claim_interface: failed to detach kernel driver from USB device (Other error). 0.033422 [D3] nut_usb_claim_interface: failed to claim USB device (Other error). 0.033430 [D3] nut_usb_claim_interface: failed to detach kernel driver from USB device (Other error). 0.033434 [D3] nut_usb_claim_interface: failed to claim USB device (Other error). 0.033438 [D3] nut_usb_claim_interface: failed to detach kernel driver from USB device (Other error). 0.033443 [D3] nut_usb_claim_interface: failed to claim USB device (Other error). 0.033448 Can't claim USB device 09ae:3016 (Other error). 0.033456 [D1] upsdrv_cleanup... On Mon, Aug 20, 2018 at 4:33 AM, Charles Lepple <clepple at gmail.com> wrote:> On Aug 19, 2018, at 3:03 PM, Valentin Merkulov <schnobel at ickis.net> wrote: >> >> Here is what I get: >> >> # usbconfig -u 1 -a 3 dump_curr_config_desc >> ugen1.3: <Tripp Lite TRIPP LITE UPS> at usbus1, cfg=0 md=HOST spd=LOW >> (1.5Mbps) pwr=ON (100mA) >> > [...] > > Hmm, that may be an issue on the NUT side, then. (You might see issues if you run those commands repeatedly, though.) > > We are working on another branch that uses the newer libusb-1.0 APIs. I haven't had to modify a ports tree package in a while, but it should be possible to substitute one of our snapshots from that branch. You can grab a tarball from here: > > http://buildbot.networkupstools.org/~buildbot/docker-debian-jessie/snapshot/libusb-compat-1.0/rb14c3b4fe2540a6b4181918fb89678b68733a814-887/nut-v2.7.4-603-gb14c3b42.7.4.1.tar.gz > > and use that instead of the official NUT 2.7.4 tarball. > > SHA256(nut-v2.7.4-603-gb14c3b42.7.4.1.tar.gz)= 4d67212669d777961f5a0c9215f1853004997cf225abeba3360453439390c6bd > > Some history of that branch (and other related branches) here: https://github.com/networkupstools/nut/issues/300