Skip to content
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

Fix: Prevent UPS Lockup on '0 HID Objects' by Reconnecting on Stale Data #2671

Merged
merged 3 commits into from
Nov 15, 2024

Conversation

michal4132
Copy link
Contributor

This PR addresses an issue where the UPS would stop responding and become "stuck" with a status of "0 HID objects" requiring a driver restart to recover.

Related to #2644

It might be worth looking more into why this happens in the first place. In my opinion, this is just a workaround for the real issue, or maybe there’s actually a firmware bug in the APC BX###M series.

@AppVeyorBot
Copy link

@masterwishx
Copy link
Contributor

This PR addresses an issue where the UPS would stop responding and become "stuck" with a status of "0 HID objects" requiring a driver restart to recover.

Related to #2644

It might be worth looking more into why this happens in the first place. In my opinion, this is just a workaround for the real issue, or maybe there’s actually a firmware bug in the APC BX###M series.

Interesting how will this fix affect also in my case issue when Connection timed out after every upsdrv_updateinfo... or after upsrw commands ?

Oct 22 15:15:38 server usbhid-ups[10527]: [D5:10527] hu_find_infoval: found on (value: 1)
Oct 22 15:15:38 server usbhid-ups[10527]: [D5:10527] send_to_all: SETINFO driver.state "quiet"
Oct 22 15:15:38 server usbhid-ups[10527]: [D6:10527] send_to_all: write 29 bytes to socket 13 succeeded (ret=29): SETINFO driver.state "quiet"
Oct 22 15:15:38 server usbhid-ups[10527]: [D5:10527] send_to_all: SETINFO driver.state "updateinfo"
Oct 22 15:15:38 server usbhid-ups[10527]: [D6:10527] send_to_all: write 34 bytes to socket 13 succeeded (ret=34): SETINFO driver.state "updateinfo"
Oct 22 15:15:38 server usbhid-ups[10527]: [D1:10527] upsdrv_updateinfo...
Oct 22 15:15:39 server usbhid-ups[10527]: [D2:10527] nut_libusb_get_interrupt: Connection timed out
Oct 22 15:15:39 server usbhid-ups[10527]: [D1:10527] Got 0 HID objects...
Oct 22 15:15:39 server usbhid-ups[10527]: [D1:10527] Quick update...
Oct 22 15:15:39 server usbhid-ups[10527]: [D4:10527] Entering libusb_get_report
Oct 22 15:15:39 server usbhid-ups[10527]: [D3:10527] Report[get]: (3 bytes) => 26 05 01
Oct 22 15:15:39 server usbhid-ups[10527]: [D5:10527] PhyMax = 0, PhyMin = 0, LogMax = 255, LogMin = 0
Oct 22 15:15:39 server usbhid-ups[10527]: [D5:10527] Unit = 00000000, UnitExp = 0
Oct 22 15:15:39 server usbhid-ups[10527]: [D5:10527] Exponent = 0
Oct 22 15:15:39 server usbhid-ups[10527]: [D2:10527] Path: UPS.BatterySystem.Charger.ChargerType, Type: Feature, ReportID: 0x26, Offset: 0, Size: 8, Value: 5
Sep 27 09:33:32 Server usbhid-ups[24218]: [D2:24218] send_to_one: sending TRACKING 2DDC5036-F665-4D29-BE4C-0374D091D263 0
Sep 27 09:33:32 Server usbhid-ups[24218]: [D5:24218] send_to_one: TRACKING 2DDC5036-F665-4D29-BE4C-0374D091D263 0
Sep 27 09:33:32 Server usbhid-ups[24218]: [D6:24218] send_to_one: write 48 bytes to socket 16 succeeded (ret=48): TRACKING 2DDC5036-F665-4D29-BE4C-0374D091D263 0
Sep 27 09:33:32 Server upsd[24710]: tracking ID: 2DDC5036-F665-4D29-BE4C-0374D091D263#011result: SUCCESS
Sep 27 09:33:33 Server usbhid-ups[24218]: [D5:24218] send_to_all: SETINFO driver.state "updateinfo"
Sep 27 09:33:33 Server usbhid-ups[24218]: [D6:24218] send_to_all: write 34 bytes to socket 16 succeeded (ret=34): SETINFO driver.state "updateinfo"
Sep 27 09:33:33 Server usbhid-ups[24218]: [D1:24218] upsdrv_updateinfo...
Sep 27 09:33:34 Server usbhid-ups[24218]: [D2:24218] nut_libusb_get_interrupt: Connection timed out
Sep 27 09:33:34 Server usbhid-ups[24218]: [D1:24218] Got 0 HID objects...
Sep 27 09:33:34 Server usbhid-ups[24218]: [D1:24218] Full update...

@desertwitch
Copy link
Contributor

maybe there’s actually a firmware bug in the APC BX###M series.

Wouldn't surprise me with the more recent problems and investigations in #2347.

@AppVeyorBot
Copy link

@jimklimov jimklimov added APC USB Connection stability issues Issues about driver<->device and/or networked connections (upsd<->upsmon...) going AWOL over time labels Nov 15, 2024
@jimklimov jimklimov added this to the 2.8.3 milestone Nov 15, 2024
@jimklimov jimklimov merged commit 0f6ae03 into networkupstools:master Nov 15, 2024
1 of 2 checks passed
jimklimov added a commit to jimklimov/nut that referenced this pull request Nov 16, 2024
…e the feature with optional `interrupt_pipe_no_events_tolerance` setting [networkupstools#2681]

Signed-off-by: Jim Klimov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APC Connection stability issues Issues about driver<->device and/or networked connections (upsd<->upsmon...) going AWOL over time USB
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants