-
-
Notifications
You must be signed in to change notification settings - Fork 353
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_libusb_get_interrupt: Connection timed out on debug #2644
Comments
@tormodvolden @jimklimov do you think it's related to how nut proccess libusb or I can test it with xusb if it related to libusb itself? I have also nut client on windows that read values from nut, also telegraf that read values and write to influxdbv2 for grafana dashboard. |
Is this causing a problem or is it just that you see the debug message in the log? You'll have to find out what the nut code tries to do, then what to expect from the device and libusb calls. If you have suspicions about a libusb issue, you must provide LIBUSB_DEBUG=4 logs to start. xusb can do some HID interrupt transfers, but I don't know if it fits with your device. |
Yes the problem upsrw commands not working for me , hovewer it write OK or Success #2643 |
|
Personally I am allergic to text being pasted as images :) There are so many great tools to efficiently search and process textual information. |
Sorry, got it, will post the log here.. |
|
Also tryed to add |
Please see #2616. |
Maybe bring that up in #2616, if you can't figure out how to enable this, the documentation is definitely not good enough. |
Did you already read docs/man/nut.conf.txt ? |
No just was reading #2616 |
seems |
The LIBUSB_DEBUG variable is mentioned in docs/man/nut_usb_addvars.txt but docs/man/nut.conf.txt explains more in general how to set variables correctly. |
So i added nut/docs/man/nut_usb_addvars.txt Line 136 in 1560afe
my bad was i added to and nut started OK, if wrong variable was set in ups.conf NUT will not start . and from both logs , no info about libusb debug :
|
What does docs/man/nut.conf.txt say about spaces? :) |
Hi, I'm experiencing similar issue: after a certain period, the UPS (APC Back-UPS BX750MI) stops responding without any indication of stale data.
Under normal operation, the HIDGetEvents function returns a positive non-zero value (e.g., 1). However, when the data appears stale, HIDGetEvents returns 0.
The documentation specifies that, on success, the return value should be greater than 0. Perhaps we should interpret a return value of 0 as an error and attempt to reconnect in that case? I've tested this approach with the attached patch, and it has worked without any data staleness for over two days. |
Looks reasonable; would you care to make it a pull request in your name? Also, with an APC BX###MI device, #2565 and related issues and PRs may be relevant. In your case, before the fix, did it begin reporting "0 HID objects" and then continued to do so indefinitely, or recovered after some time (~10-30 sec)? |
Sure, I'll create a PR later. I’ve looked through other issues, including #2565, and can confirm that the LB+RB bug is still present even with this fix. Before applying the patch, the UPS would remain stuck at "0 HID objects" indefinitely (at least for several hours) and wouldn’t recover without a driver restart. |
In my case ups not stop responding but seems some upsrw commands have no effect, also seems I'm not mentioned that I have ups Eaton 9E2000i model. |
…ome devices [networkupstools#2671] * Grew from https://github.com/user-attachments/files/17646606/0001-apc-fix.patch.txt proposed at networkupstools#2644 (comment) Signed-off-by: Jim Klimov <[email protected]>
with LIBUSB_DEBUG = 4 i can see next on timeouts @tormodvolden
|
I see a bulk transfer that times out, with the timeout set to 750ms. Have you tried a longer timeout? |
Note that this is bulk transfer. Is it a bulk endpoint? I was confused by the talk about "interrupt transfers" in the other ticket. What is nut_libusb_get_interrupt() supposed to do? |
It's for Eaton 9E 2000i ups that you fixed buggy firmware with wrong language ID. #2604 |
|
found only : @jimklimov can it be related to |
Not really sure, it was before my time and USB code is still not something I am able to navigate well. But just tracing the method/variable names gets us quite far along:
|
Thanks for hint , take me some time to get on the code :(
Maybe you can help here also to questions from @tormodvolden above ? |
Can't really elaborate on that authoritatively, but my understanding is that we can get device data from regular polling, which is probably "expensive" (walking all data points known to be served by the device, more so for a "Full update"), so done infrequently ( So where interrupts are a possibility (and do not freeze the controller firmware, hence the toggles) they allow us to see individual events more frequently as they happen. But that's "handwavium" - I can only hope the inherited code actually does that :) |
Thanks for explaining, just wanted to mention again that I dont have a big problem with these |
About my question, I was doubly confused. Internally, libusb wraps interrupt transfers in the bulk transfer code path, so it is perfectly normal to see "bulk transfer" in the log for interrupt transfers. A question is how often does the device "post" a new value on its interrupt endpoint? The polling interval is defined by the device, in its descriptors. If you are polling faster than that, I can imagine it is normal to have some timeouts, but I am not sure what exactly you will see. Please see https://libusb.sourceforge.io/api-1.0/group__libusb__syncio.html#ga0f171a72904a552fc43e6e6564d108a3 about the |
Thanks i will check, I can see in debug log after upsdrv updateinfo and nut_libusb_get_interrupt: connection timed out, Got 0 HID object Also when send by r/w value or command I got OK or Success but need to check again if it really worked and how we got OK/success in this case. |
Using NUT plugin for Unraid
When debug is on have many interrupt transfers :
have a lot of
nut_libusb_get_interrupt: Connection timed out
in debug log andmaybe also affect on #2643
or its just closing connection every time for cycle of reading data?
From libusb/libusb#1548 (comment) by @tormodvolden (have issues with interrupt transfers )
Mostly looks like this :
The text was updated successfully, but these errors were encountered: