[Nut-upsuser] Can't claim USB device: Invalid parameter

Jason Doolittle jason at flintegratedtech.com
Wed Feb 7 13:22:00 GMT 2024


I am working in Ubuntu Linux on a Raspberry Pi 5. Nut is unable to connect to USB UPSs.

uname -srvmpio
Linux 6.5.0-1009-raspi #12-Ubuntu SMP PREEMPT_DYNAMIC Wed Jan 17 11:45:08 UTC 2024 aarch64 aarch64 aarch64 GNU/Linux

Current Installed version of nut is 2.8.0-7 installed with apt

apt-cache policy nut
nut:
  Installed: 2.8.0-7
  Candidate: 2.8.0-7
  Version table:
*** 2.8.0-7 500
        500 http://ports.ubuntu.com/ubuntu-ports mantic/main arm64 Packages
        100 /var/lib/dpkg/status

I currently have 2 UPSs connected to the system
A Powervar UPM UPS
Bus 003 Device 002: ID 4234:0002 AMETEK-POWERVAR Corporation UPM UPS (v01.51, Nov  3 2018)

An APC Back-UPS Pro 1500
Bus 001 Device 002: ID 051d:0002 American Power Conversion Uninterruptible Power Supply

It appears that the all of the permissions were set up correctly during installation. The nut user and group were created and the usb devices have the correct ownership and permissions set per the udev rules

For the Powervar:
crw-rw-r-- 1 root nut 189, 257 Feb  7 06:42 /dev/bus/usb/003/002

For the APC:
crw-rw-r-- 1 root nut 189, 1 Feb  7 06:42 /dev/bus/usb/001/002

In ups.conf, I have this:

[PowervarUPS01]
driver = "usbhid-ups"
port = "auto"
vendorid = "4234"
productid = "0002"

[APCUPS01]
driver = "usbhid-ups"
port = "auto"
vendorid = "051D"
productid = "0002"

The UPSs are matched, but drivers continuously fail to start. Here is the output from running the usbhid-ups driver manually for the Powervar:

sudo /usr/lib/nut/usbhid-ups -u root -a PowervarUPS01 -DD

Network UPS Tools - Generic HID driver 0.47 (2.8.0)
USB communication driver (libusb 1.0) 0.43
   0.000000 [D1] debug level is '2'
   0.001191 [D2] Initializing an USB-connected UPS with library libusb-1.0.26 (API: 0x1000109) (NUT subdriver name='USB communication driver (libusb 1.0)' ver='0.43')
   0.001209 [D1] upsdrv_initups (non-SHUT)...
   0.006358 [D2] Checking device 1 of 6 (1D6B/0003)
   0.006385 [D1] Failed to open device (1D6B/0003), skipping: Access denied (insufficient permissions)
   0.006393 [D2] Checking device 2 of 6 (4234/0002)
   0.007354 [D2] - VendorID: 4234
   0.007364 [D2] - ProductID: 0002
   0.007371 [D2] - Manufacturer: AMETEK-POWERVAR Corporation
   0.007378 [D2] - Product: UPM UPS (v01.51, Nov  3 2018)
   0.007385 [D2] - Serial Number: 5008094R-1940438
   0.007395 [D2] - Bus: 003
   0.007402 [D2] - Device: unknown
   0.007409 [D2] - Device release number: 0002
   0.007418 [D2] Trying to match device
   0.007425 [D2] match_function_subdriver (non-SHUT mode): matching a device...
   0.007485 [D2] Device matches
   0.007497 [D2] Reading first configuration descriptor
   0.007505 [D2] result: -5 (Entity not found)
   0.007517 [D2] failed to claim USB device: Entity not found
   0.007529 [D1] failed to detach kernel driver from USB device: Invalid parameter
   0.007539 [D2] failed to claim USB device: Entity not found
   0.007549 [D1] failed to detach kernel driver from USB device: Invalid parameter
   0.007560 [D2] failed to claim USB device: Entity not found
   0.007574 [D1] failed to detach kernel driver from USB device: Invalid parameter
   0.007582 [D2] failed to claim USB device: Entity not found
   0.007594 [D1] failed to detach kernel driver from USB device: Invalid parameter
   0.007604 Can't claim USB device [4234:0002]@1/0: Invalid parameter

I get basically the same from the APC.

I think the "failed to detach kernel driver from USB device: Invalid parameter" is the key here, especially the "Invalid parameter" part, but after a few hours of poking at things, I haven't made any progress.

I would be eternally grateful if someone could point me in the right direction.



More information about the Nut-upsuser mailing list