Skip to content
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
2 changes: 2 additions & 0 deletions NEWS.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ https://github.com/networkupstools/nut/milestone/9
descriptors was extended to cover a newly reported case of nominal UPS
power being incorrectly reported due to an unrealistically low maximum
threshold, as seen with a EC850LCD device. [issue #2917, PR #2919]
* Added APC BVKxxxM2 to list of devices where `lbrb_log_delay_sec=N` may be
necessary to address spurious LOWBATT and REPLACEBATT events. [#2942]

- New NUT drivers:
* Introduced a `ve-direct` driver for Victron Energy UPS/solar panels
Expand Down
3 changes: 3 additions & 0 deletions UPGRADING.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ Changes from 2.8.3 to 2.8.4

- PLANNED: Keep track of any further API clean-up?

- Added APC BVKxxxM2 to list of devices where `lbrb_log_delay_sec=N` may be
necessary to address spurious LOWBATT and REPLACEBATT events. [issue #2942]

Changes from 2.8.2 to 2.8.3
---------------------------

Expand Down
1 change: 1 addition & 0 deletions data/driver.list.in
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
"APC" "ups" "3" "BACK-UPS XS LCD" "USB" "usbhid-ups"
"APC" "ups" "3" "Back-UPS XS 1000M (Back-UPS Pro 1000, Model BX1000M)" "USB" "usbhid-ups" # https://github.com/networkupstools/nut/issues/139
"APC" "ups" "3" "Back-UPS BX****MI Series (may need tweaks since 2023)" "USB" "usbhid-ups lbrb_log_delay_sec=N lbrb_log_delay_without_calibrating onlinedischarge_calibration" # https://github.com/networkupstools/nut/issues/2347
"APC" "ups" "3" "Back-UPS BVK****M2 Series (may need tweaks)" "USB" "usbhid-ups lbrb_log_delay_sec=N lbrb_log_delay_without_calibrating onlinedischarge_calibration" # https://github.com/networkupstools/nut/issues/2942
"APC" "ups" "3" "SMC2200BI-BR" "USB" "usbhid-ups" # https://github.com/networkupstools/nut/issues/557
"APC" "ups" "3" "Smart-UPS (USB)" "USB" "usbhid-ups"
"APC" "ups" "3" "Smart-UPS 750 (SMT750I, USB)" "USB" "usbhid-ups"
Expand Down
12 changes: 6 additions & 6 deletions docs/man/usbhid-ups.txt
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,12 @@ the `OL+DISCHRG` message logging is not triggered by variations of the charge.
Set to delay status-setting (and log messages) about device entering `LB` or
`LB+RB` state.
+
Some APC BXnnnnMI device models or firmware versions (reportedly 2023-2024)
frequently report low battery, replace battery, and all ok within a couple
of seconds, sometimes but not always preceded by OL+DISCHRG (presumably
calibration). This setting lets the driver ignore short-lived states and
only pay attention if they persist longer than this setting (and the device
power state is `OL`).
Some APC BXnnnnMI device models or firmware versions (reportedly 2023-2024),
or APC BVKnnnnM2 device models, frequently report "low battery", "replace
battery", and "all ok" states changing rapidly within a couple of seconds,
sometimes (but not always) preceded by `OL+DISCHRG` (presumably calibration).
This setting lets the driver ignore short-lived states and only pay attention
if they persist longer than this setting (and the device power state is `OL`).

*lbrb_log_delay_without_calibrating*::
Set to apply `lbrb_log_delay_sec` even if device is not calibrating.
Expand Down
4 changes: 3 additions & 1 deletion docs/nut.dict
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
personal_ws-1.1 en 3473 utf-8
personal_ws-1.1 en 3475 utf-8
AAC
AAS
ABI
Expand Down Expand Up @@ -103,6 +103,8 @@ BTS
BTV
BUFRD
BUZ
BVKnnnnM
BVKxxxM
BXnnnnMI
BYP
BZ
Expand Down
19 changes: 12 additions & 7 deletions drivers/usbhid-ups.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
*/

#define DRIVER_NAME "Generic HID driver"
#define DRIVER_VERSION "0.62"
#define DRIVER_VERSION "0.63"

#define HU_VAR_WAITBEFORERECONNECT "waitbeforereconnect"

Expand Down Expand Up @@ -1519,19 +1519,24 @@ void upsdrv_initups(void)
lbrb_log_delay_sec = ipv;
}
} else {
/* Activate APC BXnnnMI/BXnnnnMI tweaks, for details see
/* Activate APC BXnnnMI/BXnnnnMI/BVKnnnM2/BVKnnnnM2 tweaks, for details see
* https://github.com/networkupstools/nut/issues/2347
*/
size_t productLen = hd->Product ? strlen(hd->Product) : 0;

/* FIXME: Consider also ups.mfr.date as 2023 or newer?
* Eventually up to some year this gets fixed?
*/
if (hd->Vendor
&& productLen > 6 /* BXnnnMI at least */
&& (!strcmp(hd->Vendor, "APC") || !strcmp(hd->Vendor, "American Power Conversion"))
&& (strstr(hd->Product, " BX") || strstr(hd->Product, "BX") == hd->Product)
&& (hd->Product[productLen - 2] == 'M' && hd->Product[productLen - 1] == 'I')
if ((hd->Vendor
&& productLen > 6 /* BXnnnMI at least */
&& (!strcmp(hd->Vendor, "APC") || !strcmp(hd->Vendor, "American Power Conversion"))
&& (strstr(hd->Product, " BX") || strstr(hd->Product, "BX") == hd->Product)
&& (hd->Product[productLen - 2] == 'M' && hd->Product[productLen - 1] == 'I'))
|| (hd->Vendor
&& productLen > 7 /* BVKnnnM2 at least */
&& (!strcmp(hd->Vendor, "APC") || !strcmp(hd->Vendor, "American Power Conversion"))
&& (strstr(hd->Product, " BVK") || strstr(hd->Product, "BVK") == hd->Product)
&& (hd->Product[productLen - 2] == 'M' && hd->Product[productLen - 1] == '2'))
) {
int got_lbrb_log_delay_without_calibrating = testvar("lbrb_log_delay_without_calibrating") ? 1 : 0,
got_onlinedischarge_calibration = testvar("onlinedischarge_calibration") ? 1 : 0,
Expand Down