linkinpiocz
2024-Oct-18 11:33 UTC
[Nut-upsuser] NUT 2.8.0-7 Can't claim USB device [2341:8036]@2/0: Invalid parameter using usbhid-ups
Hello All, I have been trying to get NUT package working on proxmox host with Arduino HIDPowerDevice (https://github.com/abratchik/HIDPowerDevice) And I have been banding my head against the wall and looking through the internet why I am getting "Can't claim USB device [2341:8036]@2/0: Invalid parameter" error, but could not find anything relevant. The information : - OS name and version, root at pve2:~# cat /etc/os-release PRETTY_NAME="Debian GNU/Linux 12 (bookworm)" NAME="Debian GNU/Linux" VERSION_ID="12" VERSION="12 (bookworm)" VERSION_CODENAME=bookworm ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/" root at pve2:~# pveversion pve-manager/8.2.7/3e0176e6bb2ade3b (running kernel: 6.8.12-2-pve) root at pve2:~# - exact NUT version, root at pve2:~# apt list nut* Listing... Done nut-cgi/stable 2.8.0-7 amd64 nut-client/stable,now 2.8.0-7 amd64 [installed] nut-doc/stable 2.8.0-7 all nut-i2c/stable 2.8.0-7 amd64 nut-ipmi/stable 2.8.0-7 amd64 nut-modbus/stable 2.8.0-7 amd64 nut-monitor/stable 2.8.0-7 all nut-powerman-pdu/stable 2.8.0-7 amd64 nut-server/stable,now 2.8.0-7 amd64 [installed] nut-snmp/stable 2.8.0-7 amd64 nut-xml/stable 2.8.0-7 amd64 nut/stable,now 2.8.0-7 all [installed] nutcracker/stable 0.5.0+dfsg-2 amd64 nutsqlite/stable 2.0.6-3 all nuttcp/stable 6.1.2-4+b1 amd64 root at pve2:~# - NUT installation method: package, or a custom build from source tarball or GitHub (which fork, branch, PR), package using official Debian repository - exact device name and related information (manufacturing date, web pointers, ?), this is Arduino ProMicro ATmega32u4 using Arduino Leonardo library? and HIDPowerDevice sketch from (https://github.com/abratchik/HIDPowerDevice) library - complete problem description, with any relevant traces, like system log excerpts, and driver debug output. You can obtain the latter using the following command, running as root and after having stopped NUT: /path/to/driver -DD -a <upsname> Problem is that system reports invalid parameter and can't claim USB device after it has detected it successfully: root at pve2:~# lsusb | grep -i arduino Bus 002 Device 009: ID 2341:8036 Arduino SA Leonardo (CDC ACM, HID) root at pve2:~# nut-scanner -U Scanning USB bus. [nutdev1] driver = "usbhid-ups" port = "auto" vendorid = "2341" productid = "8036" product = "Arduino Leonardo No CDC" serial = "HIDAJ" vendor = "Arduino LLC" bus = "002" root at pve2:~# grep "^[^#]" /etc/nut/ups.conf maxretry = 3 user = root [ups1] driver = usbhid-ups port = auto vendorid = 2341 productid = 8036 root at pve2:~# /usr/lib/nut/usbhid-ups -a ups1 -DDD -d1 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 '3' 0.000578 [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.000590 [D1] upsdrv_initups (non-SHUT)... 0.006011 [D2] Checking device 1 of 7 (2341/8036) 0.008619 [D2] - VendorID: 2341 0.008635 [D2] - ProductID: 8036 0.008641 [D2] - Manufacturer: Arduino LLC 0.008647 [D2] - Product: Arduino Leonardo No CDC 0.008652 [D2] - Serial Number: HIDAJ 0.008657 [D2] - Bus: 002 0.008666 [D2] - Device: unknown 0.008678 [D2] - Device release number: 0100 0.008683 [D2] Trying to match device 0.008689 [D2] match_function_subdriver (non-SHUT mode): matching a device... 0.008697 [D3] match_function_regex: matching a device... 0.008764 [D2] Device matches 0.008774 [D2] Reading first configuration descriptor 0.008783 [D2] result: -5 (Entity not found) 0.008794 [D3] libusb_kernel_driver_active() returned 0 0.008803 [D2] failed to claim USB device: Entity not found 0.008813 [D1] failed to detach kernel driver from USB device: Invalid parameter 0.008824 [D2] failed to claim USB device: Entity not found 0.008835 [D1] failed to detach kernel driver from USB device: Invalid parameter 0.008845 [D2] failed to claim USB device: Entity not found 0.008856 [D1] failed to detach kernel driver from USB device: Invalid parameter 0.008866 [D2] failed to claim USB device: Entity not found 0.008875 [D1] failed to detach kernel driver from USB device: Invalid parameter 0.008883 Can't claim USB device [2341:8036]@2/0: Invalid parameter root at pve2:~# upsdrvctl start Network UPS Tools - UPS driver controller 2.8.0 Network UPS Tools - Generic HID driver 0.47 (2.8.0) USB communication driver (libusb 1.0) 0.43 Can't claim USB device [2341:8036]@2/0: Invalid parameter Driver failed to start (exit status=1) Please help me or guide me where I should look further for the issue. -- Best regards, linkinpio
Jim Klimov
2024-Oct-18 13:31 UTC
[Nut-upsuser] NUT 2.8.0-7 Can't claim USB device [2341:8036]@2/0: Invalid parameter using usbhid-ups
Hello, I think there were some PRs from abratchik and/or others, related to Arduino support in NUT, one big aspect being that these are typically composite devices and the older codebase assumption that USB HID interface and endpoints at hardcoded numbers became no longer valid. Recent NUT releases have ways to configure those; IIRC a detected Arduino defaults to "1" not "0" to work out of the box. Some changes were relatively recent and packages in distro tend to lag behind, so a custom build of current master branch may be preferential - see NUT wiki on github for example: https://github.com/networkupstools/nut/wiki/Building-NUT-for-in%E2%80%90place-upgrades-or-non%E2%80%90disruptive-tests Also there may be an issue of `udev.rules` preset for particular vendor+product ID device filesystem nodes to be owned by run-time `nut` user. As a quick check/workaround, running with `user=root` can help about this (if indeed permissions alone are the issue). Hope this helps, Jim Klimov On Fri, Oct 18, 2024, 13:58 linkinpiocz via Nut-upsuser < nut-upsuser at alioth-lists.debian.net> wrote:> Hello All, > > I have been trying to get NUT package working on proxmox host with > Arduino HIDPowerDevice (https://github.com/abratchik/HIDPowerDevice) > And I have been banding my head against the wall and looking through the > internet why I am getting "Can't claim USB device [2341:8036]@2/0: > Invalid parameter" error, but could not find anything relevant. > > The information : > > - OS name and version, > root at pve2:~# cat /etc/os-release > PRETTY_NAME="Debian GNU/Linux 12 (bookworm)" > NAME="Debian GNU/Linux" > VERSION_ID="12" > VERSION="12 (bookworm)" > VERSION_CODENAME=bookworm > ID=debian > HOME_URL="https://www.debian.org/" > SUPPORT_URL="https://www.debian.org/support" > BUG_REPORT_URL="https://bugs.debian.org/" > > root at pve2:~# pveversion > pve-manager/8.2.7/3e0176e6bb2ade3b (running kernel: 6.8.12-2-pve) > root at pve2:~# > > > - exact NUT version, > root at pve2:~# apt list nut* > Listing... Done > nut-cgi/stable 2.8.0-7 amd64 > nut-client/stable,now 2.8.0-7 amd64 [installed] > nut-doc/stable 2.8.0-7 all > nut-i2c/stable 2.8.0-7 amd64 > nut-ipmi/stable 2.8.0-7 amd64 > nut-modbus/stable 2.8.0-7 amd64 > nut-monitor/stable 2.8.0-7 all > nut-powerman-pdu/stable 2.8.0-7 amd64 > nut-server/stable,now 2.8.0-7 amd64 [installed] > nut-snmp/stable 2.8.0-7 amd64 > nut-xml/stable 2.8.0-7 amd64 > nut/stable,now 2.8.0-7 all [installed] > nutcracker/stable 0.5.0+dfsg-2 amd64 > nutsqlite/stable 2.0.6-3 all > nuttcp/stable 6.1.2-4+b1 amd64 > root at pve2:~# > > - NUT installation method: package, or a custom build from source > tarball or GitHub (which fork, branch, PR), > package using official Debian repository > > - exact device name and related information (manufacturing date, web > pointers, ?), > this is Arduino ProMicro ATmega32u4 using Arduino Leonardo library and > HIDPowerDevice sketch from (https://github.com/abratchik/HIDPowerDevice) > library > > - complete problem description, with any relevant traces, like system > log excerpts, and driver debug output. You can obtain the latter using > the following command, running as root and after having stopped NUT: > /path/to/driver -DD -a <upsname> > > Problem is that system reports invalid parameter and can't claim USB > device after it has detected it successfully: > > root at pve2:~# lsusb | grep -i arduino > Bus 002 Device 009: ID 2341:8036 Arduino SA Leonardo (CDC ACM, HID) > > root at pve2:~# nut-scanner -U > Scanning USB bus. > [nutdev1] > driver = "usbhid-ups" > port = "auto" > vendorid = "2341" > productid = "8036" > product = "Arduino Leonardo No CDC" > serial = "HIDAJ" > vendor = "Arduino LLC" > bus = "002" > > root at pve2:~# grep "^[^#]" /etc/nut/ups.conf > maxretry = 3 > user = root > [ups1] > driver = usbhid-ups > port = auto > vendorid = 2341 > productid = 8036 > > root at pve2:~# /usr/lib/nut/usbhid-ups -a ups1 -DDD -d1 > 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 '3' > 0.000578 [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.000590 [D1] upsdrv_initups (non-SHUT)... > 0.006011 [D2] Checking device 1 of 7 (2341/8036) > 0.008619 [D2] - VendorID: 2341 > 0.008635 [D2] - ProductID: 8036 > 0.008641 [D2] - Manufacturer: Arduino LLC > 0.008647 [D2] - Product: Arduino Leonardo No CDC > 0.008652 [D2] - Serial Number: HIDAJ > 0.008657 [D2] - Bus: 002 > 0.008666 [D2] - Device: unknown > 0.008678 [D2] - Device release number: 0100 > 0.008683 [D2] Trying to match device > 0.008689 [D2] match_function_subdriver (non-SHUT mode): matching a > device... > 0.008697 [D3] match_function_regex: matching a device... > 0.008764 [D2] Device matches > 0.008774 [D2] Reading first configuration descriptor > 0.008783 [D2] result: -5 (Entity not found) > 0.008794 [D3] libusb_kernel_driver_active() returned 0 > 0.008803 [D2] failed to claim USB device: Entity not found > 0.008813 [D1] failed to detach kernel driver from USB device: Invalid > parameter > 0.008824 [D2] failed to claim USB device: Entity not found > 0.008835 [D1] failed to detach kernel driver from USB device: Invalid > parameter > 0.008845 [D2] failed to claim USB device: Entity not found > 0.008856 [D1] failed to detach kernel driver from USB device: Invalid > parameter > 0.008866 [D2] failed to claim USB device: Entity not found > 0.008875 [D1] failed to detach kernel driver from USB device: Invalid > parameter > 0.008883 Can't claim USB device [2341:8036]@2/0: Invalid parameter > > root at pve2:~# upsdrvctl start > Network UPS Tools - UPS driver controller 2.8.0 > Network UPS Tools - Generic HID driver 0.47 (2.8.0) > USB communication driver (libusb 1.0) 0.43 > Can't claim USB device [2341:8036]@2/0: Invalid parameter > Driver failed to start (exit status=1) > > > Please help me or guide me where I should look further for the issue. > > -- > Best regards, > linkinpio > > > _______________________________________________ > Nut-upsuser mailing list > Nut-upsuser at alioth-lists.debian.net > https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://alioth-lists.debian.net/pipermail/nut-upsuser/attachments/20241018/6fbb9f08/attachment.htm>
Kelly Byrd
2024-Oct-18 13:34 UTC
[Nut-upsuser] NUT 2.8.0-7 Can't claim USB device [2341:8036]@2/0: Invalid parameter using usbhid-ups
Hi, you need a newer version of NUT. I was doing a similar project with that library and NUT needed some PRs to get it work. IIRC, v2.8.2 has everything needed. On Fri, Oct 18, 2024 at 4:58?AM linkinpiocz via Nut-upsuser < nut-upsuser at alioth-lists.debian.net> wrote:> Hello All, > > I have been trying to get NUT package working on proxmox host with > Arduino HIDPowerDevice (https://github.com/abratchik/HIDPowerDevice) > And I have been banding my head against the wall and looking through the > internet why I am getting "Can't claim USB device [2341:8036]@2/0: > Invalid parameter" error, but could not find anything relevant. > > The information : > > - OS name and version, > root at pve2:~# cat /etc/os-release > PRETTY_NAME="Debian GNU/Linux 12 (bookworm)" > NAME="Debian GNU/Linux" > VERSION_ID="12" > VERSION="12 (bookworm)" > VERSION_CODENAME=bookworm > ID=debian > HOME_URL="https://www.debian.org/" > SUPPORT_URL="https://www.debian.org/support" > BUG_REPORT_URL="https://bugs.debian.org/" > > root at pve2:~# pveversion > pve-manager/8.2.7/3e0176e6bb2ade3b (running kernel: 6.8.12-2-pve) > root at pve2:~# > > > - exact NUT version, > root at pve2:~# apt list nut* > Listing... Done > nut-cgi/stable 2.8.0-7 amd64 > nut-client/stable,now 2.8.0-7 amd64 [installed] > nut-doc/stable 2.8.0-7 all > nut-i2c/stable 2.8.0-7 amd64 > nut-ipmi/stable 2.8.0-7 amd64 > nut-modbus/stable 2.8.0-7 amd64 > nut-monitor/stable 2.8.0-7 all > nut-powerman-pdu/stable 2.8.0-7 amd64 > nut-server/stable,now 2.8.0-7 amd64 [installed] > nut-snmp/stable 2.8.0-7 amd64 > nut-xml/stable 2.8.0-7 amd64 > nut/stable,now 2.8.0-7 all [installed] > nutcracker/stable 0.5.0+dfsg-2 amd64 > nutsqlite/stable 2.0.6-3 all > nuttcp/stable 6.1.2-4+b1 amd64 > root at pve2:~# > > - NUT installation method: package, or a custom build from source > tarball or GitHub (which fork, branch, PR), > package using official Debian repository > > - exact device name and related information (manufacturing date, web > pointers, ?), > this is Arduino ProMicro ATmega32u4 using Arduino Leonardo library and > HIDPowerDevice sketch from (https://github.com/abratchik/HIDPowerDevice) > library > > - complete problem description, with any relevant traces, like system > log excerpts, and driver debug output. You can obtain the latter using > the following command, running as root and after having stopped NUT: > /path/to/driver -DD -a <upsname> > > Problem is that system reports invalid parameter and can't claim USB > device after it has detected it successfully: > > root at pve2:~# lsusb | grep -i arduino > Bus 002 Device 009: ID 2341:8036 Arduino SA Leonardo (CDC ACM, HID) > > root at pve2:~# nut-scanner -U > Scanning USB bus. > [nutdev1] > driver = "usbhid-ups" > port = "auto" > vendorid = "2341" > productid = "8036" > product = "Arduino Leonardo No CDC" > serial = "HIDAJ" > vendor = "Arduino LLC" > bus = "002" > > root at pve2:~# grep "^[^#]" /etc/nut/ups.conf > maxretry = 3 > user = root > [ups1] > driver = usbhid-ups > port = auto > vendorid = 2341 > productid = 8036 > > root at pve2:~# /usr/lib/nut/usbhid-ups -a ups1 -DDD -d1 > 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 '3' > 0.000578 [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.000590 [D1] upsdrv_initups (non-SHUT)... > 0.006011 [D2] Checking device 1 of 7 (2341/8036) > 0.008619 [D2] - VendorID: 2341 > 0.008635 [D2] - ProductID: 8036 > 0.008641 [D2] - Manufacturer: Arduino LLC > 0.008647 [D2] - Product: Arduino Leonardo No CDC > 0.008652 [D2] - Serial Number: HIDAJ > 0.008657 [D2] - Bus: 002 > 0.008666 [D2] - Device: unknown > 0.008678 [D2] - Device release number: 0100 > 0.008683 [D2] Trying to match device > 0.008689 [D2] match_function_subdriver (non-SHUT mode): matching a > device... > 0.008697 [D3] match_function_regex: matching a device... > 0.008764 [D2] Device matches > 0.008774 [D2] Reading first configuration descriptor > 0.008783 [D2] result: -5 (Entity not found) > 0.008794 [D3] libusb_kernel_driver_active() returned 0 > 0.008803 [D2] failed to claim USB device: Entity not found > 0.008813 [D1] failed to detach kernel driver from USB device: Invalid > parameter > 0.008824 [D2] failed to claim USB device: Entity not found > 0.008835 [D1] failed to detach kernel driver from USB device: Invalid > parameter > 0.008845 [D2] failed to claim USB device: Entity not found > 0.008856 [D1] failed to detach kernel driver from USB device: Invalid > parameter > 0.008866 [D2] failed to claim USB device: Entity not found > 0.008875 [D1] failed to detach kernel driver from USB device: Invalid > parameter > 0.008883 Can't claim USB device [2341:8036]@2/0: Invalid parameter > > root at pve2:~# upsdrvctl start > Network UPS Tools - UPS driver controller 2.8.0 > Network UPS Tools - Generic HID driver 0.47 (2.8.0) > USB communication driver (libusb 1.0) 0.43 > Can't claim USB device [2341:8036]@2/0: Invalid parameter > Driver failed to start (exit status=1) > > > Please help me or guide me where I should look further for the issue. > > -- > Best regards, > linkinpio > > > _______________________________________________ > Nut-upsuser mailing list > Nut-upsuser at alioth-lists.debian.net > https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://alioth-lists.debian.net/pipermail/nut-upsuser/attachments/20241018/51ee5618/attachment-0001.htm>
Reasonably Related Threads
- NUT 2.8.0-7 Can't claim USB device [2341:8036]@2/0: Invalid parameter using usbhid-ups
- Supporting a DIY UPS with minimal effort butmaximum gain
- What is the arduino sub-driver intended to be used for?
- Supporting a DIY UPS with minimal effort but maximum gain
- What is the arduino sub-driver intended to be used for?