Skip to content

Commit c8d8d9e

Browse files
authored
Merge a9d83f1 into b03af2d
2 parents b03af2d + a9d83f1 commit c8d8d9e

6 files changed

Lines changed: 26 additions & 13 deletions

File tree

NEWS.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ https://github.com/networkupstools/nut/milestone/9
7878
descriptors was extended to cover a newly reported case of nominal UPS
7979
power being incorrectly reported due to an unrealistically low maximum
8080
threshold, as seen with a EC850LCD device. [issue #2917, PR #2919]
81+
* Added APC BVKxxxM2 to list of devices where `lbrb_log_delay_sec=N` may be
82+
necessary to address spurious LOWBATT and REPLACEBATT events. [#2942]
83+
8184

8285
- New NUT drivers:
8386
* Introduced a `ve-direct` driver for Victron Energy UPS/solar panels

UPGRADING.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ Changes from 2.8.3 to 2.8.4
2525
---------------------------
2626

2727
- PLANNED: Keep track of any further API clean-up?
28+
- Added APC BVKxxxM2 to list of devices where `lbrb_log_delay_sec=N` may be
29+
necessary to address spurious LOWBATT and REPLACEBATT events. [issue #2942]
2830
2931
Changes from 2.8.2 to 2.8.3
3032
---------------------------

data/driver.list.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
"APC" "ups" "3" "BACK-UPS XS LCD" "USB" "usbhid-ups"
8686
"APC" "ups" "3" "Back-UPS XS 1000M (Back-UPS Pro 1000, Model BX1000M)" "USB" "usbhid-ups" # https://github.com/networkupstools/nut/issues/139
8787
"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
88+
"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
8889
"APC" "ups" "3" "SMC2200BI-BR" "USB" "usbhid-ups" # https://github.com/networkupstools/nut/issues/557
8990
"APC" "ups" "3" "Smart-UPS (USB)" "USB" "usbhid-ups"
9091
"APC" "ups" "3" "Smart-UPS 750 (SMT750I, USB)" "USB" "usbhid-ups"

docs/man/usbhid-ups.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,11 @@ Set to delay status-setting (and log messages) about device entering `LB` or
186186
`LB+RB` state.
187187
+
188188
Some APC BXnnnnMI device models or firmware versions (reportedly 2023-2024)
189-
frequently report low battery, replace battery, and all ok within a couple
190-
of seconds, sometimes but not always preceded by OL+DISCHRG (presumably
191-
calibration). This setting lets the driver ignore short-lived states and
192-
only pay attention if they persist longer than this setting (and the device
193-
power state is `OL`).
189+
or APC BVKnnnnM2 device models frequently report low battery, replace battery,
190+
and all ok within a couple of seconds, sometimes but not always preceded by
191+
OL+DISCHRG (presumably calibration). This setting lets the driver ignore short-
192+
lived states and only pay attention if they persist longer than this setting
193+
(and the device power state is `OL`).
194194

195195
*lbrb_log_delay_without_calibrating*::
196196
Set to apply `lbrb_log_delay_sec` even if device is not calibrating.

docs/nut.dict

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
personal_ws-1.1 en 3473 utf-8
1+
personal_ws-1.1 en 3475 utf-8
22
AAC
33
AAS
44
ABI
@@ -103,6 +103,8 @@ BTS
103103
BTV
104104
BUFRD
105105
BUZ
106+
BVKnnnnM
107+
BVKxxxM
106108
BXnnnnMI
107109
BYP
108110
BZ

drivers/usbhid-ups.c

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
*/
3030

3131
#define DRIVER_NAME "Generic HID driver"
32-
#define DRIVER_VERSION "0.62"
32+
#define DRIVER_VERSION "0.63"
3333

3434
#define HU_VAR_WAITBEFORERECONNECT "waitbeforereconnect"
3535

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

15271527
/* FIXME: Consider also ups.mfr.date as 2023 or newer?
15281528
* Eventually up to some year this gets fixed?
15291529
*/
1530-
if (hd->Vendor
1531-
&& productLen > 6 /* BXnnnMI at least */
1532-
&& (!strcmp(hd->Vendor, "APC") || !strcmp(hd->Vendor, "American Power Conversion"))
1533-
&& (strstr(hd->Product, " BX") || strstr(hd->Product, "BX") == hd->Product)
1534-
&& (hd->Product[productLen - 2] == 'M' && hd->Product[productLen - 1] == 'I')
1530+
if ((hd->Vendor
1531+
&& productLen > 6 /* BXnnnMI at least */
1532+
&& (!strcmp(hd->Vendor, "APC") || !strcmp(hd->Vendor, "American Power Conversion"))
1533+
&& (strstr(hd->Product, " BX") || strstr(hd->Product, "BX") == hd->Product)
1534+
&& (hd->Product[productLen - 2] == 'M' && hd->Product[productLen - 1] == 'I'))
1535+
|| (hd->Vendor
1536+
&& productLen > 7 /* BVKnnnM2 at least */
1537+
&& (!strcmp(hd->Vendor, "APC") || !strcmp(hd->Vendor, "American Power Conversion"))
1538+
&& (strstr(hd->Product, " BVK") || strstr(hd->Product, "BVK") == hd->Product)
1539+
&& (hd->Product[productLen - 2] == 'M' && hd->Product[productLen - 1] == '2'))
15351540
) {
15361541
int got_lbrb_log_delay_without_calibrating = testvar("lbrb_log_delay_without_calibrating") ? 1 : 0,
15371542
got_onlinedischarge_calibration = testvar("onlinedischarge_calibration") ? 1 : 0,

0 commit comments

Comments
 (0)