<!DOCTYPE html><html><head><title></title><style type="text/css">
p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div style="font-family:Arial;">I think I have another lead:<br></div><div style="font-family:Arial;"><br></div><div style="font-family:Arial;">For the Powervar, lsusb gives:<br></div><p class="p1"><span class="s1">Bus 003 Device 002: ID 4234:0002 AMETEK-POWERVAR Corporation UPM UPS (v01.51, Nov<span class="Apple-converted-space"> </span>3 2018)</span><br></p><div style="font-family:Arial;">When running usbhid-ups from the command line, I get:<br></div><p class="p1"><span class="s1">0.035977<span class="Apple-tab-span"> </span>[D2] - Bus: 003</span><br></p><div style="font-family:Arial;"><span class="s1">0.035989<span class="Apple-tab-span"> </span>[D2] - Device: unknown</span><br></div><div style="font-family:Arial;"><br></div><div style="font-family:Arial;">So is it passing "unknown" as the device number to libusb instead of 002?</div><div style="font-family:Arial;"><br></div><div>On Wed, Feb 7, 2024, at 3:54 PM, Jason Doolittle wrote:<br></div><blockquote type="cite" id="qt" style=""><div style="font-family:Arial;">Hello,<br></div><div style="font-family:Arial;"><br></div><div style="font-family:Arial;">Thanks for your reply.<br></div><div style="font-family:Arial;"><br></div><div style="font-family:Arial;">Both of the services you mentioned (<span class="qt-s1">nut-driver@PowervarUPS01.service and nut-driver@APCUPS01.service) </span>were running. They were spamming syslog with messages like the following:<br></div><p class="qt-p1"><span class="qt-s1">2024-02-07T14:29:27.704506-05:00 hostname nut-driver@PowervarUPS01[72162]: Network UPS Tools - Generic HID driver 0.47 (2.8.0)</span><br></p><p class="qt-p1"><span class="qt-s1">2024-02-07T14:29:27.704537-05:00 hostname nut-driver@PowervarUPS01[72162]: USB communication driver (libusb 1.0) 0.43</span><br></p><p class="qt-p1"><span class="qt-s1">2024-02-07T14:29:27.704873-05:00 hostname nut-driver@PowervarUPS01[72161]: Driver failed to start (exit status=1)</span><br></p><p class="qt-p1"><span class="qt-s1">2024-02-07T14:29:32.718262-05:00 hostname nut-driver@PowervarUPS01[72167]: Can't claim USB device [4234:0002]@1/0: Invalid parameter</span><br></p><p class="qt-p1"><span class="qt-s1">2024-02-07T14:29:32.718386-05:00 hostname nut-driver@PowervarUPS01[72167]: Network UPS Tools - Generic HID driver 0.47 (2.8.0)</span><br></p><p class="qt-p1"><span class="qt-s1">2024-02-07T14:29:32.718422-05:00 hostname nut-driver@PowervarUPS01[72167]: USB communication driver (libusb 1.0) 0.43</span><br></p><p class="qt-p1"><span class="qt-s1">2024-02-07T14:29:32.718684-05:00 hostname nut-driver@PowervarUPS01[72161]: Driver failed to start (exit status=1)</span><br></p><p class="qt-p1"><span class="qt-s1">2024-02-07T14:29:32.718829-05:00 hostname nut-driver@APCUPS01[72166]: Can't claim USB device [051d:0002]@1/0: Invalid parameter</span><br></p><div style="font-family:Arial;"><br></div><div style="font-family:Arial;">After stopping those services I ran the driver again from the CLI with the same result. That "Invalid parameter" is conspicuous. I haven't seen it in anyone else's questions or answers. The only place i've seen it in relation to this problem is in libusb1.c (on github), but not in a way that makes it obvious how to track down the cause. I suspect some sort of version or parameter mismatch somewhere in libusb, but I have no idea how to test for that.<br></div><div style="font-family:Arial;"><br></div><div style="font-family:Arial;"><br></div><div>On Wed, Feb 7, 2024, at 12:57 PM, Jim Klimov wrote:<br></div><blockquote type="cite" id="qt-qt" style=""><div dir="auto"><div>Hello and welcome!<br></div><div dir="auto"><br></div><div dir="auto"> My guess would be that a nut-driver service unit (or instances thereof since NUT v2.8.0, monolithic before) have started and captured the devices, so your attempts with another copy of the driver started from CLI fail at that. Normally drivers detect an older sibling running (by poking a PID file), but service units may forgo creation of one. (Since 2.8.1 they can also try to use driver-server protocol locally.)<br></div><div dir="auto"><br></div><div dir="auto"> Since NUT v2.8.0 there is a nut-driver-enumerator (script and service) which manages creation, deletion and reloading/restarting of unit instances based on ups.conf contents (start-up) or changes (run-time). Check if you have `nut-driver@PowervarUPS01.service` (and `...@APCUPS01`) there to fit this bill? If yes, then to experiment with CLI copies of drivers, `systemctl stop` such unit(s).<br></div><div dir="auto"><br></div><div>Hope this helps,<br></div><div dir="auto">Jim Klimov<br></div><div dir="auto"><div><br></div><div><br></div><div class="qt-qt-gmail_quote" dir="auto"><div dir="ltr" class="qt-qt-gmail_attr">On Wed, Feb 7, 2024, 14:48 Jason Doolittle <<a href="mailto:jason@flintegratedtech.com">jason@flintegratedtech.com</a>> wrote:<br></div><blockquote class="qt-qt-gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204, 204, 204);padding-left:1ex;"><div>I am working in Ubuntu Linux on a Raspberry Pi 5. Nut is unable to connect to USB UPSs.<br></div><div><br></div><div>uname -srvmpio<br></div><div>Linux 6.5.0-1009-raspi #12-Ubuntu SMP PREEMPT_DYNAMIC Wed Jan 17 11:45:08 UTC 2024 aarch64 aarch64 aarch64 GNU/Linux<br></div><div><br></div><div>Current Installed version of nut is 2.8.0-7 installed with apt<br></div><div><br></div><div>apt-cache policy nut<br></div><div>nut:<br></div><div> Installed: 2.8.0-7<br></div><div> Candidate: 2.8.0-7<br></div><div> Version table:<br></div><div>*** 2.8.0-7 500<br></div><div> 500 <a href="http://ports.ubuntu.com/ubuntu-ports" rel="noreferrer noreferrer" target="_blank">http://ports.ubuntu.com/ubuntu-ports</a> mantic/main arm64 Packages<br></div><div> 100 /var/lib/dpkg/status<br></div><div><br></div><div>I currently have 2 UPSs connected to the system<br></div><div>A Powervar UPM UPS<br></div><div>Bus 003 Device 002: ID 4234:0002 AMETEK-POWERVAR Corporation UPM UPS (v01.51, Nov 3 2018)<br></div><div><br></div><div>An APC Back-UPS Pro 1500<br></div><div>Bus 001 Device 002: ID 051d:0002 American Power Conversion Uninterruptible Power Supply<br></div><div><br></div><div>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<br></div><div><br></div><div>For the Powervar:<br></div><div>crw-rw-r-- 1 root nut 189, 257 Feb 7 06:42 /dev/bus/usb/003/002<br></div><div><br></div><div>For the APC:<br></div><div>crw-rw-r-- 1 root nut 189, 1 Feb 7 06:42 /dev/bus/usb/001/002<br></div><div><br></div><div>In ups.conf, I have this:<br></div><div><br></div><div>[PowervarUPS01]<br></div><div>driver = "usbhid-ups"<br></div><div>port = "auto"<br></div><div>vendorid = "4234"<br></div><div>productid = "0002"<br></div><div><br></div><div>[APCUPS01]<br></div><div>driver = "usbhid-ups"<br></div><div>port = "auto"<br></div><div>vendorid = "051D"<br></div><div>productid = "0002"<br></div><div><br></div><div>The UPSs are matched, but drivers continuously fail to start. Here is the output from running the usbhid-ups driver manually for the Powervar:<br></div><div><br></div><div>sudo /usr/lib/nut/usbhid-ups -u root -a PowervarUPS01 -DD<br></div><div><br></div><div>Network UPS Tools - Generic HID driver 0.47 (2.8.0)<br></div><div>USB communication driver (libusb 1.0) 0.43<br></div><div> 0.000000 [D1] debug level is '2'<br></div><div> 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')<br></div><div> 0.001209 [D1] upsdrv_initups (non-SHUT)...<br></div><div> 0.006358 [D2] Checking device 1 of 6 (1D6B/0003)<br></div><div> 0.006385 [D1] Failed to open device (1D6B/0003), skipping: Access denied (insufficient permissions)<br></div><div> 0.006393 [D2] Checking device 2 of 6 (4234/0002)<br></div><div> 0.007354 [D2] - VendorID: 4234<br></div><div> 0.007364 [D2] - ProductID: 0002<br></div><div> 0.007371 [D2] - Manufacturer: AMETEK-POWERVAR Corporation<br></div><div> 0.007378 [D2] - Product: UPM UPS (v01.51, Nov 3 2018)<br></div><div> 0.007385 [D2] - Serial Number: 5008094R-1940438<br></div><div> 0.007395 [D2] - Bus: 003<br></div><div> 0.007402 [D2] - Device: unknown<br></div><div> 0.007409 [D2] - Device release number: 0002<br></div><div> 0.007418 [D2] Trying to match device<br></div><div> 0.007425 [D2] match_function_subdriver (non-SHUT mode): matching a device...<br></div><div> 0.007485 [D2] Device matches<br></div><div> 0.007497 [D2] Reading first configuration descriptor<br></div><div> 0.007505 [D2] result: -5 (Entity not found)<br></div><div> 0.007517 [D2] failed to claim USB device: Entity not found<br></div><div> 0.007529 [D1] failed to detach kernel driver from USB device: Invalid parameter<br></div><div> 0.007539 [D2] failed to claim USB device: Entity not found<br></div><div> 0.007549 [D1] failed to detach kernel driver from USB device: Invalid parameter<br></div><div> 0.007560 [D2] failed to claim USB device: Entity not found<br></div><div> 0.007574 [D1] failed to detach kernel driver from USB device: Invalid parameter<br></div><div> 0.007582 [D2] failed to claim USB device: Entity not found<br></div><div> 0.007594 [D1] failed to detach kernel driver from USB device: Invalid parameter<br></div><div> 0.007604 Can't claim USB device [4234:0002]@1/0: Invalid parameter<br></div><div><br></div><div>I get basically the same from the APC.<br></div><div><br></div><div>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.<br></div><div><br></div><div>I would be eternally grateful if someone could point me in the right direction.<br></div><div><br></div><div>_______________________________________________<br></div><div>Nut-upsuser mailing list<br></div><div><a href="mailto:Nut-upsuser@alioth-lists.debian.net" target="_blank" rel="noreferrer">Nut-upsuser@alioth-lists.debian.net</a><br></div><div><a href="https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser" rel="noreferrer noreferrer" target="_blank">https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser<br></a></div></blockquote></div></div></div></blockquote><div style="font-family:Arial;"><br></div><div>_______________________________________________<br></div><div>Nut-upsuser mailing list<br></div><div><a href="mailto:Nut-upsuser@alioth-lists.debian.net">Nut-upsuser@alioth-lists.debian.net</a><br></div><div><a href="https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser">https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser</a><br></div><div><br></div></blockquote><div style="font-family:Arial;"><br></div><div id="sig19253525"><div class="signature">-- <br></div><div class="signature">Jason Doolittle<br></div><div class="signature">Facility Engineer<br></div><div class="signature"><a href="mailto:jason@flintegratedtech.com">jason@flintegratedtech.com</a> | 813 918-6157<br></div></div><div style="font-family:Arial;"><br></div></body></html>