Search This thread

VR25

Senior Member
Apr 20, 2013
1,978
4,821
github.com
@VR25 Unfortunately, this version of the script does not work on my phone either. I continue to stay on version 2021.9.5 as the latest working version. I do not want to be annoying, but I would like to see the functionality that worked before in the latest versions of the script. acc -t still lasts indefinitely due to the constant mode of discharging the phone.
Not being annoying at all. I want acc to run on as many devices as possible. Since things are not perfect in the real world, some weirdness still applies. While it's now working on more systems, it stopped working on some (a rather fun mouse catching game).

Try with acc -s bsw=false.
 

habloid

Member
Aug 3, 2017
22
15
Try with acc -s bsw=false.
@VR25 No visible changes. I look forward to future builds.
Code:
s3_h560:/data/data/com.termux/files/home # acc -s bsw=false


s3_h560:/data/data/com.termux/files/home # acc -t

This may take a while... ⏳
Ensure the charger is plugged 🔌
  switch:on status:Discharging curr:660000,17000
  switch:on status:Discharging curr:660000,17000
Ensure the charger is plugged 🔌
Press CTRL-C to quit
  switch:on status:Discharging curr:660000,17000
  switch:on status:Discharging curr:660000,17000
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,35000
  switch:on status:Discharging curr:660000,35000
  switch:on status:Discharging curr:660000,35000
  switch:on status:Discharging curr:660000,35000
  switch:on status:Discharging curr:660000,35000
  switch:on status:Discharging curr:660000,35000
  switch:on status:Discharging curr:660000,35000
  switch:on status:Discharging curr:660000,35000
  switch:on status:Discharging curr:660000,35000
  switch:on status:Discharging curr:660000,35000
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
  switch:on status:Discharging curr:660000,0
 
Last edited:
  • Like
Reactions: duttyend

Spaceoid

Senior Member
Mar 29, 2013
349
121
Dortmund
Sometimes, extremely rarely, my phone screen will just switch on during charging. Might this be due to a faulty hardware connection or does it have to do with ACC?
I am kinda sure it has nothing to do with cooldown, because last time it happened this morning, the phone was at 58% and cooldown only starts at 60.
No issue in it's core though, I am just asking out of interest.

Edit: I also pulled some logs from the ACC menu, maybe they are of any help. I myself had trouble understanding them.
Edit2: Happened twice today already, one time a few mins after plugging in the charger. Charging stops for a sec, phone thinks it got unplugged, then charging continues again. Might also be that my phone just needs a reboot or sth.
 

Attachments

  • acc-logs-OnePlus6.tgz
    40.9 KB · Views: 6
Last edited:
  • Like
Reactions: duttyend

scottlam1

Senior Member
Aug 16, 2011
146
36
Is there a setting in acca or a command for acc that allows you to keep otg on. When I plug in my hub for SD or ext hdd with acc enabled it kills the connections.
 

SpeedOxide

New member
Jul 9, 2022
1
0
Hi !

I have just registered on XDA to thanks you @VR25 !

It's been a while I look for an app like this.

It's work very well if I plug the charger, but it doesn't work if I use my wireless charger.

My phone: Xiaomi Mi 9

Thank you very much for your work !
 

Soul drinker

New member
Jul 14, 2022
2
0
Hey i am using rooted redmi note 10 pro and ASOP based rom Project elixir(v1. 9). I had installed latest firmware for my region. But i am not getting fast charging on my device which used to be 33W now its capping @12w max! I tried out battery calibration but still it's not working. Can i use this app or magisk module to get back the phones fast charging.
Kernel: latest vantom
Os: 12L
 

VR25

Senior Member
Apr 20, 2013
1,978
4,821
github.com
Sometimes, extremely rarely, my phone screen will just switch on during charging. Might this be due to a faulty hardware connection or does it have to do with ACC?
I am kinda sure it has nothing to do with cooldown, because last time it happened this morning, the phone was at 58% and cooldown only starts at 60.
No issue in it's core though, I am just asking out of interest.

