How to refresh the battery fuel meter?

Same thing - the calibration gets reset, so the gauge uses voltage to approximate the capacity. Then it starts to count the current going from/to the battery and with time starts to take the coulomb counter estimation more into account than voltage for more accurate readings.

Since upowerd isn’t very eager in updating its charge_full reading when it changes, you may want to run sudo systemctl restart upower after changing the battery at the moment so the percentage in UI stays sensible. cat /sys/class/power_supply/max170xx_battery/capacity will always give you the reading straight from the gauge.

[edit] Ah, it just came into my mind that I’m not entirely sure whether the gauge will get correctly reconfigured by the kernel after a battery hot-swap (you may need to reload the kernel module for it to happen). I’ll have to try it myself and see what happens :smiley:

4 Likes