Script to control Nexus 10 charge between 35%-55% - Nexus 10 General

According to battery university, the optimal charge level for storage is 40%, and it's best to limit your depth of discharge as much as possible. Thinkpads have had a function to do just that, with the excellent tp_smapi module enabling the functionality under Linux.
I turns out Nexus 10 with OmniROM has a way to disable charging even when the AC power is plugged in via the file /sys/devices/virtual/power_supply/manta-battery/charge_enabled. I've created a script that uses this functionality to keep charge between 35%-55%. You can modify STOPLIMIT and STARTLIMIT to with desired charge levels. You can optionally create /data/local/etc/battery/STOPLIMIT and /data/local/etc/battery/STARTLIMIT and put the values in there. Those values would override the values in the script.
I start the service with 3C Toolbox Pro with a script that calls
Code:
su -c /data/local/bin/charge_control.sh &
Requirements:
Device: Nexus 10
ROM: OmniROM HOMEMADE20141102
Rooted
busybox installed
The ROM can be found in this thread: http://forum.xda-developers.com/showthread.php?t=2705229
It may work under other configurations, but above is the configuration I've tested it under. Battery university reference: http://batteryuniversity.com/learn/article/how_to_prolong_lithium_based_batteries

Expected increase in battery longevity
Battery longevity (to 80% original life) should increase from under 1 year to over 5 years by using this script. More below.
The battery university article indicates the battery will last from 300-500 cycles with a full depth of discharge, and 150-250 cycles with maximum charge voltage of 4.3V. The Nexus 10 does charge with very high voltages above 4.3V to get the battery to 100% charge. That means your battery will last less than a year in the most extreme cases. For example, your battery will have 80% capacity after 300 days if you do a full charge every other day with 4.3V. My device reached the 80% battery life cycle in about 1 year, and then got progressively and rapidly worse, until I replaced the battery with 40% original life after 20 months.
With this script, battery life should increase to 1200-2500 cycles between 25%-50% depth of discharge, and 1200-2000 cycles with battery voltage limited to under 4V at full charge. So battery life should increase to 6.5 years up to over 13 years charging it up to 55% every day!

I have had this tablet since release and always plug it into the charger when going to sleep. I typically use the device from 100% to 60% each day. This device is over 2 years old now and still has the same screen on time each charge cycle as day one.
Thanks for sharing.

esprout said:
According to battery university, the optimal charge level for storage is 40%, and it's best to limit your depth of discharge as much as possible. Thinkpads have had a function to do just that, with the excellent tp_smapi module enabling the functionality under Linux.
I turns out Nexus 10 with OmniROM has a way to disable charging even when the AC power is plugged in via the file /sys/devices/virtual/power_supply/manta-battery/charge_enabled. I've created a script that uses this functionality to keep charge between 35%-55%. You can modify STOPLIMIT and STARTLIMIT to with desired charge levels. You can optionally create /data/local/etc/battery/STOPLIMIT and /data/local/etc/battery/STARTLIMIT and put the values in there. Those values would override the values in the script.
I start the service with 3C Toolbox Pro with a script that calls
Code:
su -c /data/local/bin/charge_control.sh &
Requirements:
Device: Nexus 10
ROM: OmniROM HOMEMADE20141102
Rooted
busybox installed
The ROM can be found in this thread: http://forum.xda-developers.com/showthread.php?t=2705229
It may work under other configurations, but above is the configuration I've tested it under. Battery university reference: http://batteryuniversity.com/learn/article/how_to_prolong_lithium_based_batteries
Click to expand...
Click to collapse
Could you point me in the right direction so that I could run this script? I'm on Dirty Unicorns ROM.

omgi0wn said:
Could you point me in the right direction so that I could run this script? I'm on Dirty Unicorns ROM.
Click to expand...
Click to collapse
Check that your kernel supports the system interface /sys/devices/virtual/power_supply/manta-battery/charge_enabled. You need to be rooted, and then you can open a terminal and
Code:
cat /sys/devices/virtual/power_supply/manta-battery/charge_enabled
to make sure the file exists to control charging.
The script also relies on /sys/devices/virtual/power_supply/manta-battery/capacity to check battery capacity. You can similarly check with:
Code:
cat /sys/devices/virtual/power_supply/manta-battery/capacity
But if you have charge_enabled in that folder, you most likely also have capacity as well.
After that, you would simply run the script with ./charge_control.sh &

mymusicathome said:
I have had this tablet since release and always plug it into the charger when going to sleep. I typically use the device from 100% to 60% each day. This device is over 2 years old now and still has the same screen on time each charge cycle as day one.
Click to expand...
Click to collapse
Looks like someone won the battery lottery. My tablet shuts down before it even gets to 50% charge these days, it's super frustrating.

Has anyone tried this on stock Lollipop?

_Raziel666 said:
Has anyone tried this on stock Lollipop?
Click to expand...
Click to collapse
Confirm work on stock Lollipop 5.1.1 (LMY48I).
Since,
Code:
/sys/devices/virtual/power_supply/manta-battery/capacity
was not found, after some time of browsing I've found
Code:
/sys/devices/virtual/power_supply/manta-battery/subsystem/ds2784-fuelgauge/capacity
You'll need to modify the respective line 22 in script to
Code:
charge=$(cat /sys/devices/virtual/power_supply/manta-battery/subsystem/ds2784-fuelgauge/capacity)

Good advice.. I usually change it to 80% seems to still last a lot and I got it 1 month after the release.
I never charge it to 100% since I know it will mess up the battery.

Is it possible to find "charge_enabled" for Nexus 7 (2013, flo, razor) in Android KitKat 4.4.4?
"online" and "capacity" can be found easily in "sys/class/power_supply".
I've tried "lsof | grep healthd", but didn't identify read/write flag "charge_enabled" or similar.

Recently found a solution by customizing kernel here: Battery life extender
However applying this patch to stock kernel is not a solution for ordinary user.

shcholeh said:
Recently found a solution by customizing kernel here: Battery life extender
However applying this patch to stock kernel is not a solution for ordinary user.
Click to expand...
Click to collapse
Did it work for you? If so, can you tell me what control files you edited and what android version you are on?
Im on LineageOS 14.1 and i tried changing the enable_charge value to one but the app still said my device is not supported (yet).

Related

[Q] Custom ROM battery life?

