Based on: https://forum.xda-developers.com/t/limit-charge.4355851/
All credits to @rickysidhu_
Attached a simple Magisk module to set the charging limit to 90% at boot time.
If you want to "undo", just remove the Magisk module and reboot.
foobar66 said:
Based on: https://forum.xda-developers.com/t/limit-charge.4355851/
All credits to @rickysidhu_
Attached a simple Magisk module to set the charging limit to 90% at boot time.
If you want to "undo", just remove the Magisk module and reboot.
Click to expand...
Click to collapse
I really appreciate you uploading this, man. However, not sure the masses realize that ACCA magisk module can not only do exactly this, but it also has a litany of far more features.
Not only that, but it can actually increase the charging speed slightly. Cool stuff.
Just flash the module, and then install the APK. Then going to settings and set the parameters/limit, or increased charging speed you want.
I can't seem to get this to work on my P6P.
I am running Magisk 23014
The module is installed and "on"
The Damon is running in the App and In settings only temperature control and automatically cycle through switches are selected.
But, it always charged to 100%
Any suggestions?
biTToe said:
I can't seem to get this to work on my P6P.
I am running Magisk 23014
The module is installed and "on"
The Damon is running in the App and In settings only temperature control and automatically cycle through switches are selected.
But, it always charged to 100%
Any suggestions?
Click to expand...
Click to collapse
I have the same experience.
I suspect we can use it but have to change something manually like setting what the control file is, based on the thread that's referenced in the OP:
rickysidhu_ said:
If anyone is wondering how to stop the Pixel from charging at a certain percentage, it's the following command:
Code:
echo 90 > /sys/devices/platform/google,charger/charge_stop_level
Replace 90 with whatever percentage you want to stop charging at!
Click to expand...
Click to collapse
biTToe said:
I can't seem to get this to work on my P6P.
I am running Magisk 23014
The module is installed and "on"
The Damon is running in the App and In settings only temperature control and automatically cycle through switches are selected.
But, it always charged to 100%
Any suggestions?
Click to expand...
Click to collapse
Until the correct switches are implemented in acc, you can make it work by using the current & voltage controls as the charging switch.
> Click on the gear icon for Custom settings
> Click the pencil icon next to Charging switch
> Change the value to 0 mA & Save
> Save the custom settings (save icon in the top right corner)
> Restart ACC daemon
craigacgomez said:
Until the correct switches are implemented in acc, you can make it work by using the current & voltage controls as the charging switch.
> Click on the gear icon for Custom settings
> Click the pencil icon next to Charging switch
> Change the value to 0 mA & Save
> Save the custom settings (save icon in the top right corner)
> Restart ACC daemon
Click to expand...
Click to collapse
Everything is good, until i restart the daemon. then the app crashes. When i restart the settings in charging switch have reverted to automatic.
... test charging switch hangs.
Have disabled pixel battery stuff.
Have force closed and deleted all data for app.
with no luck
biTToe said:
Everything is good, until i restart the daemon. then the app crashes. When i restart the settings in charging switch have reverted to automatic.
... test charging switch hangs.
Have disabled pixel battery stuff.
Have force closed and deleted all data for app.
with no luck
Click to expand...
Click to collapse
Yeah, I don't know why the "Test Charging Switch" hangs in the app. But I'm not sure why restarting the daemon causes the app to crash for you.. You can try to set the charging switch to 0mA, save and reboot
Question from a noob, but why would I want to have my battery at 90% instead of 100%? Does it have something to do with battery health?
batpoil said:
Question from a noob, but why would I want to have my battery at 90% instead of 100%? Does it have something to do with battery health?
Click to expand...
Click to collapse
Correct.
batpoil said:
Question from a noob, but why would I want to have my battery at 90% instead of 100%? Does it have something to do with battery health?
Click to expand...
Click to collapse
Yep. For the last five years, I never quick charge, I charge as soon as my phone gets to 25% and I try to only charge to 75%. That 50% take still lasts me about a day.
Good battery health is also a selling point when I sell my old phones on Swappa.
craigacgomez said:
Yeah, I don't know why the "Test Charging Switch" hangs in the app. But I'm not sure why restarting the daemon causes the app to crash for you.. You can try to set the charging switch to 0mA, save and reboot
Click to expand...
Click to collapse
I finally got it working after multiple uninstall/reinstall/reboot cycles...
Or at least I thought I did. I changed the AccA version from Developer to Master.
That seems to have stopped the crashes and everything seemed to be working correctly. I plugged it in at 75% charge when I went to bed, but when i woke-up this morning I was at 40% charge -Status indicated discharging.
After a few more app and phone reboots it began charging again and now seems to be working: charge to 80%, discharge to 70%...
One thing I did notice was, if I set my Superuser access to "ask every time" I am constantly asks to grant permission every 20-30 seconds.
If it continues to be an issue I will post the log files if you can tell me where they can be found.
biTToe said:
I finally got it working after multiple uninstall/reinstall/reboot cycles...
Or at least I thought I did. I changed the AccA version from Developer to Master.
That seems to have stopped the crashes and everything seemed to be working correctly. I plugged it in at 75% charge when I went to bed, but when i woke-up this morning I was at 40% charge -Status indicated discharging.
After a few more app and phone reboots it began charging again and now seems to be working: charge to 80%, discharge to 70%...
One thing I did notice was, if I set my Superuser access to "ask every time" I am constantly asks to grant permission every 20-30 seconds.
If it continues to be an issue I will post the log files if you can tell me where they can be found.
Click to expand...
Click to collapse
After some time, I realised that the current/voltage switch was not working reliably, especially if you switch between chargers with different capacitites.
But I did find a better way to make acc work on the Pixel 6 / Pro. It uses the same charging switch that the modules above uses, but it will work with the acc pause/resume charging.
I do not know how to set this up using the app becuase it actually uses a combination of two switches the charge_stop_level and charge_start_level.
What you need:
Root (Magisk)
acc magisk modules (AccA app installs this. Tested with acc v2021.11.3)
Terminal emulator app
Steps:
Connect the phone to a charger
Open the terminal emulator app
Elevate to root
Code:
$ su
Reset acc to default (to eleminate any potential conflicts with previous configs)
Code:
# acc -s r
Set your pause (pc) and resume (rc) charge levels
Code:
# acc -s pc=80 rc=70
Specify the control switch
Code:
# acc -s s="/sys/devices/platform/google,charger/charge_start_level 0 95 /sys/devices/platform/google,charger/charge_stop_level 95 5 --"
Validate the config. Check the values for resume_capacity, pause_capacity and charging_switch
Code:
# acc -s
Restart accd (acc daemon)
Code:
# accd
(Optional) Reboot
After that, you can tweak using AccA. Just leave the Charging switch & automatically cycle through switches" options untouched.
Further explanantion about the switch configuration
Code:
/sys/devices/platform/google,charger/charge_start_level 0 95 /sys/devices/platform/google,charger/charge_stop_level 95 5 --
- set charge_start_level to 0 when below the "resume capacity" so that the phone will charge
- set charge_start_level to 95 when at the "pause capacity" so that the phone will stop charging (effectively forces the phone to only start charging if the battery is 95%)
- set charge_stop_level to 95 when below the "resume capacity" so that the phone will charge
- set charge_stop_level to 5 when at the "pause capacity" so that the phone will stop charging (effectively forces the phone to only stop charging if the battery is 5%)
- the double hyphen at the end disables the "automatically cycle through switches" to guarantee that the specified switch is the only one that will be used.
It doesn't work for me neither way. Hmmm
Burt Squirtz said:
I really appreciate you uploading this, man. However, not sure the masses realize that ACCA magisk module can not only do exactly this, but it also has a litany of far more features.
Not only that, but it can actually increase the charging speed slightly. Cool stuff.
Just flash the module, and then install the APK. Then going to settings and set the parameters/limit, or increased charging speed you want.
Click to expand...
Click to collapse
Hiya. What's the best method to keep up with more recent AccA Magisk Module versions? Asking for a friend who doesn't compile stuff. Seriously, I see it on GitHub https://github.com/Magisk-Modules-Repo/acc and I see instructions for building and installing, but is there any easy way for us lazy folks who never compile? i.e. is there any easy way for us non-developers to get files such as "Advanced_Charging_Controller_(ACC)-v2021.11.3(202111030).zip" out of the GitHub entry? Thanks.
@foobar66
I've changed the prefix of this thread from "Development" to "Themes / Apps / Mods" as it didn't qualify for the first one. Please review the stuck guidances at the top of the forum and do not change the prefix back.
Regards
Oswald Boelcke
Senior Moderator
I have the latest ACCA from August and the Dec version of ACC which is installed under the latest Magisk and the December update. I am also running the Kirisa kernel.
My issue is that the settings for "Apply on plug" never stick. The capacity control settings seem to stick.
I made the edit to the default profile which seems to work.
Hey.
Is it possible to make this module work on every charge without reboot?
craigacgomez said:
After some time, I realised that the current/voltage switch was not working reliably, especially if you switch between chargers with different capacitites.
But I did find a better way to make acc work on the Pixel 6 / Pro. It uses the same charging switch that the modules above uses, but it will work with the acc pause/resume charging.
I do not know how to set this up using the app becuase it actually uses a combination of two switches the charge_stop_level and charge_start_level.
What you need:
Root (Magisk)
acc magisk modules (AccA app installs this. Tested with acc v2021.11.3)
Terminal emulator app
Steps:
Connect the phone to a charger
Open the terminal emulator app
Elevate to root
Code:
$ su
Reset acc to default (to eleminate any potential conflicts with previous configs)
Code:
# acc -s r
Set your pause (pc) and resume (rc) charge levels
Code:
# acc -s pc=80 rc=70
Specify the control switch
Code:
# acc -s s="/sys/devices/platform/google,charger/charge_start_level 0 95 /sys/devices/platform/google,charger/charge_stop_level 95 5 --"
Validate the config. Check the values for resume_capacity, pause_capacity and charging_switch
Code:
# acc -s
Restart accd (acc daemon)
Code:
# accd
(Optional) Reboot
After that, you can tweak using AccA. Just leave the Charging switch & automatically cycle through switches" options untouched.
Further explanantion about the switch configuration
Code:
/sys/devices/platform/google,charger/charge_start_level 0 95 /sys/devices/platform/google,charger/charge_stop_level 95 5 --
- set charge_start_level to 0 when below the "resume capacity" so that the phone will charge
- set charge_start_level to 95 when at the "pause capacity" so that the phone will stop charging (effectively forces the phone to only start charging if the battery is 95%)
- set charge_stop_level to 95 when below the "resume capacity" so that the phone will charge
- set charge_stop_level to 5 when at the "pause capacity" so that the phone will stop charging (effectively forces the phone to only stop charging if the battery is 5%)
- the double hyphen at the end disables the "automatically cycle through switches" to guarantee that the specified switch is the only one that will be used.
Click to expand...
Click to collapse
hi! I'm quite new to ACC(A) and was wondering how to better keep my phone's battery healthy. I was wondering about battery idle mode and saw that Roll3r found a working battery idle mode for use with Kirisakura kernel which I'm on. However, I'm just a noob with all the terminal things and don't know how to implement it myself. it's this one:
Just an FYI (because others have asked), the only ACC (Advanced Charging Controller) charging switch with working battery idle mode is:
gcpm/constant_charge_current_max 1866420 0
Several other switches tested as supported idle, but they'd all crash ACC when idle priority is enabled. You may have to add it manually.
Edit: I shouldn't say "only" - this is the only switch (supported by this kernel) that I found get the phone to idle with. There might be others out there, too.
Click to expand...
Click to collapse
was wondering if you could list the terminal commands for this and what options am I not to touch afterwards (since in your example, which I have been using, you said not to touch the cycling option anymore)
As someone who doesn't like touching command lines/terminals, I just did these commands following craigacgomez and hoped for the best, but this time using Roll3r's switch that they found that allowed battery idle mode
su
acc -s r
acc -s pc=80 rc=70
acc -s s="gcpm/constant_charge_current_max 1866420 0 --"
accd
edit: ironically, idk how you add this switch using ACCA itself because entering the switch then the start and stop values just kicks me back to the previous dialogue, the one that says if I should choose auto or add a switch
craigacgomez's switch ( "/sys/devices/platform/google,charger/charge_start_level 0 95 /sys/devices/platform/google,charger/charge_stop_level 95 5 --" ) oddly stops charging when I enable the cooldown cycle feature on ACCA. So if I set the cooldown cycle to start at 45%, my phone stops charging at 45%.
I'm testing Roll3r's switch ( "gcpm/constant_charge_current_max 1866420 0 --" ) now, which passed the battery idle mode test. I've stayed on 80% since reaching it and ACCA reports a -10 current every so often so definitely staying on that battery idle mode. I also have the cooldown feature enabled, also set to 45% and it was working well with no premature paused charging / battery idling.
Quick question, if it says charging speed goes from -10 to +10, does that already signify battery idle mode? That's what happens to either switch so I'm assuming it is since I know my phone would have dropped in battery by now
Delete
Related
Untested on the Q Beta!
For information about the way the mod functions read this.
This mod is possibly dangerous given its nature of modifying the safeguards built into your phone by Google. I am not responsible for your actions using this mod. This mod is meant only for Pixel 3 and 3 XL devices, I would recommend against trying this on other devices.
All that being said I use this mod daily and decided to share. Attached is a ".flo" file used by the app "Automate," link to download from play store, to import the flowchart for the mod. The reason I used automate instead of the typical Advanced Charging Control Magisk module is due to the module having much more functionality that I didn't need or want. Examples include weird charging behavior with USB-PD chargers and overall charging instability. This also allows the mod to be disabled by booting in safe mode.
Details about the mod:
This mod may stop working after any android update
This mod seems to even allow non "fast charge" wireless chargers to be faster
This mod allows a max of 9v to be accepted through wireless charging instead of stock 5v without Google Certification.
This mod reverts whenever the phone stops charging (this is the part that this Automate Flow automates)
Details about the Flow:
This Flow requires 2 apps (Automate and Automate superuser permissions plugin) be installed from Google Play Store
This Flow requires superuser permission on the device (Magisk recommended)
This Flow does NOT modify /system
The file that is modified by the Flow is reset upon unplugging/lifting off a wireless charger so uninstalling Automate will undo the mod completely
The Flow runs like this:
Wait for wireless charging state to change
If wireless charging connected: run shell command then Go to 1
If wireless charging disconnected: Go to 1
So if the phone is not charging or cable charging there isn't an endless loop running.
Instructions:
Download and extract the .flo file
Download Automate app if you have not already
Open Automate app and go through its first time setup
Use the 3 dots menu in the top right to select "import"
Navigate to where you extracted the .flo file and select it
Select the new Flow that just appeared
Under Privileges check the checkbox "full (superuser) access..."
Google play store will prompt you to download the superuser permission app for automate
Grant superuser to automate
Press Start, you'll get a persistent notification about the flow running
OPTIONAL: Go back to Automate app's settings and check the "run on system startup" to enable the mod on boot
You can verify success based on the log in Automate or by observing the charging text on the lockscreen/ambient display. If it says "charging slowly" then the mod failed if it says "charging" then the mod succeeded. You can also check in apps such as Ampere, the charging current pre-mod for me was always <600ma and up to 1200ma after. Note after ~70% charge the Pixel 3(xl) seem to slow charging speed so have a <50% battery for a good comparison.
To uninstall the mod just uninstall Automate or open the Flow and then in the 3 dots menu press delete.
EDIT: Now available in Tasker flavor for those of you who use Tasker and don't want a second automation app running on your phone. Just open the .XML file and select open with in the top right and then Tasker on the pop-up.
@StykerB
Thanks for your work, but i use the App "Automagic" https://play.google.com/store/apps/details?id=ch.gridvision.ppam.androidautomagic
Attached is the flow for Automagic. Need also Root permissions.
Procedure:
1. wireless power connected
2. send command
I just installed this on my Pixel 3 XL and will try it out with my Choetech wireless car charger. Typically I was seeing < 500maH of current with this stock charger. I hope to see over 1A with this patch.
Thanks,
So we have finally found away around the google certified fast chargers?
Works great for me, Thanks.
Would be great to get the assistant features of the pixel stand working too.
I got 850mA when using this MOD and a Choetech wireless charger. Now I can top off my battery while streaming audio and running waze. Previously, I can only stay flat on my batter charge.
Well done!
I used the Automagic version. Worked good. Was seeing 500mA before then it bumped it up to 850mA - 1A range.
Thank you for this
Other Apps Charge money
Has anyone had an issue where it start charging and the 2 seconds later it stops and then starts again and keeps repeating?
Cozzeck said:
Has anyone had an issue where it start charging and the 2 seconds later it stops and then starts again and keeps repeating?
Click to expand...
Click to collapse
I've noticed this behavior with one of my old nokia wireless chargers or if i have a charging speed reading app open while the battery is >70% (when the battery management locks charging speed to 7.5w or less). But for me it seems to either go away after a minute or two or re-situating the phone on the charger.
Works great with my Samsung fast wireless charger! Goes from 600 ma to 1000+
Sent from my Pixel 3 XL using Tapatalk
Get this error using tasker. Any ideas? On April update. Was working previously.
01.07.14/E Run Shell: ->
01.07.14/E Run Shell: ->
01.07.14/E Run Shell: ->
01.07.14/Shell runBackground echo 9000000 > /sys/class/power_supply/wireless/voltage_max root: true timeout: -1
01.07.14/Shell start process-thread ID 263
01.07.14/E add wait type Shell1 time 2147483647
01.07.14/E add wait type Shell1 done
01.07.14/E add wait task
01.07.14/E Error: 1
PLEASE IGNORE THIS POST. I GOT MY ANSWER. SORRY.
Hm I'm trying to understand the exact shell command that is sent as I use Macrodroid.
What is the exact command I should use?
Also does this method still work on Android 10?
DISCLAIMER: I'm not responsible if your battery or phone ever borked due to you used the commands in this post!
Just found out that there's "parameter" in /sys for limiting battery charging behavior, which probably works just like "battery charge limit"
Obviously this requires root, if you have no idea what is this for and why, read this first
As I'm no pro here, I'm just sharing what I found out, and the method may not be 100% reliable as ACC (the Magisk module, which currently somehow doesn't want to work on my 4a 5G)
Note that the following commands may not work due to you're running different kernel
To make your phone stop charging after reaching 80%, run the following command:
# echo 80 > /sys/devices/platform/soc/soc:google,charger/charge_stop_level
You can use cat against /sys/devices/platform/soc/soc:google,charger/charge_disable to check if your phone had stopped charging.
There's charge_start_level as well, I guess that the phone will start charging again after your battery level drops to the level that this "parameter" specifies, but I don't really leave my phone plugged in that long so I'll leave that for you guys to test it.
PS. I don't know why but this method may only work once for one boot, in other words, you need to reboot the phone for this method to be effective when you charge again. Edit: it worked more than once for me now.
Many thanks. The battery on this phone is amazing. I would like it to last as long as possible.
Since it's been a few months since this phone is out; are there apps that can do this yet? I run CalyxOS and can't root. This feature is #1 on my wishlist for a CalyxOS update.
Thsi can be done with ACCA Magisk Module and there is even an app for it called AccA on github. You can set different profiles with the app.
AccA only works on the 4a 5G when using a custom kernel such as protonkernel or elementalx. The stock kernel doesn't have the right switches.
Confirmed working on Android 12PB2 thank you so much the AccA app is not working on my pixel 5 either appreciate your brain
On Pixel 4a 5g control file that works for me is sm7250_bms/charge disable and Automatically cycle through switches is ON. I've installed ACC through Termux from downloaded github zip, thren I've installed AccA from F-droid and disabled ACC module in Magisk. And it works, it stops charging, in my case, at 85 % .
Maybe it's worth to mention that I'm on LineageOS for microG 18.1, Proton kernel 1.4, Magisk rooted.
It is at different pass in my Pixel6a, but it works! (Android13 2022/11/5 updated)
echo 80 > /sys/devices/platform/google,charger/charge_stop_level
Thanks a lot!
There's actually just a parameter that needs to be enabled under vendor/etc/perf section.... I forget which one of the XML files it's in, but you'll see something along the lines of "support idle xxxxxx" I can't look at the moment but it's fairly obvious when you do see it. If I get some free time I'll dig back through there and find it
As the title says, is there any app or Magisk module that can automatically shutdown your device according to battery percentage?
ahhh we have almost the same issue but my issue is whenever my battery percentage reach 20% wifi get disconnected i need to to setting and wifi and click scan again for it to get reconnected i think it is some sort of battery saver
i hate it whenever i'm playing it disconnect me
Actually, I'm not asking about an issue.
I'm asking if anyone knows of an app or module for Magisk that can shutdown the device accordingly to battery percentage.
I'd really like to set my phone to shutdown when the battery hits 15%.
Nemix77 said:
Actually, I'm not asking about an issue.
I'm asking if anyone knows of an app or module for Magisk that can shutdown the device accordingly to battery percentage.
I'd really like to set my phone to shutdown when the battery hits 15%.
Click to expand...
Click to collapse
Macrodroid can (with root). It's like a simpler tasker app. I'll pm you my telegram link, i can send you a quick video if you like...?
Nemix77 said:
Actually, I'm not asking about an issue.
I'm asking if anyone knows of an app or module for Magisk that can shutdown the device accordingly to battery percentage.
I'd really like to set my phone to shutdown when the battery hits 15%.
Click to expand...
Click to collapse
ohh you don't have my issue?
reg66 said:
Macrodroid can (with root). It's like a simpler tasker app. I'll pm you my telegram link, i can send you a quick video if you like...?
Click to expand...
Click to collapse
I do at 20% although 30% or higher be better.
After 20% there's a lot less usable power available and charging from that low is more stressful on a Li especially if fast charging.
I'll do 20% shutdown and 90% battery charging stop.
That's 70% usable power, I can't do anything better than that.
Nemix77 said:
I'll do 20% shutdown and 90% battery charging stop.
That's 70% usable power, I can't do anything better than that.
Click to expand...
Click to collapse
I generally do 40 - 70% or so. On my device it's 3 hrs on SOT and take 15 minutes to fast charge.
Li's like frequent midrange power cycling; use it if it fits your needs.
Nemix77 said:
As the title says, is there any app or Magisk module that can automatically shutdown your device according to battery percentage?
Click to expand...
Click to collapse
Magisk module : Advanced Charging Controller (acc)
https://forum.xda-developers.com/t/advanced-charging-controller-acc.3668427/
It has features as:
Shutdown at set percentage, eg. 20%
Stop charging when reach a percentage, eg. 75%
Cool down charging, so the device and battery won't be very hot using temperature detect on battery.
Charging voltage/current limitation.
Charge cool down as set, eg. 50 seconds charge and 10 seconds cool down without charging, then repeat.
Read the README in github.
ACC app has some issues. Module is working better and updated.
The module will need you to manually edit the settings profile, and you need to use command line.
If you just want to stop charging at certain percentage, Battery Charge Limit is enough.
On F-droid
https://f-droid.org/en/packages/com.slash.batterychargelimit/
Play store
https://play.google.com/store/apps/details?id=com.slash.batterychargelimit&hl=en&gl=US
Both need root.
I use Battery Charge Limit already on my Mi Pad 4.
Advanced Charging Controller seems to have a lot more features.
I haven't been able to get ACC with ACCA (GUI) or Battery Charge Limit to work on the Poco F3 with Xiaomi.EU rom and root.
None of the control files work on both apps.
AccA is faulty.
Use the Magisk module.
You might want to ask cutsom ROM developers because they had managed to get smart charge working, so there's definitely control file that works.
I got Acc with AccA working!
I was testing the charging switches without plugging in the charger, my bads...
Some how Battery Charge Limit does not work, it's a simpler app and I used it with my Mi Pad 4 so I thought it would just work with the Poco F3.
Nemix77 said:
I got Acc with AccA working!
I was testing the charging switches without plugging in the charger, my bads...
Some how Battery Charge Limit does not work, it's a simpler app and I used it with my Mi Pad 4 so I thought it would just work with the Poco F3.
Click to expand...
Click to collapse
Check ACC control config what control file your phone uses, then see in Battery Charge Limit if you can select that control file manually.
I think it can also manually write the control file, but not quite sure.
pl1992aw said:
Check ACC control config what control file your phone uses, then see in Battery Charge Limit if you can select that control file manually.
I think it can also manually write the control file, but not quite sure.
Click to expand...
Click to collapse
Yeah I figured that, but since I have Acc with AccA working there's really no need to go back to Battery Charge Limit.
Nemix77 said:
Yeah I figured that, but since I have Acc with AccA working there's realy not need to go back to Battery Charge Limit.
Click to expand...
Click to collapse
Just to clear the things that you've already said
You mean ACC with AccA is working properly? If not, is there any problems with using ACC with AccA app?
I used ACC with AccA app before on my raphael times with EvoX Custom ROM, works well and haven't encountered any problems with using with ACC via AccA App
After some readings on: https://forum.xda-developers.com/t/limit-charge.4355851/
and https://forum.xda-developers.com/t/mod-magisk-root-set-charging-limit-to-90.4363477/
( Credits to @rickysidhu_ and @foobar66 )
There is a thing I found and tested:
"charge_stop_level" must be used together with "charge_start_level"
Spoiler: Details
If set start @40 / stop @60, the phone will begin charging when (and only when) the battery drops to 40%, and stops charging @ 60%.
(it defines a range, and the first time the user hit the range boundary activates this range function)
If set stop @90 without setting a start, the phone will refuse the 2nd time charging until the battery drops to default 0 (or the battery service/phone has been restarted)
(This explained many "phone not charging" reports in the above links posts)
I like @foobar66's magisk mod solution. It is simple and safe.
It has only 1 line of working script in the zip.
So I "clone" it with some different values (added the fix, so 2 lines of script code in each zip now, that's all it does)
These are for the lazy people who don't want to deal with advanced settings, and who want a 10-second trouble-free simple solution for battery health.
The 4 clones:
P6n_charginglimit_95.zip (charging limit to 95%, it should give you an extra ~30% battery life span in lab-tested theory)
P6n_charginglimit_90.zip (charging to 90%, an extra ~60% battery life span)
P6n_charginglimit_85.zip (charging to 85%, double the battery life span, recommended for joe and johns)
P6n_charginglimit_80.zip (charging to 80%, should give more than double the battery life span)
Those numbers are the best estimates from other battery research papers, no guarantee.
To install, pick the one you want and flash it in Magisk.
To uninstall, simply disable or remove it in Magisk.
A12.1 tested. It should work on A13.
Edit: A13 is also confirmed working.
Reply problems if you find any.
I use advanced charging controller, I stop charging at 81% and I can regulate voltage as well. Temperature triggers etc it's great.
How does it increase battery life by 30%?
Or you mean battery health ?
I use ACC plus Tasker to keep the battery entering idle mode at around 50% while plugged. I got my pixel 6 last November, now the battery gets 82 cycles so far.
ChongoDroid said:
I use advanced charging controller, I stop charging at 81% and I can regulate voltage as well. Temperature triggers etc it's great.
Click to expand...
Click to collapse
bush911 said:
I use ACC plus Tasker to keep the battery entering idle mode at around 50% while plugged. I got my pixel 6 last November, now the battery gets 82 cycles so far.
Click to expand...
Click to collapse
The thing is, ACC monitors/controls too many components in the system that I don't fully get, and I am not sure if it conflicts with built-in "smart charging" or other circuit controllers or not, and have to combine a Magisk backend module and a root-access frontend APP to make it work with so many details settings to setup....... It is just......too heavy?
(or I am too old to tinkering those things.....my sad middle-age life)
These .zips are the "10-second solution" for lazy folks.
It does only 1 thing, It is transparent and super snappy (only 2 lines of script, no binary), and it can hardly go wrong.....it just works.
Paz9 said:
How does it increase battery life by 30%?
Or you mean battery health ?
Click to expand...
Click to collapse
You are right Shakespeare, "life span" to be precise, sorry for my English ahahahah.
bush911 said:
I use ACC plus Tasker to keep the battery entering idle mode at around 50% while plugged. I got my pixel 6 last November, now the battery gets 82 cycles so far.
Click to expand...
Click to collapse
Would you like to share how (ACC + Tasker. Tasker project, everything)?
Thanks
E!ad said:
Would you like to share how (ACC + Tasker. Tasker project, everything)?
Thanks
Click to expand...
Click to collapse
Yes, this might be device dependent. It is better to choose and set proper charging switch which supports battery idle mode.
Latest AcC module must be flashed
kylechen said:
The thing is, ACC monitors/controls too many components in the system that I don't fully get, and I am not sure if it conflicts with built-in "smart charging" or other circuit controllers or not, and have to combine a Magisk backend module and a root-access frontend APP to make it work with so many details settings to setup....... It is just......too heavy?
(or I am too old to tinkering those things.....my sad middle-age life)
These .zips are the "10-second solution" for lazy folks.
It does only 1 thing, It is transparent and super snappy (only 2 lines of script, no binary), and it can hardly go wrong.....it just works.
You are right Shakespeare, "life span" to be precise, sorry for my English ahahahah.
Click to expand...
Click to collapse
It doesn't interfere with the built in stuff and you don't need magisk module anymore. It takes 20.9mb on system so it's not heavy, I also like being able to adjust on the fly (have it set to 70% for long home use and 85% for out and about)
ChongoDroid said:
It doesn't interfere with the built in stuff and you don't need magisk module anymore. It takes 20.9mb on system so it's not heavy, I also like being able to adjust on the fly (have it set to 70% for long home use and 85% for out and about)
Click to expand...
Click to collapse
Are you referring to the Tasker implementation or ACC?
Zilla0617 said:
Are you referring to the Tasker implementation or ACC?
Click to expand...
Click to collapse
Acc
Yay finally a solution that works. Pixel 6 here, A13 Stock
Thanks.
ChongoDroid said:
Acc
Click to expand...
Click to collapse
Could you share your config file? What phone and is are you using? Thanks
Zilla0617 said:
Could you share your config file? What phone and is are you using? Thanks
Click to expand...
Click to collapse
Pixel 6 pro stop charging at 82 and start at 76 that's all I used
ChongoDroid said:
Pixel 6 pro stop charging at 82 and start at 76 that's all I used
Click to expand...
Click to collapse
So when I setup acc stopping at 80% on Android 13 and its place on pixel stand 2, the charging oscillates on/off. It would charge for few minutes then stop and charge for few mins and stop. Are you experiencing this? This behavior did not occur with Android 12
Zilla0617 said:
So when I setup acc stopping at 80% on Android 13 and its place on pixel stand 2, the charging oscillates on/off. It would charge for few minutes then stop and charge for few mins and stop. Are you experiencing this? This behavior did not occur with Android 12
Click to expand...
Click to collapse
Oh weird I get the osculation on car charger but it was always random. It won't even charge on 13.
Change the switch to 0 should have it working I don't know if that causes the switch enough
ChongoDroid said:
Oh weird I get the osculation on car charger but it was always random. It won't even charge on 13.
Change the switch to 0 should have it working I don't know if that causes the switch enough
Click to expand...
Click to collapse
Hmmm I don't use the front end app. Maybe I should try it and see if the behavior changes. Which version of the app are you using?
Zilla0617 said:
Hmmm I don't use the front end app. Maybe I should try it and see if the behavior changes. Which version of the app are you using?
Click to expand...
Click to collapse
1.0.35
kylechen said:
The thing is, ACC monitors/controls too many components in the system that I don't fully get, and I am not sure if it conflicts with built-in "smart charging" or other circuit controllers or not, and have to combine a Magisk backend module and a root-access frontend APP to make it work with so many details settings to setup....... It is just......too heavy?
(or I am too old to tinkering those things.....my sad middle-age life)
These .zips are the "10-second solution" for lazy folks.
It does only 1 thing, It is transparent and super snappy (only 2 lines of script, no binary), and it can hardly go wrong.....it just works.
You are right Shakespeare, "life span" to be precise, sorry for my English ahahahah.
Click to expand...
Click to collapse
I strongly agree, just not worth having to deal with acc, getting idle mode to work, debugging, getting it to work again and hoping it still works. If I get the time to do so might write a module that integrates a slider in settings or as a quick setting to set to what percentage it should charge and executing those lines of code with that percentage.
kylechen said:
P6n_charginglimit_80.zip (charging to 80%, should give more than double the battery life span)
Click to expand...
Click to collapse
I peeked inside this one (as it's the one I'm successfully using), and noticed the following:
echo 79 > /sys/devices/platform/google,charger/charge_start_level
echo 80 > /sys/devices/platform/google,charger/charge_stop_level
Click to expand...
Click to collapse
I get the "80" for the charge_stop_level, but I don't understand why "79" is the charge_start_level value? (But I'm new at this, so..forgive my ignorance.)
Hello,
I was looking for a way to use Battery charg limit on my pixel 6 Pro, using a pixel stand 2. (because I'm using it a lot)
So when A13 came out, I rooted the phone, and started my research.
I found a message in a thread that specified a way to do what I want.
[APP][ROOT][4.0+]Battery Charge Limit v1.1.1
jazic said:
I finally found the ability to 'pause' charging on the Pixel 5, 6 and maybe 6 Pro?
This work only with wireless charging but I'm sure the /dc/ folder for wired.
I use tasker to control the file:
/sys/class/power_supply/wireless/current_max
I did figure out how to have it always have the file set to rw with the profile itself by using "run shell" and enabling root:
chmod 0777 /sys/class/power_supply/wireless/current_max
Obviously you can set up a profile to control it with tasker but personally I have mine set to start charging full speed when the battery is 0 to 65% then start trickle charging half speed until it reaches 72%. Once it reaches 72% you can set the current level really low and it'll basically keep the charger cycling on and off at a very low input voltage so the battery will hang at whatever you set it at without dropping then charging back up all the time which imo is better than cycling power off at a certain level then charging back up.
I'm still experimenting with current levels but if you set it to higher than your charger can handle then it will just simply charge at max speed of your charger.
For trickle half speed charge I use: "500000" (500mA?)
For full speed charging I use: "2200000" (2200mA?)
For Battery Charge Limit I'm sure you can set the file to:
/sys/class/power_supply/wireless/current_max
Enable: 5000000
Disable: 1000
You will need to set the file as writeable maybe?
Any questions hit me up. Maybe it's another source to look for other phones.
Click to expand...
Click to collapse
I was thinking it all worked but in fact not...
For me now, wireless charging is very buggy.
Using Amper, i'm often in "not charging" or I'm charging at 4V and max 600mA.
I don't know if it's my fault or if it's related to the bug with the Pixel 6 wireless charging issue ?
Also, can someone give me the default value of this file "/sys/class/power_supply/wireless/current_max" mine is now set at 250000, to double check.
Thank you !
I found a solution on reddit !
Going to App > See all apps + show system apps > Search "pixel stand" > clear cache + clear storage
This fixed my issue so I guess it was A13 and not BCL.
Hops it cals help someone.
That's awesome! Thanks for letting us know.