Recalibrate battery after replacement in a Xperia XA2

Hello folks,

I recently replaced my battery in my Xperia XA2 to a new geinue Sony battery.
The on time increased a bit however my phone randomly turns off even when the battery charge percentage is high (for e.g. ~60%). It happens during calls, and even in idle state.
Is there any way to recalibrate the battery state without restoring the Android system?

2 Likes

Does the phone power down with the ā€œGoodbyeā€ screen, or does it suddenly turn off?

If the latter happen, I would suspect a hardware issue like a bad connection or a faulty replacement battery (high internal resistance) rather than a software issue.

It shut down gracefully (says the Goodbye and then turns off). It beeps a couple of seconds before the reboot (with the old battery it beeped at 3% and waited more time before the shutdown).

Is there anyone who replaced the battery in an XA2 with SFOS and did not have any troubles afterwards?

Iā€™m doing it right now and it looks like battery replacement struggles to go over 60%. Perhaps a recalibration is needed. I have a CELLONIC battery model. The one I still have been able to find on the market.

Actually there is another reply on this topic in a closed forum, but the CLI commands used there are not apparently available on my Sailfish XA2 - Sauna. Are there additional packages to be installed to be able to recalibrate the new battery?

I also want to recalibrate my battery in my Xperia 10 III

1 Like

@gfwp can you tell us this commands for battery calibration? Maybe some of the exerinced developers can give some informations if there some additional packages are needed.

For notebooks I founs this: https://www.reddit.com/r/linuxquestions/comments/oy4wwc/how_to_calibrate_battery_to_display_correctly/

Maybe there are some similar procedures available for LINUX mobile phonesā€¦

NO. Itā€™s exactly what Iā€™m looking for. tlp commands are missing.
Iā€™m referrring to the last message of this closed topic:

Perhaps we have to install the ā€œtlpā€ package.

Informations for tlp you can find here:

https://linrunner.de/tlp/

But if this could work under SailfishOS I donā€™t know.

1 Like

Itā€™s possible to install tlp from sources like described. I was able to manage that. But I cant test recalibration now because of Iā€™m not at home at the moment.

1 Like

I have the same problems but on Sony XZ2 Compact, new original Battery but the BMS still shows the values of the old one, even after 7 complete charges/discharges:

POWER_SUPPLY_CHARGE_FULL_DESIGN=2899000
POWER_SUPPLY_CHARGE_FULL=1113000 (old Battery!!)

Only cycle count was reset directly after change the Battery:

POWER_SUPPLY_CYCLE_COUNT=1

Iā€™m afraid I have to install Stock Android to calibrate it, but I will first wait here for a software solution.

I tested tlp yesterday evening with following result:

Error: battery charge thresholds/ discharge/recalibrate not available

So it seems that tlp is not supporting my hardware or something in kernel is missing for that feature.

My hardware for testing was X10 III with SF 4.6.0.13

Unfortunately, recalibrate option is only available for ThinkPad.

I fear that with every new kernel flashed and booted (Android Stock for calibration and then back to SFOS), the calibration data will be reset. So we really need this functionality in SFOS, and I canā€™t believe there are so few people experiencing problems with a de-calibrated battery after a change.

1 Like

What is this battery calibration in detail? Isnā€™t it enough to stop charging at a voltage, e.g. 4,2V to not overload the battery and on other side to stop discharging and shutdown the phone at e.g. 3,7 or 3,8V to take care of the battery and extend itā€™s lifetime? Is the calibration only for an exact display of charging percentage or has it a higher sense?

As a battery ages, it loses capacity. Along with voltage, the charging current is an important criterion. By fully discharging and recharging, the battery management system (BMS) can recalibrate the percentage classification. While partial charging and discharging may extend the batteryā€™s lifespan, it ultimately leads to a decoupling of the classification, which can result in unpleasant events such as a sudden shutdown of the device at 10% or similar occurrences. Until proper calibration is achieved, the percentage display is inaccurate and worthless.

When not calibrated and after a battery replacement, the new battery charges relatively quickly to 100%, as indicated by the old POWER_SUPPLY_CHARGE_FULL value. If you disconnect the charger at the indicated 100%, only a fraction of the actual capacity of the new battery is charged. This is evident because the charging current is still high at the indicated 100%, indicating that calibration is necessary. If this is not done, you are effectively only using the remaining capacity of the old battery with the new battery when relying on the percentage display.

I experienced this problem also on my Sony Xperia X Compact as well, but I thought it was just a display error without investigating or following up further.

Under Android, it was the case that after the battery replacement, the correct capacity was displayed immediately. The batteries have a small circuit board with monitoring, sensor, and protection functions. Itā€™s possible that some values are not being transmitted or reset correctly after the exchange.

Thatā€™s why I wonder where the problem lies. Was this calibration mechanism forgotten to be implemented or activated in the AOSP drivers/kernel provided by Sony, or is this function missing in (Community-Ports of) SailfishOS?

When my Jolla C2 is delivered and set up, I will flash my XZ2 Compact with the Sony stock ROM and see if that correctly calibrates the new battery and if it stays that way after SFOS is flashed back on. Maybe I can install the stock ROM on Slot B and change the bootloader without having to delete/overwrite SFOS!? I will report back.

2 Likes

I have replaced XA2s batteries several times.
I just did some full discharge/charge cycles and all was ok then.

3 Likes

Iā€™ll do the same, @ric9k , on my testphone where I changed the battery a week ago and report what happens when ready. Iā€™ll turn off charging/discharging limits during the test.