You are not logged in.

#1 2020-05-31 19:28:20

Xwang
Member
Registered: 2012-05-14
Posts: 353

New battery: how to save the battery charge level to a log file?

Hi to all,
I've just changed the battery in my laptop.
The manufacturer says that 3 cycle of complete charge and discharge must be done before starting using it normally.
Since I've had some other faulty batteries which reported the charge wrongly during charge and discharge, I would like to save the battery charge level to a log file (better if a csv one) so that to be able to create graphs of battery charge level versus time and to verify that the battery behaves correctly.
Is there anything that does something similar?


I'm still learning English so please excuse me if my English is not good enough and feel free to correct me via PM if you want.

Offline

#2 2020-05-31 19:39:30

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,394

Re: New battery: how to save the battery charge level to a log file?

http://ibam.sourceforge.net/
https://aur.archlinux.org/packages/ibam/

Last edited by kokoko3k (2020-05-31 19:40:14)


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#3 2020-06-02 17:20:45

Xwang
Member
Registered: 2012-05-14
Posts: 353

Re: New battery: how to save the battery charge level to a log file?

Hi to all.
I've managed to have a log of the battery using this AUR package:

https://aur.archlinux.org/packages/battery-stats-git

Moreover in order to have a more frequently updated data I've created a script in order to refresh and save the battery data every 15 seconds.

The script is the following:

/usr/local/bin/updateBatteryData.sh

#!/bin/sh

dbus-send --print-reply --system --dest=org.freedesktop.UPower /org/freedesktop/UPower/devices/battery_BAT0 org.freedesktop.UPower.Device.Refresh 

/usr/bin/battery-stats-collector -1

and it is called every 15 seconds using a systemd service and timer.

Using the battery-graph application I've got this graph of the battery charge level in the last day:

battery-Charge-Level.png

As you can see the behaviour of the new battery is pretty good, but there have been two strange values  (the blue vertical lines) where the charge level dropped to 20.92% and 21.22% from the 100% even if the pc was plugged (that app draws red line when the pc is not plugged and blue otherwise).

After that I've taken the saved data and I've imported them in Calc and this is the result:

Screenshot-20200602-193242.png

So there was also a high value spike at 505.57%.

I suppose that those three values are wrong one, but I would like to know how to investigate into that to understand if it is an hardware issue or a software one. Is there any way to do that?

Last edited by Xwang (2020-06-02 17:37:45)


I'm still learning English so please excuse me if my English is not good enough and feel free to correct me via PM if you want.

Offline

Board footer

Powered by FluxBB