Hi everyone. When I first got my 10.1, it seemed the battery on the first half of a charge lasted forever. I notice now it is dropping faster using the Starburst ROM. Just wondering if this is all in my head, or if this is possible?
I originally switched for the purpose of extended life and faster speeds (less processes).
Thanks for answering anyone,
I'm using the Starburst ROM, and I haven't noticed much if any change in the battery life of the device.
I just saw the guy who made one of the roms in the dev forum say he got 36 hours on his one charge, and that 7 is terrible. I am running the stock kernel and pulling 6-7.5hrs battery with wifi and MINIMUM SCREEN BRIGHTNESS.
Is something wrong?
I am running ADW launcher ex with no animations on.
wy2sl0 said:
I just saw the guy who made one of the roms in the dev forum say he got 36 hours on his one charge, and that 7 is terrible. I am running the stock kernel and pulling 6-7.5hrs battery with wifi and MINIMUM SCREEN BRIGHTNESS.
Is something wrong?
I am running ADW launcher ex with no animations on.
Click to expand...
Click to collapse
I am that guy. Everything depends on what you are doing with your tab also. When I got 36 hours I basically was only listening to music in my car and checking emails with brightnesstona minimum. But when I'm programming and having to constantly reboot, flash and test things out I still pull at least 20-24 hours. I find it really hard to kill my battery during a day long period. I don't run any Widgets also.
wy2sl0 said:
I just saw the guy who made one of the roms in the dev forum say he got 36 hours on his one charge, and that 7 is terrible. I am running the stock kernel and pulling 6-7.5hrs battery with wifi and MINIMUM SCREEN BRIGHTNESS.
Is something wrong?
I am running ADW launcher ex with no animations on.
Click to expand...
Click to collapse
Stock kernel does not have current property exposed so you cannot see current directly. But if you look at dmesg log for fg_read_current reports... so you can judge tablets average current, something like this:
fg_read_current : CURRENT(-470mA), AVG_CURRENT(-416mA)
That's normal values for minimum brightness, WiFi on and idle.
Now do math. 470mA * 7 hours = 3290 mAh
So, if this is the case, then your tab needs battery calibration because you should have battery capacity around 6500mAh - 7000mAh.
But if your fg_read_current reads around 800mA - 900mA then you on a ballpark.
PS: with max back light current should be around 1000mA, so run time with calibrated battery would be around 6 hours. In order to pull 36 hours, current should be 6900 / 36 = 190mA - that means your have to turn screen Off completely and maybe put tablet in kind of semi-hibernate mode when only media players is working. I did not try that, I don't know.
Vlad_z said:
Stock kernel does not have current property exposed so you cannot see current directly. But if you look at dmesg log for fg_read_current reports... so you can judge tablets average current, something like this:
fg_read_current : CURRENT(-470mA), AVG_CURRENT(-416mA)
That's normal values for minimum brightness, WiFi on and idle.
Now do math. 470mA * 7 hours = 3290 mAh
So, if this is the case, then your tab needs battery calibration because you should have battery capacity around 6500mAh - 7000mAh.
But if your fg_read_current reads around 800mA - 900mA then you on a ballpark.
PS: with max back light current should be around 1000mA, so run time with calibrated battery would be around 6 hours. In order to pull 36 hours, current should be 6900 / 36 = 190mA - that means your have to turn screen Off completely and maybe put tablet in kind of semi-hibernate mode when only media players is working. I did not try that, I don't know.
Click to expand...
Click to collapse
Ok. If you don't mind what is there that I have to do to see this value? Run pershoots kernel?
Did you see a difference in current consumption between the stock and pershoots?
I went from stock to Task650's ROM with Pershoot's Kernel. At first battery life was terrible.
I then had to calibrate the battery. (Essentially letting it run down till the tab auto shuts down, then booted into recovery and left it running some more. Then charged to full while the tablet was off.)
I now get the battery life that Task650 is talking about.
ok, call me stupid but you want be to believe you can actually have the gtab running 30+ hours on one charge with screen and wifi on all this time? how much of that time is it actually running and how much it's hibernated (as in turned off by single press of power button or shut down autonomously when idle)?
wy2sl0 said:
Ok. If you don't mind what is there that I have to do to see this value? Run pershoots kernel?
Did you see a difference in current consumption between the stock and pershoots?
Click to expand...
Click to collapse
I did not mention significant change in current consumption going from stock to pershoot kernel. Min. brightness and web browsing will average 530- 550mA which gives about 12 hours of non-stop run-time.
In fact even overclocked CPU (I've 1.2Ghz) will eat maybe 20-50mA more BUT only when running 100%. Which is perfectly in line with overclocking speed increase of 20%. But it will have job done also 20% faster and then goes idle... so there would be no penalty for overclocking.
with pershoot kernel you can use Battery monitor or use ADB command:
adb shell cat /sys/class/power_supply/battery/batt_current
with stock kernel your only option to analyze kernel log, say like this:
adb shell dmesg | grep "fg_read_current"
Well, if you will find that your battery needs to be calibrated then here is the proper way to do it:
http://forum.xda-developers.com/showthread.php?t=1215182
antic604 said:
ok, call me stupid but you want be to believe you can actually have the gtab running 30+ hours on one charge with screen and wifi on all this time? how much of that time is it actually running and how much it's hibernated (as in turned off by single press of power button or shut down autonomously when idle)?
Click to expand...
Click to collapse
He did not specified how he run his music - with screen On or without... but this is obvious... screen is major power sucker, in order to claim 36hours screen must be off.
edit: alright, i just test it... streaming mp3 from Google music with screen off requires only 140mA with 25% volume. so 6900 / 140 = 49 hours.
and with screen on - 550mA.
At this point, how safe are we for running an OC anyways....cooling is terrible in a tablet without a fan, noone really knows the answer until they start dying in the coming months.
As for battery life, I will try your method and see what happens. If still toast, I will switch over to a different kernel, and do the data logging you are talking about.

Extended "screen-on" time by battery gauge tricks

Sorry for long story but might be interesting for developers.
Some time ago I have flashed OSIMood ROM to my Mediapad. After flashing I had brand new "Battery Gauge" showing percentage values (circular icon), but after some time it was.... lost(!!!)? I do not know what happened but it just has disappeared. At the same time device stopped displaying warning about "automatic shutdown" because of the low battery level.
Then.... I started to use alternative battery monitors (like Battery Monitor Widget) and it read very strange battery levels from system. According to what it read battery went down to 0% in 1-2hours of "screen-on" and it stayed at 0% even for 5 hours of "screen-on" time until device switched off because battery was empty.
The Battery Monitor Widget showed clearly that MEDIAPAD switches off without warring when the battery is empty (usually about 3250mV, lowest level reached was 3100mV). Switch off at ~3200mV is not devastating to battery as I have monitored many recharge cycles and battery was able to recharge back to 4199-4200mV every time.
The battery condition is fine - when it was recharged overnight I could EASILY reach over 6 hours of "screen on" watching online video (with WiFi on). I think this is perfect.
I have tried to recalibrate battery but it did not help. The battery monitors have always read level 0% and stays at 0% much too early.
I was NOT complaining about missing "automatic shutdown" - in my opinion this was triggered much too fast (when there was still lot of battery left). I could use my Mediapad much much longer, In my opinion this was huge ADVANTAGE(!!!).
I have tried to investigate and found somewhere that FuelGauge interprets 3900mV as 100% and 3400mv as 0% while Mediapad tab can still work intil it drops down to 3200mV(!!!). Moreover I have noticed that pad gets quickly down to about 3500mV~3450mV and this is a time when "automatic shutdown module" triggers "force close". But.... this feature was gone/borken in OSI MOD allowing tab to work for nex few hours (!!!) great
Now..... I wanted to get "overcloked kernel" and "touchsceen filtereing" and flashed CleanICE ROM and.... my tab gets dow to 0%in 2 hours + I suffer from "automatic shutdown". I miss the OSI MOD now and miss 6 hours of screen-on working.
THIS IS A MESSAGE TO ALL DEVELOPERS.
1. Could you please reveal how to REMOVE/DISABLE standard "automatic shutdown" feature? It will allow our's mediapads to run for 6 hours instead 2 or 3 hours.
2. Could you please fadjust the fuel gauge, by setting up the 100% for 4000mV and 0% for 3200mv. I think this will give much better battery level estimations.
Who know how to do this? Implementing this this would be great contribution for all Mediapad user community.
maybe yor battery is worn...before I replaced battery, it jumped from 15% to 0% almost immediately, now with new one I can go up to 7 hours of screen-on+wifi (CM10 rom)...it takes about 40 minutes of using to drop from 2% to 1%
441Excelsior said:
maybe yor battery is worn...before I replaced battery, it jumped from 15% to 0% almost immediately, now with new one I can go up to 7 hours of screen-on+wifi (CM10 rom)...it takes about 40 minutes of using to drop from 2% to 1%
Click to expand...
Click to collapse
Where did you buy the new battery from?
441Excelsior said:
maybe yor battery is worn...before I replaced battery, it jumped from 15% to 0% almost immediately, now with new one I can go up to 7 hours of screen-on+wifi (CM10 rom)...it takes about 40 minutes of using to drop from 2% to 1%
Click to expand...
Click to collapse
can you tell me step-by-step how to open back cover? thankyou
I have a similiar problem in ALL custom rom i tried. My mediapad is hooked up in my car dashboard, so
ignition on -> charging (and normal use)
ignition off -> standby and airplane mode
many mornings instead of waking up automagically, I found mediapad shutted down. When I turn it on it shows suddently something like 70% charge! This issue *doesnt* appear in huawei rom, so it seems to be a custom rom/cyanogen issue
feel free to ask me info and please provide procedures for log and debug, I whould be very happy to solve this issue
danisukses said:
can you tell me step-by-step how to open back cover? thankyou
Click to expand...
Click to collapse
you must remove two black covers then unscrew 6 screws (3 under each cover), then remove speakers cover and then carefully remove screen (use knife or something thin but be very careful cause you can damage wires or PCB with knife...it is not so hard to open it but you must be extremely careful
441Excelsior said:
you must remove two black covers then unscrew 6 screws (3 under each cover), then remove speakers cover and then carefully remove screen (use knife or something thin but be very careful cause you can damage wires or PCB with knife...it is not so hard to open it but you must be extremely careful
Click to expand...
Click to collapse
Excuse me.
Where did you buy the new battery from?
I bought it from one man who had 2 months old mediapad lite with broken screen so he was selling its parts
thankyou brother
MediaPad is only using ~40% of its battery power
I too observe the same behavior. It's quite obvious that the MediaPad is only using ~40% of its battery power.
The MediaPad would scream battery low and shut off (after around 3 hours of use) at around 3.75v, but there is still a lot of juice left in the battery! I can confirm this by continuing reboot into recovery mode (ie, screen on full brightness, no battery management), while the MP body becomes quite warm due to high power draw, it lasts another 3 hours before the battery protection kicks in and shuts off the power (~3.2V).
I found that if I plug in again and turn on the Mediapad, the battery gauge would stubbornly stay at 0% for around 2 hours (even though the battery is sucking power @ 1.3a and recovering in voltage) and then starts to move upwards (at around 3.95v). After another 3 hours, the battery is fully charged.
I can replicate this behavior in the official rom or any other roms that I have tried. So, it's seems to me that there're something REALLY WRONG with the MP's battery gauge and I would repeat eses1234's request:
THIS IS A MESSAGE TO ALL DEVELOPERS.
1. Could you please reveal how to REMOVE/DISABLE standard "automatic shutdown" feature? It will allow our's mediapads to run for 6 hours instead 2 or 3 hours.
2. Could you please adjust the fuel gauge, by setting up the 100% for 4000mV and 0% for 3200mv. I think this will give much better battery level estimations.
Who know how to do this? Implementing this this would be great contribution for all Mediapad user community.
buddylu said:
I too observe the same behavior. It's quite obvious that the MediaPad is only using ~40% of its battery power.
The MediaPad would scream battery low and shut off (after around 3 hours of use) at around 3.75v, but there is still a lot of juice left in the battery! I can confirm this by continuing reboot into recovery mode (ie, screen on full brightness, no battery management), while the MP body becomes quite warm due to high power draw, it lasts another 3 hours before the battery protection kicks in and shuts off the power (~3.2V).
I found that if I plug in again and turn on the Mediapad, the battery gauge would stubbornly stay at 0% for around 2 hours (even though the battery is sucking power @ 1.3a and recovering in voltage) and then starts to move upwards (at around 3.95v). After another 3 hours, the battery is fully charged.
I can replicate this behavior in the official rom or any other roms that I have tried. So, it's seems to me that there're something REALLY WRONG with the MP's battery gauge and I would repeat eses1234's request:
THIS IS A MESSAGE TO ALL DEVELOPERS.
1. Could you please reveal how to REMOVE/DISABLE standard "automatic shutdown" feature? It will allow our's mediapads to run for 6 hours instead 2 or 3 hours.
2. Could you please adjust the fuel gauge, by setting up the 100% for 4000mV and 0% for 3200mv. I think this will give much better battery level estimations.
Who know how to do this? Implementing this this would be great contribution for all Mediapad user community.
Click to expand...
Click to collapse
Hi, I'm not a developer but I think this can be a real HUGE and fantastic improvement for out MP. Googling around I've found this (maybe can be useful):
in BatteryService.java ,when the battery lvl is too low (0%, lower than 3.4v), the service will call shutdownIfNoPower to shutdown system. The complete file path is services/java/com/android/server/BatteryService.java in android_frameworks_base.
Thats really some interesting facts.
I did some googling an came to this point:
I downloaded the latest rom from after_silence and extracted it to my hard disk.
Then i took the "/system/framework/services.jar" and disassembled it with the apktool.
After that i digged into the folders and found the BatteryService.smali in "com\android\server".
Im not a developer as well so im not able to go any further right now, but as far as i can see it should be possible to modify the BatterService, compile the services.jar and sign it again to push it back to the MediaPad.
Im stuck to the "shutdownIfNoPowerLocked" i think this is the variable which is forcing the shutdown.
Someone else with some more information?
I did some more experiments about the battery problem and found the following facts. I am not a developer myself, but I'd really be grateful if someone can at least disable the shutdownIfNoPower mechanism.
buddylu said:
At first when I found this problem, I thought that’s my battery dying and its power output characteristics are dropping, so I changed to a NEW battery. While it's better than the old one, the MediaPad only see and use about half of its juice.
I even went to the extreme, put 2 NEW batteries in parallel circuit (in theory providing twice the juice, with the same voltage and better power output curve characteristics), and changed the battery protection circuit to a new one. Same thing - the MediaPad stubbornly only see and use ~ half of the juice. Plus the aforementioned observation of the cut off voltage @3.75V in Android system and @3.2V cut off in recovery, I come to the conclusion that MediaPad’s power gauge is faulty.
Click to expand...
Click to collapse
Any improvements in this subject???
no sorry, the only thing you can do to extend battery life is undervolting
441Excelsior said:
no sorry, the only thing you can do to extend battery life is undervolting
Click to expand...
Click to collapse
Thanks but undervolting does not help in the main problem that mediapad switches off at high battery voltages.
mine switch off at 3.55-3.6V
Hiero said:
Thats really some interesting facts.
I did some googling an came to this point:
I downloaded the latest rom from after_silence and extracted it to my hard disk.
Then i took the "/system/framework/services.jar" and disassembled it with the apktool.
After that i digged into the folders and found the BatteryService.smali in "com\android\server".
Im not a developer as well so im not able to go any further right now, but as far as i can see it should be possible to modify the BatterService, compile the services.jar and sign it again to push it back to the MediaPad.
Im stuck to the "shutdownIfNoPowerLocked" i think this is the variable which is forcing the shutdown.
Someone else with some more information?
Click to expand...
Click to collapse
I had a look into it from the kernel side. The battery percentage shown is read directly from a battery monitor chip (TI bq27510). The percentage is calculated by the amount of charge that the battery provided to the pad (coulometer). The sysfs driver lives in /sys/power, its source is in drivers/power/bq275x0_battery.c.
The function that reports the battery percentage is this one:
Code:
/*
* Return the battery Relative State-of-Charge
* Or < 0 if something fails.
*/
int bq275x0_battery_capacity(struct bq275x0_device_info *di)
{
int data=0;
// int data2 = 0;
if(BSP_FIRMWARE_DOWNLOAD_MODE == gBq275x0DownloadFirmwareFlag)
{
return 30;
}
#ifdef BQ275x0_DEBUG_FLAG
get_remaining_capacity(di);
get_full_charge_capacity(di);
#endif
data = bq275x0_i2c_read_word(di,BQ275x0_REG_SOC);
BQ275x0_DBG("read soc result = %d Hundred Percents\n",data);
return data;
}
If you want it to report something else, maybe based on the voltage, this function could easily be changed to something like:
Code:
/*
* Return the battery Relative State-of-Charge
* Or < 0 if something fails.
*/
int bq275x0_battery_capacity(struct bq275x0_device_info *di)
{
int data=0;
// int data2 = 0;
[B]int voltage = 0; // Voltage in mV[/B]
if(BSP_FIRMWARE_DOWNLOAD_MODE == gBq275x0DownloadFirmwareFlag)
{
return 30;
}
#ifdef BQ275x0_DEBUG_FLAG
get_remaining_capacity(di);
get_full_charge_capacity(di);
#endif
[B]voltage = bq275x0_battery_voltage(di);
data = some_cool_function_that_magically_converts_the_voltage_into_a_good_percentage_estimate(voltage)[/B]
BQ275x0_DBG("read soc result = %d Hundred Percents\n",data);
return data;
}
Although one should check first that this does not interfere with charging the battery correctly (I guess it won't).
I have no working toolchain ready to test this atm (quite busy...). If I find some time I will give it a shot and ask around who wants to play the guinea pig
mblaster
Hey mblaster,
that sounds really interesting!
So with this function we can reduce the shutdown voltage by manipulating the variable, right?
any news?
my pad keeps dropping its capacity by 20%+ in no time when its active/ in use
when in standby it works like it is supposed
any news would be much appreciated

ZeroLemon Fuel Gauge Fix Samsung Galaxy Note 4 [BETA]

First Beta Release on Lollipop BioShock
Alright guys, I have shaped this mod up to the best of my abilities and I present to you the Bravo version of it. I will get other kernel versions of this mod out but in the mean time I am sticking with the Original work space one based off of the Lollipop BioShock 3.10.40. I know this is the older version, but I will mass update ALL the kernels really soon. Basically everything (even the app) are enclosed into 1 ZIP file so all you have to do is flash the Kernel and you are ready to go. A couple of things I would like to get out there:
1. You should have a Fully charged ZL Battery. I wouldn't say before flashing this as you can re-calibrate the app, but I would recommend that you do so to avoid any confusion.
2. When you charge the battery with this mod, yes the percentage does charge fast and it will most likely show 100% BEFORE the battery reaches 100%. There is a issue with the current/mA flow readings IN the app and that will be fixed in the near future. Please understand that TRUE 100% is when the phone says "Fully Charged 100%, Unplug Charger" not when the Fuel gauge (next to the clock) says 100%.
3. Some people ask "Will the app Accurately calculate the battery to avoid shutting down at lets say 15% or still running 1% for days like normal"? And the answer to that is most likely Yes, and Possibly no. I say yes to the first part because you can put in the different drain values of each component in the Note 4 so that the app can detect the draining and calculate accordingly. Now, I will warn you that I have never used this mod to do a full complete drain. So I will say I wouldn't recommend letting the battery go all the way down to 15% (just as a safety net if you plan on going out, etc) in-case the battery does hit 3.4 volts which is the Note 4's 0% Shutdown target. And the 1% mod is almost unlikely.
4. Finally, I have received your messages and Emotion Kernel seems to be the popular Kernel at this time (I will be using it in the coming days also) so I will get to that next once I get the source code loaded. (KitKat users, you are not forgotten) I will also be posting the Kernel files so that Kernel devs can make different variants once I hear from you guys on how this mod is working. To me, I think its great. From the way it was before I can say its a Improvement from the drain calculation side. The charging side needs work, but hey, you hardly have to charge the dang thing anyways lol.
Now to the Installation
Of course, I would recommend that you do a backup of course and that you have a backup kernel with you. Basically, if you can use this kernel http://forum.xda-developers.com/note...-2014-t2962744 It should work.
Once you have flashed the file below "BioShock_N910T_TW_LP_Extended_Battery_Mod_OFFICIA L_BRAVO.zip", you should also wipe delvik and cache just to make sure everything goes smoothly. If the mod was successfully installed, your battery level should read "101%". It will read 101% every time you reboot just to keep things clean and then go back to the App's fuel gauge level 1 minute after boot.
If it shows 101%, go into your Apps and you should see a App called "Fuel Gauge Extended..." Open that app up and wait about 3-5 seconds for everything to populate (Done to keep battery usage down). Make sure to check Start on Boot if you want the service to start with the phone (which I think EVERYONE should do) and then tap start monitor. You might get a SuperSU permission screen which you want to grant permissions to. Once you see the Status saying "Running" go down to the debug area to the "Patch Status" string and it should report "ok/[success]]" and your real battery gauge should read whatever the Software Status says.
This app also doesn't have the on screen dedicated 3-dot menu buttons so you have to go old fashioned and how down the left menu soft-key for a second until a menu pops up at the bottom which shoes Start Full Charge, Set full battery, and configuration. This is where you can calibrate your battery so that once you fully charged your battery, you go into the app and select "Set full battery" to set the app and battery capacity to 100%. Please note that this will take anywhere from 30 seconds to 1 minute to update the battery meter globally. You don't want to press either one of these when you already have calibrated the battery before and you are at half a charge as you will lose your capacity remaining level and accuracy until you fully charge again.
Under configuration, you can make the app calibrate to 100% every time your phone displays "Fully charged, disconnect charger". You can also disable the notification under Notification Icon.
Hardware current is where you can change the different consumption values of each component. I wouldn't mess around here too much as you could create a imbalance within the app calculations.
And basically that's pretty much it. IF and SHOULD you have any problems, just reply here or shoot me a PM and I will help you to the best of my abilities.
Thank you guys for your patience and I hope you enjoy this beta mod.
About the values that you input, this would lead to inconsistencies wouldn't it? Like how would we be able to know the exact values? Is it possible to use the values in the Fuel Gage chip?
e.g. It still says there is charge in the battery, but there is none, and the phone just switches off in the middle of use?
jayden485 said:
About the values that you input, this would lead to inconsistencies wouldn't it? Like how would we be able to know the exact values? Is it possible to use the values in the Fuel Gage chip?
e.g. It still says there is charge in the battery, but there is none, and the phone just switches off in the middle of use?
Click to expand...
Click to collapse
While this maybe true, you also have to take into consideration that the battery already does this without this mod when it stays at 1% for extended periods of time. Also, there is a file in the framework-res.apk that has all the power profiles of each component in its mAH values. But I am pretty sure with this mod, I wouldn't think you would drain the battery all the way to 2 or 5% expecting to go another day or to go to work with it. When you get down to 5%, the screen dims automatically so that alone would force people to charge the phone. But that is a good question. Now the ONLY Time the percent values would be off is when you use the phone in recovery mode for extended periods of time or when you charge the phone when the phone is off, you have to go into the app and reset to 100%. I am working on a code which makes the percent automatically go to 100% when voltages hit fully charged.
7 Hours off battery.
Sent from my SM-N910T using XDA Free mobile app
TheLoneWolf20 said:
While this maybe true, you also have to take into consideration that the battery already does this without this mod when it stays at 1% for extended periods of time. Also, there is a file in the framework-res.apk that has all the power profiles of each component in its mAH values. But I am pretty sure with this mod, I wouldn't think you would drain the battery all the way to 2 or 5% expecting to go another day or to go to work with it. When you get down to 5%, the screen dims automatically so that alone would force people to charge the phone. But that is a good question.
Click to expand...
Click to collapse
So we don't have to find values? Is that how the Fuel Gage chip does it? How confident are you in how accurate this will be?
jayden485 said:
So we don't have to find values? Is that how the Fuel Gage chip does it? How confident are you in how accurate this will be?
Click to expand...
Click to collapse
The fuel chip uses voltage levels as well as values stored in the kernel to come up with a near accurate reading. What I can do is put the stock battery in and set the app to the stock capacity and see if the app capacity matches up with the Fuel gauge capacity. But I am pretty confident that it will be accurate. Again, even if we get to 5 or 3% battery before shut down, its MUCH better than getting to 1% and still have 55% battery left. And that can be fixed.
The app can tell the different brightness levels from 0 to 255, Rather bluetooth, wifi, gps is on or off, talking on phone, etc. and it auto adjusts accordingly.
Sent from my SM-N910T using XDA Free mobile app
Now we are cooking with gasoline
It couldn't be any worse than not doing anything so.
Sent from my SM-N910T using XDA Free mobile app
following this thread to see results, as my zerolemon is yet to arrive later this month so can't really test anything
Warnahly said:
following this thread to see results, as my zerolemon is yet to arrive later this month so can't really test anything
Click to expand...
Click to collapse
Alright no problem. I didn't release anything yet until I make sure everything is super stable.
I'm waiting for the release
I had to delay releasing the beta because I found a major issue with the current polling fix which shut down charging prematurely because it didn't poll any Temperature and Voltage levels form the Thermistors. But I have found the string I was looking for all along and I will begin going the back door way. Once I can get that done, I will have no problem releasing the beta for testing. Before I officially post it on here, I want to give it to a select people first to let them try it out and report back to me any issues they encounter so if you are interested in Testing it, please send me a PM. I have a couple of people already down. ALSO, Please put down what kernel you are using, The Source Code link of the kernel and the Variant of your Note 4. I am working with the BioShock Kernel right now and I am planning to do a Emotion version as well. For those who are on AOSP or AOKP kernels / ROMS shoot me a PM and I can see what I can do. Once again, I want to thank you guys for your continued patience.
One more thing, It also helps to charge your ZL Battery all the way to 100%
Congrats! Persistence pays off.
Emotion kernel for me
I finally got the polling redirected so that the phone still reads the Temp, Voltage, Current, and other values which makes sure that the battery remains safe. Only the calculated capacity from the App will go through the system. I could release it right now, but I want to fix one more value before it passes me.
Running more test before I pass it on to some of you guys for your testing. I have the Temperature, Current and Voltage sensors working now I just need to make the current percent value stick with the file so when I do a restart, it doesn't jump up.
Sent from my SM-N910T using XDA Free mobile app
First Beta Release on Lollipop BioShock
Alright guys, I have shaped this mod up to the best of my abilities and I present to you the Bravo version of it. I will get other kernel versions of this mod out but in the mean time I am sticking with the Original work space one based off of the Lollipop BioShock 3.10.40. I know this is the older version, but I will mass update ALL the kernels really soon. Basically everything (even the app) are enclosed into 1 ZIP file so all you have to do is flash the Kernel and you are ready to go. A couple of things I would like to get out there:
1. You should have a Fully charged ZL Battery. I wouldn't say before flashing this as you can re-calibrate the app, but I would recommend that you do so to avoid any confusion.
2. When you charge the battery with this mod, yes the percentage does charge fast and it will most likely show 100% BEFORE the battery reaches 100%. There is a issue with the current/mA flow readings IN the app and that will be fixed in the near future. Please understand that TRUE 100% is when the phone says "Fully Charged 100%, Unplug Charger" not when the Fuel gauge (next to the clock) says 100%.
3. Some people ask "Will the app Accurately calculate the battery to avoid shutting down at lets say 15% or still running 1% for days like normal"? And the answer to that is most likely Yes, and Possibly no. I say yes to the first part because you can put in the different drain values of each component in the Note 4 so that the app can detect the draining and calculate accordingly. Now, I will warn you that I have never used this mod to do a full complete drain. So I will say I wouldn't recommend letting the battery go all the way down to 15% (just as a safety net if you plan on going out, etc) in-case the battery does hit 3.4 volts which is the Note 4's 0% Shutdown target. And the 1% mod is almost unlikely.
4. Finally, I have received your messages and Emotion Kernel seems to be the popular Kernel at this time (I will be using it in the coming days also) so I will get to that next once I get the source code loaded. (KitKat users, you are not forgotten) I will also be posting the Kernel files so that Kernel devs can make different variants once I hear from you guys on how this mod is working. To me, I think its great. From the way it was before I can say its a Improvement from the drain calculation side. The charging side needs work, but hey, you hardly have to charge the dang thing anyways lol.
Now to the Installation
Of course, I would recommend that you do a backup of course and that you have a backup kernel with you. Basically, if you can use this kernel http://forum.xda-developers.com/not...pment/kernel-bioshock-1-5-dec-4-2014-t2962744 It should work.
Once you have flashed the file below "BioShock_N910T_TW_LP_Extended_Battery_Mod_OFFICIAL_BRAVO.zip", you should also wipe delvik and cache just to make sure everything goes smoothly. If the mod was successfully installed, your battery level should read "101%". It will read 101% every time you reboot just to keep things clean and then go back to the App's fuel gauge level 1 minute after boot.
If it shows 101%, go into your Apps and you should see a App called "Fuel Gauge Extended..." Open that app up and wait about 3-5 seconds for everything to populate (Done to keep battery usage down). Make sure to check Start on Boot if you want the service to start with the phone (which I think EVERYONE should do) and then tap start monitor. You might get a SuperSU permission screen which you want to grant permissions to. Once you see the Status saying "Running" go down to the debug area to the "Patch Status" string and it should report "ok/[success]]" and your real battery gauge should read whatever the Software Status says.
This app also doesn't have the on screen dedicated 3-dot menu buttons so you have to go old fashioned and how down the left menu soft-key for a second until a menu pops up at the bottom which shoes Start Full Charge, Set full battery, and configuration. This is where you can calibrate your battery so that once you fully charged your battery, you go into the app and select "Set full battery" to set the app and battery capacity to 100%. Please note that this will take anywhere from 30 seconds to 1 minute to update the battery meter globally. You don't want to press either one of these when you already have calibrated the battery before and you are at half a charge as you will lose your capacity remaining level and accuracy until you fully charge again.
Under configuration, you can make the app calibrate to 100% every time your phone displays "Fully charged, disconnect charger". You can also disable the notification under Notification Icon.
Hardware current is where you can change the different consumption values of each component. I wouldn't mess around here too much as you could create a imbalance within the app calculations.
And basically that's pretty much it. IF and SHOULD you have any problems, just reply here or shoot me a PM and I will help you to the best of my abilities.
Thank you guys for your patience and I hope you enjoy this beta mod.
Awesome work man, I look forward to using this. On lollipop it seems my zL runs about a 15% battery difference from actual to estimated. This would be of great help.
:good::good:
JDevil said:
Awesome work man, I look forward to using this. On lollipop it seems my zL runs about a 15% battery difference from actual to estimated. This would be of great help.
:good::good:
Click to expand...
Click to collapse
No problem, I am happy it is working for you.
TheLoneWolf20 said:
No problem, I am happy it is working for you.
Click to expand...
Click to collapse
Ah, I have yet to test the mod. Have to do a backup first because I'm not too sure bioshock will run Verizon without complications. I haven't tried any other kernels running Jasminerom with kexec.

[HELP] Lineage OS 14.1 battery level stays 100% charged even unplugged

Hello xda-community!
First of all, thank you for your great material, guides and information you are offering here!
Now to the point:
I've flashed my Kindle Fire HDX 7" (Thor) with TWRP 3.0.3-1 with the LineageOS 14.1 and everything was great the first day.
After the night with my Kindle plugged in to AC charger I recognised my device turn off overnight. Was a little bit tricky to turn on (60s power-button reset) again.
No issues while using it in day-time. This time over night I didn't plug it in.
The next morning I saw the device rebooted and got stuck in the grey kindle fire bootloader screen. I reset then booted to Recovery TWRP showed me 14% battery left.
I've pluged it in AC charger and booted to Lineage. Lineage then showed me 100% battery charged. Even when I unplugged the kindle form power it remains 100 % charged and says its connected to AC power.
After this I let my Kindle run empty. The battery indicator in Lineage still remained 100%. The OS didn't shut down when power was low. In the end the screen was showing dark spots and was flashing 2 seconds to white and then the device was dead.
I've plugged it in again. Since this Lineage still shows 100% charged. If I boot to TWRP the battery indicator in the status bar disappeared mysteriously.
adb shell dumpsys battery brings up:
Code:
adb shell dumpsys
Current Battery Service state:
AC powered: true
USB powered: true
Wireless powered: false
Max charging current: 0
Max charging voltage: 0
status: 2
health: 2
present: true
level: 100
scale: 100
voltage: 0
temperature: 424
technology:
I've also flashed the LinageOS again and I've tried older versions of TWRP still the same (TWRP no battery indicator; Lineage 100%)
Also in CM13 it shows 100% charged. The kindle became very unstable and can only be run plugged in now. It seems the battery isn't chrarging at all any more.
What can I do to use the battery normal? Should I replace the battery?
I've also saw that the folder /sys/class/power_supply/ only contains 3 subfolders:
Code:
smb349_ac
smb349_usb
usb
I'm not sure but it seems to me that the folder for my battery is missing. Anybody have an idea?
Necronomynus said:
I've also saw that the folder /sys/class/power_supply/ only contains 3 subfolders:
Code:
smb349_ac
smb349_usb
usb
I'm not sure but it seems to me that the folder for my battery is missing. Anybody have an idea?
Click to expand...
Click to collapse
Can please someone post the "normal" view of this class? Thank you
OK folks, seems my battery has found its way back to life.
The class now looks like this:
Code:
bq27x41
smb349_ac
smb349_usb
usb
And the bq27x41 subclass contains all the info of my battery I could wish for. Charging and discharging behaviour seems pretty normal at the moment.
adb shell dumpsys battery now brings up:
Code:
ads su shell dumpsys
Current Battery Service state:
AC powered: false
USB powered: false
Wireless powered: false
Max charging current: 0
Max charging voltage: 0
Charge counter: 0
status: 3
health: 2
present: true
level: 86
scale: 100
voltage: 4105
temperature: 358
technology: Li-ion
Don't ask me what how I've exactly repaired my device. That's what I did:
flash kindle fire OS recovery system data boot with TWRP
flash vunarable bootloader and unlock it
flash TWRP 3.0.2-2 again
wipe everything also format data
flash CM13 and GAPPS
reboot/reset
let device in TWRP turned on and connected to AC power for 24h
wipe and flash Linage14. 1 and GAPPS
used my device normal while plugged in all the time for 3 days. When I'm not using it, I shutdown OS and unplugged my device. Then I've always powered it on again while connected to the AC-charger
after OS was running 2h I've unplugged my device from AC and now the battery is working again
Damn. I've booted to TWRP to see if the battery indicator is back but it was not. So no I've the same status again like in the OP.... No battery indicator in Lineage14. 1, too. I don't get it what happened.
Can someone please explain how and when this class is initialised by Android and when the objects (power_supply/bq27x41) are created. How can I trigger this?
Necronomynus said:
Damn. I've booted to TWRP to see if the battery indicator is back but it was not. So no I've the same status again like in the OP.... No battery indicator in Lineage14. 1, too. I don't get it what happened.
Can someone please explain how and when this class is initialised by Android and when the objects (power_supply/bq27x41) are created. How can I trigger this?
Click to expand...
Click to collapse
Met the same problem... I ran out of the battary and charged. After I rebooted, the battery indicator never worked again.
Necronomynus said:
Damn. I've booted to TWRP to see if the battery indicator is back but it was not. So no I've the same status again like in the OP.... No battery indicator in Lineage14. 1, too. I don't get it what happened.
Can someone please explain how and when this class is initialised by Android and when the objects (power_supply/bq27x41) are created. How can I trigger this?
Click to expand...
Click to collapse
Have you finally solved the problem? I reflashed Lineage and also tried CM13, but the problem remained. I plan to try the official OS to see if it works.
fhh2626 said:
Have you finally solved the problem? I reflashed Lineage and also tried CM13, but the problem remained. I plan to try the official OS to see if it works.
Click to expand...
Click to collapse
Thoughts:
- downgrade TWRP to 3.0.0-1 (yes, this seems unrelated; eliminating variables)
- try Fire Nexus (KitKat build) which shares the largest common base w/stock
- be sure to wipe system and data partitions prior to each attempt
Obviously Nexus is not a permanent solution; just trying to drive to root cause)
Davey126 said:
Thoughts:
- downgrade TWRP to 3.0.0-1 (yes, this seems unrelated; eliminating variables)
- try Fire Nexus (KitKat build) which shares the largest common base w/stock
- be sure to wipe system and data partitions prior to each attempt
Obviously Nexus is not a permanent solution; just trying to drive to root cause)
Click to expand...
Click to collapse
I tried Nexus..doesn't help. thanks anyway
fhh2626 said:
I tried Nexus..doesn't help. thanks anyway
Click to expand...
Click to collapse
no I have not found a solution yet. Still facing the same problem sometimes it works for some hours or days in LineOS and the suddenly the battery status is not updated anymore (e.x. at 55% battery doesn't change even when I plug in) after reboot it shows imediateley 100 % for some days) Then even while operating LineOS and without need of a reboot the indicator suddenly is working again.
It would be really helpful to know which event and which command the kernel issues to refresh/rebuild battery information from the smb349 (battery power-management IC) via i2cget command.
While using the Kindle without working battery indicator (I can still use it normally, even unplugged now) I just have to remember myself how long I've used it unplugged not to run out of battery unexpected.
While the working battery indicator days I've run "Accu Battery 1.1.7c" App which reports good health status and about 93% of the design capacity (4550 mAh) of my battery left
I always power it off and unplug it in phases I'm not using it for longer time (e.x. overnight). This improved the stability a lot.
Necronomynus said:
no I have not found a solution yet. Still facing the same problem sometimes it works for some hours or days in LineOS and the suddenly the battery status is not updated anymore (e.x. at 55% battery doesn't change even when I plug in) after reboot it shows imediateley 100 % for some days) Then even while operating LineOS and without need of a reboot the indicator suddenly is working again.
It would be really helpful to know which event and which command the kernel issues to refresh/rebuild battery information from the smb349 (battery power-management IC) via i2cget command.
While using the Kindle without working battery indicator (I can still use it normally, even unplugged now) I just have to remember myself how long I've used it unplugged not to run out of battery unexpected.
While the working battery indicator days I've run "Accu Battery 1.1.7c" App which reports good health status and about 93% of the design capacity (4550 mAh) of my battery left
I always power it off and unplug it in phases I'm not using it for longer time (e.x. overnight). This improved the stability a lot.
Click to expand...
Click to collapse
Curious - which build of TWRP do you have installed? Obscure long shot but updgrading/downgrading might yield some insights. Does battery status show correctly from the recovery UI?
Another (albeit riskier) option is to reflash the vulnerable bootloader.
Davey126 said:
Curious - which build of TWRP do you have installed? Obscure long shot but updgrading/downgrading might yield some insights. Does battery status show correctly from the recovery UI?
Click to expand...
Click to collapse
Thank you Davey for trying to help us.
I'm using TWRP 3.1.0.0. At the periods the indicator works in LineageOS it also works in TWRP and vice versa if not then both not.
I've also tried TWRP 3.0.2-2 which shows the same behaviour.
I've upgraded to the LOS 02. May release today. Maybe the indicator works better now. I will let you know.
In the Folder /sys/class/power_supply/
The bq27x41 is a link to the object:
Code:
/sys/devices/f9967000.i2c/i2c-0/0-0055/power_supply/bq27x41
This object and all it's sub objects are these
Code:
/power/autosuspend_delay_ms
/power/control
/power/runtime_active_time
/power/runtime_status
/power/runtime_suspended_time
capacity
charge_full
charge_full_design
charge_now
charge_now_design
current_now
device.lnk
energy_avg
health
manufacturer
status
subsystem.lnk
technology
temp
type
uevent
voltage_now
Davey126 said:
Curious - which build of TWRP do you have installed? Obscure long shot but updgrading/downgrading might yield some insights. Does battery status show correctly from the recovery UI?
Another (albeit riskier) option is to reflash the vulnerable bootloader.
Click to expand...
Click to collapse
The problem still the same in the LOS 14.1 May release. But overall performance getting better now only approx 25% of usage time of the device my battery indicator doesn't work.
What is the risk with flashing the vulnerable boot loader? Do I have to unlock it again?
Necronomynus said:
The problem still the same in the LOS 14.1 May release. But overall performance getting better now only approx 25% of usage time of the device my battery indicator doesn't work.
What is the risk with flashing the vulnerable boot loader? Do I have to unlock it again?
Click to expand...
Click to collapse
I find it interesting the battery indicator also does not work when booted into a custom recovery (TWRP) which operates independently from whatever lives in the system partition (eg: LinOS).
A refreshed bootloader would likely need to be unlocked; depends where keys are held (above my wage grade). Risks include potential result data loss and/or bricking the device should the flash goes bad; a twiddled bit can yield a very bad day at the office. I view the last two as unlikly but would be remiss in not mentioning the possibility.
@draxie - thoughts?
genie in the battery...
Davey126 said:
I find it interesting the battery indicator also does not work when booted into a custom recovery (TWRP)
which operates independently from whatever lives in the system partition (eg: LinOS).
Click to expand...
Click to collapse
Independent is a relative term in this case, I'd posit.
Based on my quick read of this thread, that battery
appears to enter some weird state from time to time,
gets stuck there for a while, only to get "unstuck" for
no obvious reason after some random period in limbo.
The only firm conclusion I could make is that neither
LineageOS nor TWRP have the chops to systematically
pull the battery out of limbo. In other words, when it's
stuck, it simply doesn't show up in either... (Now, why
LineageOS decides to show a missing battery as fully
charged is beyond me, but that's beside the point.)
To me, that implies a strong dependence in how each
'partition' will behave, since that appears to be fully
determined by the state of the battery.
The more interesting question is what triggers the limbo.
Based on the first few posts, I had the theory that Lineage
was clearly to blame (as I haven't found any mention of
the "good state" going bad while in TWRP), but then post#5
made me less sure, as it gave the impression that booting
into TWRP _when_everything_worked_ in Lineage caused
the battery to go missing again...
BTW, what I find *most* curious is that 'dumpsys battery'
output in post#4. If that was really generated from 'adb'
(as opposed to a terminal emulator on the device itself),
'USB powered: false' is decidedly not what I would expect.
Here's the output of the same command on my test Thor:
Code:
[B][email protected]:/ # dumpsys battery [/B]
Current Battery Service state:
AC powered: false
USB powered: true
Wireless powered: false
status: 2
health: 2
present: true
level: 87
scale: 100
voltage: 4175
current now: 606000
temperature: 256
technology: Li-ion
I attribute the fact that the fields are different to me running FireOS,
but it may also be indicative of different drivers/device definitions.
Also the discrepancy in the temperature readings (256 vs 358) may be
a cause for alarm (depending on the ambient temperature there at the
time; I don't have a thermometer, but I'd guess it's around 23-25C here).
Davey126 said:
A refreshed bootloader would likely need to be unlocked; depends where keys are held (above my wage grade). Risks include potential result data loss and/or bricking the device should the flash goes bad; a twiddled bit can yield a very bad day at the office. I view the last two as unlikly but would be remiss in not mentioning the possibility.
@draxie - thoughts?
Click to expand...
Click to collapse
If you mean flashing the very same vulnerable bootloader to the aboot
partition anew by a "refreshed bootloader", then you wouldn't need to
unlock again (i.e. the device "stays unlocked"), unless you flash another
version in between. On the other hand, I'm not quite sure what you
expect to gain from flashing a bit for bit identical image... (if it wasn't
the device wouldn't even boot; the bootloader is also signed).
Instead, I'd suggest to test running with FireOS for a few days (there's
no way to get closer to stock, if you can stand it) and see if the battery
still behaves erratically. If so, you should probably consider swapping it
(although, the root cause could easily be a _related_ HW component
and not the battery itself). I have a hard time seeing this as a pure SW
issue in LineageOS, since we should have seen plenty more reports (or,
at least, more meetoos on this thread). I've tested Lineage briefly on
this test Thor and haven't seen anything similar.
draxie said:
Instead, I'd suggest to test running with FireOS for a few days (there's
no way to get closer to stock, if you can stand it) and see if the battery
still behaves erratically. If so, you should probably consider swapping it
(although, the root cause could easily be a _related_ HW component
and not the battery itself). I have a hard time seeing this as a pure SW
issue in LineageOS, since we should have seen plenty more reports (or,
at least, more meetoos on this thread). I've tested Lineage briefly on
this test Thor and haven't seen anything similar.
Click to expand...
Click to collapse
Thank you draxie for you're precise analysis and help.
I'm still operating LinageOS. It's very stable now.
I don't know what sends the battery object to limbo but it seems like I found a solution to get it out there:
I've found out after the battery indicator stayed in limbo for approx. 10 days.
I've always used a USB-Charger with only 500mA through out this period.
But recently I have incidentally used another power source (Anker 28W Wall-Charger) with a original Kindle USB-Cable. After booting (because battery run totally empty before) it started with 5% battery indicator and its behaviour normal.
In the beginning (of this thread) I often changed chargers and cables (1 A Apple charger, USB-charging via Laptop, 2 A "China-noname" charger, 1.5 A Sony Charger) so it would explain the random behaviour.
So I have the theory it all depends on the charger and USB-cable to cause this issue with my device.
However I will try with the weak 500 mA charger if I can send the battery indicator to limbo with it. After this I hope I can confirm you that the strong charger and original cable can recover the battery indicator.
Necronomynus said:
Thank you draxie for you're precise analysis and help.
I'm still operating LinageOS. It's very stable now.
I don't know what sends the battery object to limbo but it seems like I found a solution to get it out there:
I've found out after the battery indicator stayed in limbo for approx. 10 days.
I've always used a USB-Charger with only 500mA through out this period.
But recently I have incidentally used another power source (Anker 28W Wall-Charger) with a original Kindle USB-Cable. After booting (because battery run totally empty before) it started with 5% battery indicator and its behaviour normal.
In the beginning (of this thread) I often changed chargers and cables (1 A Apple charger, USB-charging via Laptop, 2 A "China-noname" charger, 1.5 A Sony Charger) so it would explain the random behaviour.
So I have the theory it all depends on the charger and USB-cable to cause this issue with my device.
However I will try with the weak 500 mA charger if I can send the battery indicator to limbo with it. After this I hope I can confirm you that the strong charger and original cable can recover the battery indicator.
Click to expand...
Click to collapse
Thanks for the info!
Chargers having a short-term effect sounds plausible to me.
And, so does the propensity of aging batteries to act erratically.
I guess we could be looking at the combination of both....
How often do you need to charge your Kindle?
My 4-year-old Apollo is having trouble keeping up with my
usage patterns. Some days I have to charge twice.
And, the battery indicator does behave _somewhat_ odd,
when charge is around 10% (it can jump back up to 25%, when
going from idle to heavy use [why?!?], or it can drop dead
from 7%; but sometimes it's still ticking with 0% ).
Recently, it has also started to complain about the stock
charger that came with it as being "low power"...

How To Guide How to limit charging on Pixel 6

With credit to VR-25 from Github:
If you edit these files and put you own values in then your phone will start charging when it drops below 75% and stop when it gets to 80%. (put your own values in, etc.)
I have only tested it briefly but it seems to work for AC and USB charging for me so far. No other apps or tweaks needed.
/sys/devices/platform/google,charger/charge_start_level:75
/sys/devices/platform/google,charger/charge_stop_level:80
EDIT: You need to be rooted to do this, and you need to reapply the settings after reboot.
I have a Tasker action that does this automatically 5 minutes after rebooting.
If only there was a way to use that without root :-S
What would be the purpose for this.
I always charged to a 100% and never had issues on my devices.
I use the adaptive charging overnight and think that will help with battery life.
vandyman said:
What would be the purpose for this.
I always charged to a 100% and never had issues on my devices.
Click to expand...
Click to collapse
If you do some reading you will see that charging over 80% and draining under 20% will significantly shorten the lifespan of your battery. This is important for those of us that have devices not sold in our country so getting replacement batteries would be very difficult and expensive. I have phones that are more than 9 years old and still going fine if charged like this.
Galaxea said:
If you do some reading you will see that charging over 80% and draining under 20% will significantly shorten the lifespan of your battery. This is important for those of us that have devices not sold in our country so getting replacement batteries would be very difficult and expensive. I have phones that are more than 9 years old and still going fine if charged like this.
Click to expand...
Click to collapse
If you would have read the correct information on this subject. You would know that this not true for today's battery technology.
This is nothing but a myth.
You will have a better chance looking for Bigfoot.
Why waste 40% of your battery use....
vandyman said:
If you would have read the correct information on this subject. You would know that this not true for today's battery technology.
This is nothing but a myth.
You will have a better chance looking for Bigfoot.
Why waste 40% of your battery use....
Click to expand...
Click to collapse
On the contrary. The most recent phones attempt to limit the time that they spend at 100% exactly because it's so bad for battery longevity. Having options like the OP's approach just gives users more flexibility, should they want more control than, in this case, Google's adaptive/AI approach.
And it's not 'wasting' 40% of the battery. Keeping between 80% and 20% just optimizes battery service life during those days you only actually only need 60% of it's possible capacity. When working from home that's often the case for me. I actually tend to use ~30% of the battery in a day. Better to charge it up daily to about 70% than all the way to 100% and let it go down to 10% over 3 days. If it's easy to do, why not?
Not quite the same, but EV design also has their batteries normally operating in the middle range so as not to compromise their service life...
Definitely not myth. The only myth is that lithium cells exhibit a memory effect and need to be deep discharged and fully recharged periodically to maintain their capacity. It's actually bad for them to do this! The only reason to do this would be in an attempt to recalibrate the software for the battery level gauge (at the cost of a little damage to the battery each time you do that).
vandyman said:
What would be the purpose for this.
I always charged to a 100% and never had issues on my devices.
Click to expand...
Click to collapse
Most folk don't notice reduction in battery capacity until it becomes severe. For example, a friend claimed it wasn't a problem charging his iPhone to 100% ritually. When he checked the OS, it said his battery capacity was 80% of what it was when new. He said he hadn't noticed it affect how long the phone lasted.
If your usage is such that you can predict how much capacity you need, you can choose to charge to 100% only those times you will actually need that capacity. Other times you can look after the battery so it's able to actually give near on 100% for longer, those times it's important to you.
Others who keep their phones a short time or are comfortable with the cost & inconvenience of a battery replacement, or simply don't care, don't have to worry....
WibblyW said:
On the contrary. The most recent phones attempt to limit the time that they spend at 100% exactly because it's so bad for battery longevity. Having options like the OP's approach just gives users more flexibility, should they want more control than, in this case, Google's adaptive/AI approach.
And it's not 'wasting' 40% of the battery. Keeping between 80% and 20% just optimizes battery service life during those days you only actually only need 60% of it's possible capacity. When working from home that's often the case for me. I actually tend to use ~30% of the battery in a day. Better to charge it up daily to about 70% than all the way to 100% and let it go down to 10% over 3 days. If it's easy to do, why not?
Not quite the same, but EV design also has their batteries normally operating in the middle range so as not to compromise their service life...
Definitely not myth. The only myth is that lithium cells exhibit a memory effect and need to be deep discharged and fully recharged periodically to maintain their capacity. It's actually bad for them to do this! The only reason to do this would be in an attempt to recalibrate the software for the battery level gauge (at the cost of a little damage to the battery each time you do that).
Click to expand...
Click to collapse
This all maybe good if you are planning on keeping your device for a few years.
Most people buy a new device every other year. If not once a year.
... and if you really want to knacker the battery, heat it up too!
Worst case scenario - using a sat nav app on your phone in the car on a hot day with the phone plugged into a car adaptor. It's going to be sitting there at elevated temperatures, possibly with the sun shining on it, whilst being kept at 100% battery....
I'm only a customer (and have no other affiliation) and like to tinker, so I got one of these for use in the car to limit temperature when charging and limit max charge. Not cheap, but ok compared with the cost of the phone https://chargie.org/
I'm sorry, but at the snails pace this phone charges I'd be very surprised if charging it to 100% every night will make any noticeable difference in the long run. I had a Xiaomi Mi10 Ultra with 120W fast charger. That phone used to charge from 0% to full in like 20 minutes. Now that's one way to quickly kill your battery.
The Pixel uses your alarm to adaptively charge the battery so it should never overcharge it anyway. I'd much rather us all of my battery than use it only between 20 and 80% just for it to last a little longer.
The files are overwritten on reboot so I created a Tasker task to write the values on reboot each time.
Biggenz said:
I'm sorry, but at the snails pace this phone charges I'd be very surprised if charging it to 100% every night will make any noticeable difference in the long run.
Click to expand...
Click to collapse
On what basis? All the research and tests are based on charge level not charge rate. Fast charging potentially just makes it worse...
But at the end of the day it's your phone. You'll charge it in whatever way works for you.
I feel like this post sort of misses the point. It clearly is aimed at those intending to keep their phones >1yr, it is stated explicitly.
I'm not rooted right now, so I've been using the AccuBattery app. One of the things it does it gives a notification every few minutes when the battery is at 80% or above so that you can physically unplug the phone from the charger. Obviously having this done automatically would be better, but I've been surprised at how well the notifications have worked in my case. Plus, I can always leave the phone plugged in if I know I need a full battery for some reason (ie a long day away from any charging source).
Galaxea said:
With credit to VR-25 from Github:
If you edit these files and put you own values in then your phone will start charging when it drops below 75% and stop when it gets to 80%. (put your own values in, etc.)
I have only tested it briefly but it seems to work for AC and USB charging for me so far. No other apps or tweaks needed.
/sys/devices/platform/google,charger/charge_start_level:75
/sys/devices/platform/google,charger/charge_stop_level:80
Click to expand...
Click to collapse
Dumb question but what did you use to write values into those files? Did you use a text editor (with root access) or just termux or something? I tried with the built in MiX text editor but it seems to choke once I open up the file.
Gibsonflyingv said:
Dumb question but what did you use to write values into those files? Did you use a text editor (with root access) or just termux or something? I tried with the built in MiX text editor but it seems to choke once I open up the file.
Click to expand...
Click to collapse
I used FX File Explorer (root option). Look for the #. SYSTEM (Root).
I was wondering if changing the file permissions after writing to them to read-only would make the changes stick, but I am sure the OS could still overwrite them...??
I wonder if there's a similar variable to tweak at what temperature the phone considers the battery is too hot and stops charging?
Galaxea said:
With credit to VR-25 from Github:
If you edit these files and put you own values in then your phone will start charging when it drops below 75% and stop when it gets to 80%. (put your own values in, etc.)
I have only tested it briefly but it seems to work for AC and USB charging for me so far. No other apps or tweaks needed.
/sys/devices/platform/google,charger/charge_start_level:75
/sys/devices/platform/google,charger/charge_stop_level:80
Click to expand...
Click to collapse
Did a bit of testing and it works fine. A few things I noticed:
1. Doesn't survive reboot. Now that I've set up MiX with pinned folders, I can make the change in seconds. Need to sit down and read through the acc documentation because AccA doesn't work. Would love to have an automatic solution. Miss my old Battery Charge Limit.
2. charge_start doesn't seem to matter. After all, if charge_start is set to 75 and the phone is at 70%, it shouldn't charge. But it does. I've kept mine at 0.
3. Point #2 is kinda beside the point, though, because charge_stop will stop at the set value and stay there. No noticeable increase in temperature from what I can see. Definitely less than when charging.
4. Still shows as charging rapidly when it hits the level. Is it rapidly cycling charging on and off? Or in a kind of micro-current state? Or this may be a true battery idle situation where all power is drawn from the adapter. Ampere and AccA just show "not charging".
Edit: With a bit of use today, it does seem to act like a normal min/max charge deal, so I set it at 75 start/76 stop. Not sure what was happening at first...maybe something to do with the adaptive charging since I still have that on. Either, way, no complaints. With my use case working from home, I have it plugged in most of the day and it'll only take me about a minute to change charge_stop to 100 when I'm planning to go out all day somewhere away from chargers. Not ideal, but still a big improvement. Changes my rating of the thing from maybe 3.5 stars to 4.5.

Categories

Resources