Edit: I also pulled some logs from the ACC menu, maybe they are of any help. I myself had trouble understanding them.
Edit2: Happened twice today already, one time a few mins after plugging in the charger. Charging stops for a sec, phone thinks it got unplugged, then charging continues again. Might also be that my phone just needs a reboot or sth.
Did you try the latest (7.10) pre-release?
@habloid
 

VR25

Senior Member
Apr 20, 2013
1,978
4,821
github.com
Hey i am using rooted redmi note 10 pro and ASOP based rom Project elixir(v1. 9). I had installed latest firmware for my region. But i am not getting fast charging on my device which used to be 33W now its capping @12w max! I tried out battery calibration but still it's not working. Can i use this app or magisk module to get back the phones fast charging.
Kernel: latest vantom
Os: 12L
This could be related to buggy thermal management.

The following script creates and installs a Magisk module that disables all userspace thermal control programs. If a bootloop happens, the module disables itself. Still, use at your own risk. Paste and run on terminal (as root) to install. Reboot afterwards.

Code:
(dir=/data/adb/modules/vr25.fry/system
rm -rf ${dir%/*} 2>/dev/null
mkdir -p $dir
for i in $(pgrep -fl thermal | cut -d ' ' -f 2 | grep -v qti); do
  j=$i
  i=$dir${i#/system}i
  mkdir -p ${i%/*}
  touch $i
  magisk --clone-attr $j $i
done
echo '#!/system/bin/sh
(touch ${0%/*}/disable
while [ .$(getprop sys.boot_completed) != .1 ] && [ ! -d /sdcard/Android ]; do
  sleep 5
done
sleep 60
rm ${0%/*}/disable $0
exit &) &' > ${dir%/*}/post-fs-data.sh)
 

Spaceoid

Senior Member
Mar 29, 2013
349
121
Dortmund
Did you try the latest (7.10) pre-release?
@habloid
I installed the pre-release now and will report.

One thing I noticed though is that my charging cooldown cycle seems to be buggy with the pre-release again. The charging part of the cycle never takes longer than a few secs, while it is set for 50 seconds.
 

Attachments

  • acc-logs-OnePlus6.tgz
    41.5 KB · Views: 5

VR25

Senior Member
Apr 20, 2013
1,978
4,821
github.com
**v2022.7.19-dev (202207190)**
* Bump version
* 423fadb Misc charging control fixes and optimizations
* d74a647 Systemlessly disable mi_thermald
* deb4736 Add support for cooldown_charge=0 (to be used with cooldown_current)
* 6286223 Update documentation
* ded8b86 Rewrite script scheduler
* 950709b Update BATT_HEATH calculator
* e778686 Goodbye loopCmd (replaced by one-line scripts)
* e5110f4 Improve force_off

This can be installed by acc -u dev (-f is not needed).

AccSettings fix:
Code:
echo "echo loop_cmd=" >> /data/adb/modules/acc/print-config.sh
 
Last edited:

Soul drinker

New member
Jul 14, 2022
2
0
This could be related to buggy thermal management.

The following script creates and installs a Magisk module that disables all userspace thermal control programs. If a bootloop happens, the module disables itself. Still, use at your own risk. Paste and run on terminal (as root) to install. Reboot afterwards.

Code:
(dir=/data/adb/modules/vr25.fry/system
rm -rf ${dir%/*} 2>/dev/null
mkdir -p $dir
for i in $(pgrep -fl thermal | cut -d ' ' -f 2 | grep -v qti); do
  j=$i
  i=$dir${i#/system}i
  mkdir -p ${i%/*}
  touch $i
  magisk --clone-attr $j $i
done
echo '#!/system/bin/sh
(touch ${0%/*}/disable
while [ .$(getprop sys.boot_completed) != .1 ] && [ ! -d /sdcard/Android ]; do
  sleep 5
done
sleep 60
rm ${0%/*}/disable $0
exit &) &' > ${dir%/*}/post-fs-data.sh)
I installed this in termux and the module got installed .but after restarting the device the module was switched off I think a boot loop occured and automatically turned off .so what should I do.
 

Spaceoid

Senior Member
Mar 29, 2013
349
121
Dortmund
**v2022.7.19-dev (202207190)**
* Bump version
* 423fadb Misc charging control fixes and optimizations
* d74a647 Systemlessly disable mi_thermald
* deb4736 Add support for cooldown_charge=0 (to be used with cooldown_current)
* 6286223 Update documentation
* ded8b86 Rewrite script scheduler
* 950709b Update BATT_HEATH calculator
* e778686 Goodbye loopCmd (replaced by one-line scripts)
* e5110f4 Improve force_off

This can be installed by acc -u dev (-f is not needed).

AccSettings fix:
Code:
echo loop_cmd= >> /data/adb/modules/acc/print-config.sh
The latest dev version again has problems with the cooldown cycle on my OnePlus 6. Instead of respecting the 50/10 seconds ratio, the phone will only charge for two or three seconds, then interrupt charging again for a few seconds.
Maybe it is also a mistake on my end. Cooldown cycle works well on latest stable release, though, while being bugged again on a release before that one.
 

Attachments

  • acc-logs-OnePlus6.tgz
    41.7 KB · Views: 7
  • Like
Reactions: duttyend and VR25

Doomkopf

Senior Member
May 14, 2016
270
107
@VR25 Hey! I have a little trouble getting ACC setup, can I annoy you with it? xD
I realized having the chargingSwitch unset doesn't work for me, so I ran acc -t and tried all those switches manually by selecting it (with " --" at the end) and trying acc -d/acc-e to see what switch would actually disable charging for me. Then I found one ("battery/input_suspend 0 1 --") and set it. But when reaching the pause_capacity. It still continues charging. What did I do wrong? What could I try/check? Another switch? But this one worked when testing it, so it should theoretically be a correct one, right?

And another question, is it possible/did someone else ever report, that charging got hotter more easily after installing this? I'm not 100% positive on this, but I feel like my phone gets hotter more quickly since I installed this module. Could be the weather tho.

EDIT: I have a POCO F3 and I'm on LineageOS 19.1
 
Last edited:
  • Like
Reactions: duttyend

hamidv2

Member
Dec 10, 2015
26
1
Does anyone know the charging switch for the Redmi Note 11 Global version ?
Thanks

P.S : I've alread tried /sys/class/qcom-battery/input_suspend but it doesn't work for me
 
Last edited:

Manoj8001

Member
Feb 26, 2016
5
0
Working on oneplus 6 evo X rom A12.1. Using the AccA front end app with default module that comes with it. No issues.
 

david003

Senior Member
Aug 8, 2020
56
27
Also using AccA with the bundled version of ACC (which is older, v2021.8.31), with a Xiaomi Note 10 pro. It's been working fine for a long time, with Xiaomi.eu firmware (currently at 13.0.8.0). It charges up to 80% and stops.
 

Top Liked Posts

  • 1
    I'm using the NP1 very successfully with the latest dev acc. I'm avoiding AccA right now as it behaves weird with it. I've posted my used config a couple of posts ago - this one is VERY stable for me. Upper limit is 80% and while charging using Qi it goes to 82% at most, over 10 hours. I'd say that charging switch works fairly well, but only with forceOff.

    Edit: The 2% overshoot probably happens over hours and is not a concern for me as it's still low enough and probably at a very low trickle charge.

    Edit 2: To make it more clear: I use AccA occasionally to check on charging currents, but only every couple of days. I've edited the config using the acc CLI, after setting the charging switch using acc, then editing my limits using the acc CLI config editor. I've stopped using AccA for anything other than monitoring.

    As I've switched between acc versions, I've stopped using AccA to set the actual config. No issues.
    Can you please share your config file?
    Thanks.
    1
    Can you please share your config file?
    Thanks.
    Code:
    configVerCode=202207300                  
                                             
    ampFactor=                                
    battStatusWorkaround=true                
    capacity=(5 101 75 80 false false)        
    cooldownCurrent=                          
    cooldownRatio=( )                        
    currentWorkaround=false                  
    dischargePolarity=-                      
    forceOff=true                            
    idleThreshold=40                          
    language=en                              
    offMid=true                              
    prioritizeBattIdleMode=false              
    rebootResume=false                        
    resetBattStats=(false true false)        
    temperature=(40 45 90 65)                
    tempLevel=0                              
    voltFactor=                              
                                             
    applyOnBoot=()                            
                                             
    applyOnPlug=()                            
                                             
    battStatusOverride=''                    
                                             
    chargingSwitch=(battery/charge_control_limit 0 battery/charge_control_limit_max --)
                                             
    cooldownCustom=()                        
                                             
    maxChargingCurrent=()                    
                                             
    maxChargingVoltage=()
    
    runCmdOnPause=''
  • 4
    @VR25 v2022.7.30-dev is working great here on the Nothing phone 1. Using battery/charge_control_limit 0 battery/charge_control_limit_max and forceOff. This even works with Qi charging, not only USB. Before forceOff some internal thermal management service turned the switch on again after some time.

    The only thing I've noticed: The resume percentage isn't terribly accurate. I have it at 75, and yesterday it started charging even when it was a 76% battery.

    Thanks for this great tool, been using it for years.
    4
    Got a new Pixel 6a...using AccA app but charging doesn't stop at 90% as it should and only ever makes it to 2.5A. What switch does the P6a use or should I jeave it on 'auto'. And yes, I gotta use AccA cuz I've no how to use ACC directly...lol So go easy on me guys...plz
    Why not using a terminal to find which switch is working for you ?
    you can do it once and then using ACCA after.

    Juste plug a charger, type :

    su
    acc -t

    and you'll find the list of all the charging swich you can use.

    Find one with "charging switch true" then enforce it with

    su
    acc -ss
    the charging switch
    2
    .. onl
    Hi, I'm new to working with acc and own a Nothing Phone. Is it possible to share your acc configuration file?

    I figured out "battery/charge_control_limit 0 battery/charge_control_limit_max" is the charging switch, forceOff is the approach acc persists those values to the system.
    I'm curious if there are other variables interesting to tweak, and would like to learn more from a practical example.
    Only to give you an idea: I use the ACC Settings front end to 1) limit the charging current, 2) limit the max. percentage of charging, 3) stop charging in case of elevated temperatures but 4) create a biphasic charging with a higher current in the beginning and a low current at the end. My motivation is to maintain a good battery health. Whether or not 4) makes really sense I don't know. See attached.
    1
    Got a new Pixel 6a...using AccA app but charging doesn't stop at 90% as it should and only ever makes it to 2.5A. What switch does the P6a use or should I jeave it on 'auto'. And yes, I gotta use AccA cuz I've no how to use ACC directly...lol So go easy on me guys...plz
    1
    Why not using a terminal to find which switch is working for you ?
    you can do it once and then using ACCA after.

    Juste plug a charger, type :

    su
    acc -t

    and you'll find the list of all the charging swich you can use.

    Find one with "charging switch true" then enforce it with

    su
    acc -ss
    the charging switch

    I didn't know that's how to find out. I've only ever worked with the 'front end' apps. Thank you for for the tip!

    I've also been curious about the last 2 settings in AccA.
    What is the proper syntax for setting 'apply_on_boot' or 'applyOnplug' to true. I've never messed with control files before and there not a lot of docs for Acc or AccA.
    The last coding I've done was waay back in high school and a bit in college (basic, cobol and machine lang. lol)
    If u can link me to any 'noob level' guides re: control files, I'm sure interested.
  • 76
    Archive
    Find newer zips here.
    41
    Those who are worried about other projects of mine not being updated for a long time, possibly abandoned...
    Stop worrying.
    After the next stable ACC release, I'll focus more on the other Magisk modules (fbind, Migrator, Systemless GApps, etc.).
    The current ACC framework is the base of all the other projects - meaning, making it rock stable it priority #0.
    29
    A new stable release is up.
    It can be downloaded from Magisk Manager > Downloads as well.
    Refer to the readme for a full list of changes, features and recommendations.
    Now I'll be focusing more on the other projects (migrator, fbind, systemless GApps, daily job scheduler...).
    Until these reach satisfactory status, acc will only get occasional maintenance updates (bugfixes, optimizations, new charging control files...).

    Edit: the installer enforced by Magisk Manager is not playing nice with acc. Until I fix that, use the zip from GitHub (release link above).

    Edit 2: fixed.