-
-
Notifications
You must be signed in to change notification settings - Fork 366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NUT Windows v2.8.0 with LibUSB Eaton device descriptor matching errors #1690
Comments
Well, blindly selecting an invalid value does not seem right. Probably makes sense to make a check similar to line 512 but preferring Other than that, keep in mind that the Windows builds revival did not yet deal with installer, and in particular that of some low-level component of libusb driver that may exclusively grab the device. Would love to see that bit solved. CC @aquette for possibly more insights |
Thanks for your feedback and time - I think so aswell. Its a bit weird that the correct device is identified
Device Vendor and Product ID has been successfully identified.
I think the follow up errors which are pointing to some permission errors are probably misleading. Maybe this is some other hardware HID device in the system (mouse, keyboard HID) and not related to the UPS. I'm currently investigating on the low level exclusive usage of the device. We've already tried to uninstall all other UPS related applications on the host system (Eaton Management Tools and drivers, Windows HID UPS driver). We also tried with different versions of the libusb - as a next step, I will try to compile as 32Bit and check whether this brings any change. |
And just wanted to stress: the culprit may be an incomplete installation into the OS (some Windows driver and reboot?) of whatever libusb needs to get those HID report descriptors from that device and pass to a NUT driver program. It is likely not a fault of the NUT driver (might still be), but of that libusb installation puzzle part that is not solved/modernized yet. |
Ok, I keep on digging. We have already tested this on a second host - but unfortunately with the same result. For reference: #1646 is pointing at the same spot. |
Unfortunately I can't say more at the moment - did not test with a Windows machine where I could arbitrarily change the low-level drivers etc. At some point I wanted to try with a snapshotable Windows VM with USB pass-through (hoping the host OS would truly and exclusively dedicate the USB HID device to the guest) in order to try different approaches, but did not have time to pursue that. From what I gathered so far, back when NUT for Windows was made (with 2.6.5 and earlier baselines), Maybe we just need to set (and test) the option for "backend" (there are several, maybe chosen at runtime... defaulted, guessed, specified via NUT config files?) in case (ifdef) of Windows and libusb-1.0 builds, like this example from their wiki:
|
Thanks for your great support - fortunately I think we found the issue. Sometimes you should just follow the instructions exactely, and step by step: https://github.com/libusb/libusb/wiki/Windows#how-to-use-libusb-on-windows By manually deinstalling the Windows HID USB Battery driver and LibUSB, and installing the WinUSB driver via the ZADIG tool, I was finally able to get the NUT Server running for a moment. We are currently investigation who to prevent windows to replace WinUSB with other drivers. |
Sounds great, thanks! |
Ok, so finally we have everything up and running. A key tool to get a clean overview over the currently installed and used drivers was: Driver Store Explorer (https://github.com/lostindark/DriverStoreExplorer) With this tool, we could see that several drivers were still present on our test system. We first removed all Eaton tools, then all LibUSB drivers via the Windows 10 Programs and Apps. Then we manually removed, and forcibly removed all other versions of lisbusb, lisbusk, libwdi, eaton, etn_libusb,... in the Driver Store Explorer. After system reboot windows was by default using the HidUSB (v10) which we could see via the Zadig tool. From now on, windows didn't change the drivers automatically - maybe this strange previous behaviour was related to the presence of the other driver instances. But somehow, the NUT Server still didn't come up - meanwhile the The solution to this was found in the windows eventlog: Additionally we needed to configure the NUT windows service startup behaviour to "Autostart (delayed)" because of our Network interface was coming up too late. After this, and a final reboot it now seems to run perfectly: Thanks and regards! |
Sounds great and encouraging, thanks! Now, if only someone were to automate these bits of logic and knowledge with the WiX installer and tools from mingw, to produce MSI snapshots right from CI... |
Can confirm that Zadig helped with a freshly installed test VM with Windows 10 (added just MSYS2 and IDEs to build and troubleshoot NUT in-vivo), with USB passed-through from a Proxmox host. Originally it did hook up the UPS with a built-in driver, saw the charging/onbatt states and the charge percentage when I pulled the plug. And apparently grabbed the device so low-level that libusb could not fully kidnap it (returned Finally with Zadig replacing the driver to WinUSB (per screenshot), even before a VM reboot, the expected lots of data was finally seen from Wondering now if it (or rather https://github.com/pbatard/libwdi project shoehorned into a CLI tool) could prepare a single big INF file that would link (Microsoft's own?) WinUSB to the numerous VID:PID pairs we have ways to extract for |
@joachim-heck Hi, do you still have Eaton 9sx? |
I'm using an EATON UPS in combination with the LibUSB 1.2.6.0 and the newest build of the Windows NUT Server v2.8.0 which is working like charm on my linux machine, but doesn't want to connect on the windows build. The old NUT server version 2.6.5 was working on windows but the returned values where partially incorrect and fewer values where collected and returned. The EATON is connected correctly and detected - also accessible with the eaton tools.
Somehow this is also related to the LibUSB discussion in your mentioned #5 issue.
Console-Output:
.\usbhid-ups.exe -DD -a eaton
From my point of view this is somehow related to this part in the codebase of libusb1:
https://github.com/networkupstools/nut/blob/035ae79dc28a04c443f110bd7046aab3c504319b/drivers/libusb1.c
row 449
fails and returns -1row 507
sets rdlen = rdlen1 which is still -1 at this pointrow 515
checks whether rdlen is < 0 which to debug output a continue to next deviceIs this behaviour intentended?
The text was updated successfully, but these errors were encountered: