I have a UPS (Back-UPS ES 850M2) connected via USB to my desktop PC (Ubuntu 19.10). When I disconnect the power cord, the battery in the top bar does not change, take between 2 and 5 minutes to change and display the battery status and percent and then show a notification "Running on batteries..." after plug the power cord again, the same situation, does not change instantly...the battery still displaying the percentage and show "discharging..." during some minutes..
Even, the battery always display "Estimating..." in the menu although the correct % is displayed in the settings:
Menu:
Settings:
I check the status of the ups using apcaccess
and tail /var/log/apcupsd.events
, when I disconnect the power cord the logs display instantly
Power failure.
Running on UPS batteries.
And after connect again display instantly:
Mains returned. No longer on UPS batteries.
Power is back. UPS running on mains.
apcaccess
display the time and status correctly, my question is why the desktop does not change the battery status instantly?. I'ts a bit annoying because it takes too long to update the real battery status and the computer has even turned off, because I thinking that I have more time left. Any suggestions?, any help is appreciated in advance!
Finally I found a solution, thanks to @WinEunuuchs2Unix for the suggestions
Like described here:
Get battery status to update more often or on AC power/wake.
All the problem is with upower, the UPower service does calls for updating/refreshing battery information.
Then you need force a refresh, firstly get your device name:
create a batch:
keep-battery-updated.sh
and add it as a startup script.