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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions NEWS.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ https://github.com/networkupstools/nut/milestone/11
- usbhid-ups updates:
* Support of the `onlinedischarge_log_throttle_hovercharge` in the NUT
v2.8.2 release was found to be incomplete. [#2423, follow-up to #2215]
* Prevent UPS Lockup on "0 HID Objects" by reconnecting on stale data.
Note that while some devices just report information upon subsequent
poll, others (APC BXnnnnMI) were seen to lock up until full connection
restart. [#2671]
* Added support for `lbrb_log_delay_sec=N` setting to delay propagation of
`LB` or `LB+RB` state (buggy with APC BXnnnnMI devices circa 2023-2024).
This may work better with flags like `onlinedischarge_calibration` and
Expand Down
2 changes: 2 additions & 0 deletions drivers/usbhid-ups.c
Original file line number Diff line number Diff line change
Expand Up @@ -1088,6 +1088,7 @@ void upsdrv_makevartable(void)
}

#define MAX_EVENT_NUM 32
#define NO_EVENTS 0

void upsdrv_updateinfo(void)
{
Expand Down Expand Up @@ -1144,6 +1145,7 @@ void upsdrv_updateinfo(void)
#if WITH_LIBUSB_0_1 /* limit to libusb 0.1 implementation */
case -EPERM: /* Operation not permitted */
#endif
case NO_EVENTS: /* No HID Events */
case LIBUSB_ERROR_NO_DEVICE: /* No such device */
case LIBUSB_ERROR_ACCESS: /* Permission denied */
#if WITH_LIBUSB_0_1 /* limit to libusb 0.1 implementation */
Expand Down