<div dir="ltr">I guess I should also say, I'm the one that did the PRs to get this working and in the process got pretty familiar with interfacing HIDPowerDevice to NUT so if you have questions after moving to NUT 2.8.2, please ask! </div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 18, 2024 at 6:34 AM Kelly Byrd <<a href="mailto:kbyrd@memcpy.com">kbyrd@memcpy.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">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.<div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 18, 2024 at 4:58 AM linkinpiocz via Nut-upsuser <<a href="mailto:nut-upsuser@alioth-lists.debian.net" target="_blank">nut-upsuser@alioth-lists.debian.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello All,<br>
<br>
I have been trying to get NUT package working on proxmox host with <br>
Arduino HIDPowerDevice (<a href="https://github.com/abratchik/HIDPowerDevice" rel="noreferrer" target="_blank">https://github.com/abratchik/HIDPowerDevice</a>)<br>
And I have been banding my head against the wall and looking through the <br>
internet why I am getting "Can't claim USB device [2341:8036]@2/0: <br>
Invalid parameter" error, but could not find anything relevant.<br>
<br>
The information :<br>
<br>
- OS name and version,<br>
root@pve2:~# cat /etc/os-release<br>
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"<br>
NAME="Debian GNU/Linux"<br>
VERSION_ID="12"<br>
VERSION="12 (bookworm)"<br>
VERSION_CODENAME=bookworm<br>
ID=debian<br>
HOME_URL="<a href="https://www.debian.org/" rel="noreferrer" target="_blank">https://www.debian.org/</a>"<br>
SUPPORT_URL="<a href="https://www.debian.org/support" rel="noreferrer" target="_blank">https://www.debian.org/support</a>"<br>
BUG_REPORT_URL="<a href="https://bugs.debian.org/" rel="noreferrer" target="_blank">https://bugs.debian.org/</a>"<br>
<br>
root@pve2:~# pveversion<br>
pve-manager/8.2.7/3e0176e6bb2ade3b (running kernel: 6.8.12-2-pve)<br>
root@pve2:~#<br>
<br>
<br>
- exact NUT version,<br>
root@pve2:~# apt list nut*<br>
Listing... Done<br>
nut-cgi/stable 2.8.0-7 amd64<br>
nut-client/stable,now 2.8.0-7 amd64 [installed]<br>
nut-doc/stable 2.8.0-7 all<br>
nut-i2c/stable 2.8.0-7 amd64<br>
nut-ipmi/stable 2.8.0-7 amd64<br>
nut-modbus/stable 2.8.0-7 amd64<br>
nut-monitor/stable 2.8.0-7 all<br>
nut-powerman-pdu/stable 2.8.0-7 amd64<br>
nut-server/stable,now 2.8.0-7 amd64 [installed]<br>
nut-snmp/stable 2.8.0-7 amd64<br>
nut-xml/stable 2.8.0-7 amd64<br>
nut/stable,now 2.8.0-7 all [installed]<br>
nutcracker/stable 0.5.0+dfsg-2 amd64<br>
nutsqlite/stable 2.0.6-3 all<br>
nuttcp/stable 6.1.2-4+b1 amd64<br>
root@pve2:~#<br>
<br>
- NUT installation method: package, or a custom build from source <br>
tarball or GitHub (which fork, branch, PR),<br>
package using official Debian repository<br>
<br>
- exact device name and related information (manufacturing date, web <br>
pointers, …),<br>
this is Arduino ProMicro ATmega32u4 using Arduino Leonardo library and <br>
HIDPowerDevice sketch from (<a href="https://github.com/abratchik/HIDPowerDevice" rel="noreferrer" target="_blank">https://github.com/abratchik/HIDPowerDevice</a>) <br>
library<br>
<br>
- complete problem description, with any relevant traces, like system <br>
log excerpts, and driver debug output. You can obtain the latter using <br>
the following command, running as root and after having stopped NUT:<br>
/path/to/driver -DD -a <upsname><br>
<br>
Problem is that system reports invalid parameter and can't claim USB <br>
device after it has detected it successfully:<br>
<br>
root@pve2:~# lsusb | grep -i arduino<br>
Bus 002 Device 009: ID 2341:8036 Arduino SA Leonardo (CDC ACM, HID)<br>
<br>
root@pve2:~# nut-scanner -U<br>
Scanning USB bus.<br>
[nutdev1]<br>
driver = "usbhid-ups"<br>
port = "auto"<br>
vendorid = "2341"<br>
productid = "8036"<br>
product = "Arduino Leonardo No CDC"<br>
serial = "HIDAJ"<br>
vendor = "Arduino LLC"<br>
bus = "002"<br>
<br>
root@pve2:~# grep "^[^#]" /etc/nut/ups.conf<br>
maxretry = 3<br>
user = root<br>
[ups1]<br>
driver = usbhid-ups<br>
port = auto<br>
vendorid = 2341<br>
productid = 8036<br>
<br>
root@pve2:~# /usr/lib/nut/usbhid-ups -a ups1 -DDD -d1<br>
Network UPS Tools - Generic HID driver 0.47 (2.8.0)<br>
USB communication driver (libusb 1.0) 0.43<br>
0.000000 [D1] debug level is '3'<br>
0.000578 [D2] Initializing an USB-connected UPS with library <br>
libusb-1.0.26 (API: 0x1000109) (NUT subdriver name='USB communication <br>
driver (libusb 1.0)' ver='0.43')<br>
0.000590 [D1] upsdrv_initups (non-SHUT)...<br>
0.006011 [D2] Checking device 1 of 7 (2341/8036)<br>
0.008619 [D2] - VendorID: 2341<br>
0.008635 [D2] - ProductID: 8036<br>
0.008641 [D2] - Manufacturer: Arduino LLC<br>
0.008647 [D2] - Product: Arduino Leonardo No CDC<br>
0.008652 [D2] - Serial Number: HIDAJ<br>
0.008657 [D2] - Bus: 002<br>
0.008666 [D2] - Device: unknown<br>
0.008678 [D2] - Device release number: 0100<br>
0.008683 [D2] Trying to match device<br>
0.008689 [D2] match_function_subdriver (non-SHUT mode): matching a device...<br>
0.008697 [D3] match_function_regex: matching a device...<br>
0.008764 [D2] Device matches<br>
0.008774 [D2] Reading first configuration descriptor<br>
0.008783 [D2] result: -5 (Entity not found)<br>
0.008794 [D3] libusb_kernel_driver_active() returned 0<br>
0.008803 [D2] failed to claim USB device: Entity not found<br>
0.008813 [D1] failed to detach kernel driver from USB device: Invalid <br>
parameter<br>
0.008824 [D2] failed to claim USB device: Entity not found<br>
0.008835 [D1] failed to detach kernel driver from USB device: Invalid <br>
parameter<br>
0.008845 [D2] failed to claim USB device: Entity not found<br>
0.008856 [D1] failed to detach kernel driver from USB device: Invalid <br>
parameter<br>
0.008866 [D2] failed to claim USB device: Entity not found<br>
0.008875 [D1] failed to detach kernel driver from USB device: Invalid <br>
parameter<br>
0.008883 Can't claim USB device [2341:8036]@2/0: Invalid parameter<br>
<br>
root@pve2:~# upsdrvctl start<br>
Network UPS Tools - UPS driver controller 2.8.0<br>
Network UPS Tools - Generic HID driver 0.47 (2.8.0)<br>
USB communication driver (libusb 1.0) 0.43<br>
Can't claim USB device [2341:8036]@2/0: Invalid parameter<br>
Driver failed to start (exit status=1)<br>
<br>
<br>
Please help me or guide me where I should look further for the issue.<br>
<br>
-- <br>
Best regards,<br>
linkinpio<br>
<br>
<br>
_______________________________________________<br>
Nut-upsuser mailing list<br>
<a href="mailto:Nut-upsuser@alioth-lists.debian.net" target="_blank">Nut-upsuser@alioth-lists.debian.net</a><br>
<a href="https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser" rel="noreferrer" target="_blank">https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser</a><br>
</blockquote></div>
</blockquote></div>