johnea
2011-Jun-07 19:18 UTC
[Nut-upsuser] CyberPower usbhid-ups continuously disconnects/reconnects
Hello, I've had this same model CyberPower connected to a linux server and a freebsd server. [root at sensor003 menon]# lsusb Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 003 Device 004: ID 0764:0501 Cyber Power System, Inc. CP1500 AVR UPS Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub When the nut daemons start attempting to monitor the UPS, the device begins a cycle of disconnecting and reconnecting every 20sec. Running 'usbhid-ups -a nexups' manually, yields permissions issues: [root at sensor003 menon]# usbhid-ups -a nexups Network UPS Tools - Generic HID driver 0.34 (2.4.3) USB communication driver 0.31 Using subdriver: CyberPower HID 0.3 libusb_get_report: could not claim interface 0: Device or resource busy Got disconnected by another driver: Device or resource busy Can't initialize data from HID UPS [root at sensor003 network-ups-tools]# ls -l /dev/bus/usb/003/ total 0 crw-rw-r-- 1 root root 189, 256 Jun 7 10:55 001 crw-rw---- 1 root nut 189, 270 Jun 7 11:58 015 There is a udev rule to set permissions on this device: [root at sensor003 menon]# cat /etc/udev/rules.d/91-local.rules # set permissions for CyberPower UPS -jea 2010-06-02 SUBSYSTEM=="usb", ATTRS{idVendor}=="0764", GROUP="nut", MODE="0660" The group and permissions show that this has been applied. I'm not a linux-usb developer, and I don't quite get the depth of this, but it seems the system hid driver is attaching to this device as it enumerates, preventing the nut driver from attaching. This device was finally attached before (nut 2.4) after applying the patch mentioned here: http://www.mail-archive.com/nut-upsuser at lists.alioth.debian.org/msg05550.html This corrected for this low speed device not providing packets greater than 8 bytes in length. This patch didn't apply directly to the nut 2.6 source. Can anyone confirm if this 8byte low speed device buffer size limit is applied in 2.6? Thank You Very Much! johnea
nut at johnea.net
2011-Jun-07 20:03 UTC
[Nut-upsuser] CyberPower usbhid-ups continuously disconnects/reconnects
Hello, I've had this same model CyberPower connected to a linux server and a freebsd server. [root at sensor003 menon]# lsusb Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 003 Device 004: ID 0764:0501 Cyber Power System, Inc. CP1500 AVR UPS Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub When the nut daemons start attempting to monitor the UPS, the device begins a cycle of disconnecting and reconnecting every 20sec. Running 'usbhid-ups -a nexups' manually, yields permissions issues: [root at sensor003 menon]# usbhid-ups -a nexups Network UPS Tools - Generic HID driver 0.34 (2.4.3) USB communication driver 0.31 Using subdriver: CyberPower HID 0.3 libusb_get_report: could not claim interface 0: Device or resource busy Got disconnected by another driver: Device or resource busy Can't initialize data from HID UPS [root at sensor003 network-ups-tools]# ls -l /dev/bus/usb/003/ total 0 crw-rw-r-- 1 root root 189, 256 Jun 7 10:55 001 crw-rw---- 1 root nut 189, 270 Jun 7 11:58 015 There is a udev rule to set permissions on this device: [root at sensor003 menon]# cat /etc/udev/rules.d/91-local.rules # set permissions for CyberPower UPS -jea 2010-06-02 SUBSYSTEM=="usb", ATTRS{idVendor}=="0764", GROUP="nut", MODE="0660" The group and permissions show that this has been applied. I'm not a linux-usb developer, and I don't quite get the depth of this, but it seems the system hid driver is attaching to this device as it enumerates, preventing the nut driver from attaching. This device was finally attached before (nut 2.4) after applying the patch mentioned here: http://www.mail-archive.com/nut-upsuser at lists.alioth.debian.org/msg05550.html This corrected for this low speed device not providing packets greater than 8 bytes in length. This patch didn't apply directly to the nut 2.6 source. Can anyone confirm if this 8byte low speed device buffer size limit is applied in 2.6? Thank You Very Much! johnea
nut at johnea.net
2011-Jun-17 21:57 UTC
[Nut-upsuser] CyberPower usbhid-ups continuously disconnects/reconnects
On 06/17/2011 12:31 AM, Arnaud Quette wrote:> 2011/6/16 Charles Lepple <clepple at gmail.com> > >> On Jun 15, 2011, at 5:40 PM, nut at johnea.net wrote: >> (...) >> Is it consistently disconnecting every 20 seconds? That almost sounds like >> some proprietary extension to the HID protocol - the UPS expects the >> computer to send something that only the CyberPower software knows to send. > > > in this case, doing an usbsnoop run is the way to go: > http://lists.alioth.debian.org/pipermail/nut-upsdev/2010-February/004528.htmlIt seems the usbhid-ups driver already knows how to make the UPS happy. Once the driver has successfully connected to the UPS, the disconnect/reconnect cycle stops and the UPS stays connected and communicating from then on. It only misses connecting if the device is given enough time to disconnect (presumably because it timed out after 20sec). Unless the administrator can guarantee to _always_ connect to the device within 20sec of boot, the usbhid-ups needs to delay a second or two and then retry, 2 or 3 times, before giving up on finding the CyberPower subdriver based UPS.> cheers, > ArnaudThank You Arnaud! p.s. I tried to make a patch for this, but it failed, attached for reference -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: hid-retry.patch URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20110617/7f1445f6/attachment.ksh>