How can I check if my battery is dying?

Hi.
I’m again having the issue where the battery of my Sony XA2 drains in around 24h whereas it used to last almost a week.
Last time, it was because apkd-bridge was eating up all the RAM, but it’s disabled right now, so it cannot be it.
I don’t see anything unusual or obvious in htop, except the lipstick -plugin evdevtouch -plugin evdevmouse -plugin evdevkeyboard process taking some RAM and CPU while the phone is idle (is this normal?).

So, my question is: how can I check if my battery is dying?

On linux laptops, I can check a file like /sys/class/power_supply/BAT0/energy_full_design and compare it to some other files, but I cannot find a similar file in SailfishOS.

Thanks for your help.

Maybe:

cat /sys/class/power_supply/battery/charge_full_design
4529000

That’s from an experia 10III

1 Like

Getting the same value for charge_full_design, but a bit smaller number for charge_full, so it’s probably that one
Yeah looks like it:
https://www.kernel.org/doc/Documentation/power/power_supply_class.txt

Unfortunately, this file doesn’t exist on my XA2.

I get:

ls: *design: No such file or directory

What are your contents of /sys/class/power_supply ?

[defaultuser@XperiaXA2 ~]$ ls /sys/class/power_supply
battery   bms       dc        main      parallel  pc_port   usb
[defaultuser@XperiaXA2 ~]$ ls /sys/class/power_supply/battery/
capacity                     current_now                  input_suspend                step_charging_enabled        uevent
charge_counter               current_qnovo                parallel_disable             subsystem                    voltage_max
charge_done                  device                       power                        sw_jeita_enabled             voltage_now
charge_type                  die_health                   present                      system_temp_level            voltage_qnovo
charger_temp                 dp_dm                        rerun_aicl                   technology
charger_temp_max             health                       set_ship_mode                temp
constant_charge_current_max  input_current_limited        status                       type

What does health say? If it’s not ‘Good’:

Could check there, but looks like most interesting parts are missing on xa2

Health is Good. Does that mean my battery is not dying?

No.

health refers to a momentary state, like ‘warm’, ‘cold’, or ‘overcurrent’, NOT overall health.

2 Likes

Look in the bms folder

[defaultuser@XperiaXA2 bms]$ ls
battery_type             charge_counter           constant_charge_voltage  device                   subsystem                uevent
capacity                 charge_full              current_now              power                    temp                     voltage_max_design
capacity_raw             charge_full_design       cycle_count              resistance               time_to_empty_avg        voltage_now
cc_step                  charge_now               cycle_count_id           resistance_id            time_to_full_avg         voltage_ocv
cc_step_sel              charge_now_raw           debug_battery            soc_reporting_ready      type
[defaultuser@XperiaXA2 bms]$ ls *design
charge_full_design  voltage_max_design
[defaultuser@XperiaXA2 bms]$ cat charge_full_design
3380000
[defaultuser@XperiaXA2 bms]$ cat charge_full
3380000

Does that mean my battery is good and some processes are draining my battery quickly?

Yeah that looks totally wrong, I guess sony guys never bothered, looks like counting manually how long it takes from close to 0% with given current is the only way (you’ll get sudden jumps and very short charging time or at least that’s how my n900s behave after years of usage with close to dead batteries)