[Apcupsd-users] Battery Status Inconsistent with Status on UPS (BGM1500B)
Brought to you by:
adk0212
|
From: Darren R. <d.a...@ry...> - 2025-11-19 17:25:19
|
System Information:
* Device: Raspberry Pi 4 Model B Rev 1.1
* OS: nixOS 25.11 ([uname -a] Linux obnoxious 6.12.34 #1-NixOS SMP Tue Jan 1 00:00:00 UTC 1980 aarch64 GNU/Linux)
* apcupsd version: 3.14.14
UPS Information:
* Model: Back-UPS Pro BGM1500B-US
* UPS running for more than a year
Issue/Debugging:
Upon installing `apcupsd` on my Raspberry Pi 4 and starting the systemd service, I was immediately presented with a "Power failure on UPS ..." message in my terminal.
```
Broadcast message from root@obnoxious (somewhere) (Wed Nov 19 15:34:58 2025):
Power failure on UPS obnoxious. Running on batteries.
```
Further investigating the issue:
```
[root@obnoxious:~]# systemctl status apcupsd.service
● apcupsd.service - APC UPS Daemon
Loaded: loaded (/etc/systemd/system/apcupsd.service; enabled; preset: ignored)
Active: active (running) since Wed 2025-11-19 15:34:50 UTC; 3s ago
Invocation: 0f860d75b83e409ab132819bdbfffac8
Docs: man:apcupsd(8)
Process: 31298 ExecStartPre=/nix/store/zy6fpvw5xaavx1d6biw2c6zscqfj6ds0-unit-script-apcupsd-pre-start/bin/>
Main PID: 31310 (apcupsd)
IP: 0B in, 0B out
IO: 16K read, 0B written
Tasks: 3 (limit: 4442)
Memory: 348K (peak: 1.6M)
CPU: 66ms
CGroup: /system.slice/apcupsd.service
└─31310 /nix/store/38hgb52gy42qp4wp5xhywi86ayylshiq-apcupsd-3.14.14/bin/apcupsd -b -f /nix/store/hmgidbidwm8l4732bmddmjsi603pcrd9-apcupsd.conf -d1
Nov 19 15:34:50 obnoxious systemd[1]: Starting APC UPS Daemon...
Nov 19 15:34:50 obnoxious systemd[1]: Started APC UPS Daemon.
Nov 19 15:34:50 obnoxious apcupsd[31310]: apcupsd 3.14.14 (31 May 2016) unknown startup succeeded
Nov 19 15:34:50 obnoxious apcupsd[31310]: NIS server startup succeeded
Nov 19 15:34:52 obnoxious apcupsd[31310]: Power failure.
Nov 19 15:34:52 obnoxious apcupsd[31310]: User logins prohibited
```
```
[root@obnoxious:~]# apcaccess
APC : 001,038,0900
DATE : 2025-11-19 15:35:01 +0000
HOSTNAME : obnoxious
VERSION : 3.14.14 (31 May 2016) unknown
UPSNAME : obnoxious
CABLE : USB Cable
DRIVER : USB UPS Driver
UPSMODE :
STARTTIME: 2025-11-19 15:34:50 +0000
SHARE :
MODEL : Back-UPS BGM1500B
STATUS : ONBATT
LINEV : 122.0 Volts
LOADPCT : 6.0 Percent
BCHARGE : 100.0 Percent
TIMELEFT : 95.0 Minutes
MBATTCHG : 50 Percent
MINTIMEL : 5 Minutes
MAXTIME : 0 Seconds
SENSE : Medium
LOTRANS : 88.0 Volts
HITRANS : 147.0 Volts
ALARMDEL : 30 Seconds
BATTV : 27.9 Volts
LASTXFER : Low line voltage
NUMXFERS : 1
XONBATT : 2025-11-19 15:34:52 +0000
TONBATT : 13 Seconds
CUMONBATT: 13 Seconds
XOFFBATT : N/A
SELFTEST : OK
STATFLAG : 0x05060010
SERIALNO : ...
BATTDATE : 1980-01-01
NOMINV : 120 Volts
NOMBATTV : 24.0 Volts
NOMPOWER : 900 Watts
FIRMWARE : 31316S12-31320S10
END APC : 2025-11-19 15:35:05 +0000
```
Comparing the output here against the status of the device itself via the LCD screen, only the "ONBATT" status from apcupsd was directly conflicting with the actual "ON LINE" status of device. "LOADPCT", "BCHARGE", and a few others matched with physical device.
I checked `man apcupsd.conf` and set the following configuration:
```
## apcupsd.conf v1.1 ##
# apcupsd complains if the first line is not like above.
UPSCABLE usb
UPSTYPE usb
NISIP 127.0.0.1
BATTERYLEVEL 50
MINUTES 5
SCRIPTDIR /nix/store/2xpxz3lpdb1ymzv4m1b1i1nnwvlr6jl5-apcupsd-scriptdir
```
I restarted apcupsd.service, but the issue persisted. So I did more research into this issue and found this similar report in 2021, but with a different model (Back-UPS CS 650):
* https://community.se.com/t5/APC-UPS-for-Home-and-Office-Forum/CS-650-Continually-says-power-failure-power-back-up/m-p/317343#M13763
This ultimately linked back to a _2007_ solution on this list which apparently resolved the issue for some people on the SE forum:
* [archive] https://web.archive.org/web/20160331041803/http://osdir.com/ml/sysutils.apcupsd.user/2007-02/msg00028.html
* https://sourceforge.net/p/apcupsd/mailman/message/12395394/
I was a bit doubtful as to whether this would solve my issue since this was actually describing a "NOBATT" issue and it was from _2007_, but figured I would at least try the debugging process listed by "Adam K." and see if I get similar results:
* https://sourceforge.net/p/apcupsd/mailman/message/12395373/
However, upon unplugging the UPS from the wall and plugging it back in ~30 seconds later, the issue with `apcupsd` is now magically resolved.
```
# before unplugging from wall
[root@obnoxious:~]# apcaccess
APC : 001,038,0901
DATE : 2025-11-19 15:51:56 +0000
HOSTNAME : obnoxious
VERSION : 3.14.14 (31 May 2016) unknown
UPSNAME : obnoxious
CABLE : USB Cable
DRIVER : USB UPS Driver
UPSMODE :
STARTTIME: 2025-11-19 15:34:50 +0000
SHARE :
MODEL : Back-UPS BGM1500B
STATUS : ONBATT
LINEV : 0.0 Volts
LOADPCT : 6.0 Percent
BCHARGE : 98.0 Percent
TIMELEFT : 93.9 Minutes
MBATTCHG : 50 Percent
MINTIMEL : 5 Minutes
MAXTIME : 0 Seconds
SENSE : Medium
LOTRANS : 88.0 Volts
HITRANS : 147.0 Volts
ALARMDEL : 30 Seconds
BATTV : 24.9 Volts
LASTXFER : Low line voltage
NUMXFERS : 1
XONBATT : 2025-11-19 15:34:52 +0000
TONBATT : 1024 Seconds
CUMONBATT: 1024 Seconds
XOFFBATT : N/A
SELFTEST : OK
STATFLAG : 0x05060010
SERIALNO : ...
BATTDATE : 1980-01-01
NOMINV : 120 Volts
NOMBATTV : 24.0 Volts
NOMPOWER : 900 Watts
FIRMWARE : 31316S12-31320S10
END APC : 2025-11-19 15:51:56 +0000
```
```
# after plugging back into wall
[root@obnoxious:~]# apcaccess
APC : 001,038,0924
DATE : 2025-11-19 15:52:08 +0000
HOSTNAME : obnoxious
VERSION : 3.14.14 (31 May 2016) unknown
UPSNAME : obnoxious
CABLE : USB Cable
DRIVER : USB UPS Driver
UPSMODE :
STARTTIME: 2025-11-19 15:34:50 +0000
SHARE :
MODEL : Back-UPS BGM1500B
STATUS : ONLINE
LINEV : 122.0 Volts
LOADPCT : 6.0 Percent
BCHARGE : 98.0 Percent
TIMELEFT : 93.6 Minutes
MBATTCHG : 50 Percent
MINTIMEL : 5 Minutes
MAXTIME : 0 Seconds
SENSE : Medium
LOTRANS : 88.0 Volts
HITRANS : 147.0 Volts
ALARMDEL : 30 Seconds
BATTV : 25.2 Volts
LASTXFER : Low line voltage
NUMXFERS : 1
XONBATT : 2025-11-19 15:34:52 +0000
TONBATT : 0 Seconds
CUMONBATT: 1036 Seconds
XOFFBATT : 2025-11-19 15:52:08 +0000
SELFTEST : OK
STATFLAG : 0x05000008
SERIALNO : ...
BATTDATE : 1980-01-01
NOMINV : 120 Volts
NOMBATTV : 24.0 Volts
NOMPOWER : 900 Watts
FIRMWARE : 31316S12-31320S10
END APC : 2025-11-19 15:52:16 +0000
```
`apcupsd` now properly detects "ONBATT" events after unplugging device:
```
[root@obnoxious:~]# apcaccess
APC : 001,038,0923
DATE : 2025-11-19 16:46:29 +0000
HOSTNAME : obnoxious
VERSION : 3.14.14 (31 May 2016) unknown
UPSNAME : obnoxious
CABLE : USB Cable
DRIVER : USB UPS Driver
UPSMODE :
STARTTIME: 2025-11-19 15:34:50 +0000
SHARE :
MODEL : Back-UPS BGM1500B
STATUS : ONBATT
LINEV : 0.0 Volts
LOADPCT : 8.0 Percent
BCHARGE : 99.0 Percent
TIMELEFT : 66.7 Minutes
MBATTCHG : 50 Percent
MINTIMEL : 5 Minutes
MAXTIME : 0 Seconds
SENSE : Medium
LOTRANS : 88.0 Volts
HITRANS : 147.0 Volts
ALARMDEL : 30 Seconds
BATTV : 26.1 Volts
LASTXFER : Low line voltage
NUMXFERS : 2
XONBATT : 2025-11-19 16:46:19 +0000
TONBATT : 14 Seconds
CUMONBATT: 1050 Seconds
XOFFBATT : 2025-11-19 15:52:08 +0000
SELFTEST : OK
STATFLAG : 0x05060010
SERIALNO : ...
BATTDATE : 1980-01-01
NOMINV : 120 Volts
NOMBATTV : 24.0 Volts
NOMPOWER : 900 Watts
FIRMWARE : 31316S12-31320S10
END APC : 2025-11-19 16:46:33 +0000
```
Not sure if it's `apcupsd`, vendor, or packing issue at this point.
Workaround:
tl;dr if you come across this issue, try unplugging and plugging UPS while `apcupsd` is running.
Darren
|