[Nut-upsuser] Problems with usbhid-ups and CyberPower CP1500 on 2.6.0

Cheetah fastcat at gmail.com
Mon Mar 14 05:20:31 UTC 2011


I've been running the Debian packaged 2.4.3 for a while, working find.  When 
2.6.0-1 just pushed through to debian, things have stopped working :(

I checked what had been the usual suspects in past problems, namely 
permissions problems in /dev/bus/usb, but all seems in order:

$ lsusb
...
Bus 009 Device 002: ID 0764:0501 Cyber Power System, Inc. CP1500 AVR UPS
$ ls -l /dev/bus/usb/009/002
crw-rw-r-- 1 root nut 189, 1025 Mar 14 00:50 /dev/bus/usb/009/002

But if I run the driver with debugging enabled, it gives this:

$ sudo /lib/nut/usbhid-ups -a cp1500 -D -D -D
...
    0.135837     Checking device (0764/0501) (009/002)
    0.158857     - VendorID: 0764
    0.158870     - ProductID: 0501
    0.158876     - Manufacturer: CPS
    0.158882     - Product:  CP 1500C
    0.158887     - Serial Number: unknown
    0.158891     - Bus: 009
    0.158896     Trying to match device
    0.158933     Device matches
    0.166875     HID descriptor, method 1: (9 bytes) => 09 21 10 01 21 01 22 
83 01
    0.166892     HID descriptor, method 2: (9 bytes) => 09 21 10 01 21 01 22 
83 01
    0.166899     HID descriptor length 387
    0.218888     Report Descriptor size = 387
    0.218907     Report Descriptor: (387 bytes) => ...
...
    0.219118     Using subdriver: CyberPower HID 0.3
    0.223871     libusb_get_report: error sending control message: Operation 
not permitted
    0.223890     Can't retrieve Report 01: Operation not permitted
    0.223902     Path: UPS.PowerSummary.iProduct, Type: Feature, ReportID: 
0x01, Offset: 0, Size: 8
    0.228837     libusb_get_report: error sending control message: Operation 
not permitted
    0.228860     Can't retrieve Report 02: Operation not permitted
... much repeating of stuff like this for many "Path"s ...
    0.448872     Report descriptor retrieved (Reportlen = 387)
    0.448878     Found HID device
    0.448882     Detected a UPS: CPS/ CP 1500C
    0.453873     libusb_get_report: error sending control message: Operation 
not permitted
    0.453890     Can't retrieve Report 03: Operation not permitted
    0.453898     Can't initialize data from HID UPS
<exits with return code 1>

If I run it under strace, the ioctls on the /dev/bus/usb file descriptor 
preceeding each "operation not permitted" error return 0, not an error code 
such as EPERM.

If I run it with -u root so that it doesn't drop permissions, it seems to 
work OK.  That doesn't work from ups.conf, though, and running the driver as 
root changes the permissions for the socket in /var/run such that the rest 
of nut can't talk to the driver!  I can fix that by manually chmod'ing the 
socket after startup, but that leaves things in a bit of a mess.

Exact versions of related packages:
nut 2.6.0-1
libupsclient1 2.6.0-1
libusb-0.1-4 2:0.1.12-17




More information about the Nut-upsuser mailing list