13

Advanced Charging Controller (acc)

 1 year ago
source link: https://forum.xda-developers.com/t/advanced-charging-controller-acc.3668427/page-232#post-87444851
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Advanced Charging Controller (acc)

@VanGray Thank you for your guidance. I did use acc -ss and set the switch to the one you suggested. Currently the config.txt looks like this:

configVerCode=202207300

ampFactor=
battStatusWorkaround=true
capacity=(5 50 84 85 auto false)
cooldownCurrent=
cooldownRatio=( )
currentWorkaround=false
dischargePolarity=+
forceOff=false
idleThreshold=40
language=en
offMid=true
prioritizeBattIdleMode=true
rebootResume=false
resetBattStats=(false false false)
temperature=(35 45 90 55)
tempLevel=0
voltFactor=

applyOnBoot=()

applyOnPlug=()

battStatusOverride=''

chargingSwitch=(gcpm/constant_charge_current_max 1933090 0 --)

cooldownCustom=()

maxChargingCurrent=()

maxChargingVoltage=()

runCmdOnPause=''

What I see happening now is after reaching 85% the phone keeps detecting charge and keeps waking up while the battery% fluctuates between 86 and 85. Ideally, shouldn't it stop charging and resume when it goes below 84, so that the charge remains at 85 even though the charger is connected to the phone?

Please ignore my naivity in asking these questions.
Last edited: Aug 25, 2022

VanGray

Member
Sep 17, 2021
I have checked all the available swich for my phone (Poco x3 pro) and none of them work, could someone help me?
Rom: Evolution X (Android 12)
Kernel: Stock Evolution X
ACC Ver: v2022.7.30-dev
Front-end app: AccA

It depends on the kernel though. You can try another Rom or another kernel. For Poco X3 pro, some user reported that Arrow OS 12.1 with No Gravity Kernel v2.0.0 and Charging switch: battery/charging_enabled 1 0 -- is working

After setting the charging switch either on app or terminal, a device reboot is necessary

VanGray

Member
Sep 17, 2021
@VanGray Thank you for your guidance. I did use acc -ss and set the switch to the one you suggested. Currently the config.txt looks like this:

configVerCode=202207300

ampFactor=
battStatusWorkaround=true
capacity=(5 50 84 85 auto false)
cooldownCurrent=
cooldownRatio=( )
currentWorkaround=false
dischargePolarity=+
forceOff=false
idleThreshold=40
language=en
offMid=true
prioritizeBattIdleMode=true
rebootResume=false
resetBattStats=(false false false)
temperature=(35 45 90 55)
tempLevel=0
voltFactor=

applyOnBoot=()

applyOnPlug=()

battStatusOverride=''

chargingSwitch=(gcpm/constant_charge_current_max 1933090 0 --)

cooldownCustom=()

maxChargingCurrent=()

maxChargingVoltage=()

runCmdOnPause=''

What I see happening now is after reaching 85% the phone keeps detecting charge and keeps waking up while the battery% fluctuates between 86 and 85. Ideally, shouldn't it stop charging and resume when it goes below 84, so that the charge remains at 85 even though the charger is connected to the phone?

Please ignore my naivity in asking these questions.

It should stop charging and behaving as you said! I see that that battery idle mode is "true" in your configuration.

Try to change is to "false" and see if it works.

If I doesn't, you can try to enforce the two other switches and see if it's all OK

Last edited: Aug 25, 2022

VanGray

Member
Sep 17, 2021
Can someone give me their opinion on my setup? The settings are pretty overwhelming, but after reading the documentation I came up with this:
- Shut down is unchanged, cooldown at 60, resume at 75, pause at 80. Automatic charging switches.
- Temperature: Cooldown above 42, pause at 46, shutdown 50;
- Cooldown cycle: Charge period 50s, cooldown period 10s, cooldown current 500mA;
- Charging switch: Idle mode first;
- Statistics: Reset on pause;
Basically I want to limit charging at 80%, limit temperature at around 42C and make the cooldown cycle via limiting current instead of pausing. Also prioritize input power instead of battery when connected at pause level and reset stats when charged. Is my setup correct?
Thanks!

Yes I think it's all good!

Gerard03

Senior Member
Jul 23, 2016 Nothing Phone 1
I have a nothing phone and when I set a limit it doesn't stop and it shows an error daemon 7 when it reaches this limit

panni

Senior Member
Feb 6, 2007
I have a nothing phone and when I set a limit it doesn't stop and it shows an error daemon 7 when it reaches this limit

Use the latest beta (acc -u dev) and "(battery/charge_control_limit 0 battery/charge_control_limit_max --)" (in the config) as charging switch and forceOff=true.

This will not visually stop charging, but won't deliver any charge at the limit. Works pretty great.

freonchill

Senior Member
Jul 11, 2011 Atlanta
any idea why AccA crashed on load? I know its over a year old, but would love to have it back for when the daemon crashes and it auto-restarts it...

Gerard03

Senior Member
Jul 23, 2016 Nothing Phone 1
Use the latest beta (acc -u dev) and "(battery/charge_control_limit 0 battery/charge_control_limit_max --)" (in the config) as charging switch and forceOff=true.

This will not visually stop charging, but won't deliver any charge at the limit. Works pretty great.

What do you mean by not visually stop charging?

panni

Senior Member
Feb 6, 2007
What do you mean by not visually stop charging?

The icon will not change when the limit is hit.

Gerard03

Senior Member
Jul 23, 2016 Nothing Phone 1
The icon will not change when the limit is hit.

Ok thanks

xtacb4

Senior Member
Oct 11, 2010
Hi!
I have a Xiaomi Mi Mix 4 with LineageOS 12 rooted with magisk, and acc is unable to cut the battery charging.

How would I go about throubleshooting the issue? I reckon it is probably a compatibility thing, thus, what charging switchs could I test?

Using acc via terminal, no switch worked.


Thanks!

samhhmobil

Senior Member
May 25, 2017 Hamburg
Hi!
I have a Xiaomi Mi Mix 4 with LineageOS 12 rooted with magisk, and acc is unable to cut the battery charging.
[...]

I had similar trouble with the latest build (after many years without any issue).

Downgrading to build v2021.12.20 did fix this issue. Now again it works as it should.

samhhmobil

Reactions: duttyend and xtacb4

xtacb4

Senior Member
Oct 11, 2010
I had similar trouble with the latest build (after many years without any issue).

Downgrading to build v2021.12.20 did fix this issue. Now again it works as it should.

samhhmobil

Hi and thanks, it worked!! many many thanks!

NYLimited

Inactive Recognized Contributor
Jan 5, 2008 3,824 2,285 New Hampshire, USA
Hi everyone,

I could use some help or suggestions if anyone has ideas. I am running ACC on a OnePlus N200 and it worked great for a while but at some point it started to ignore the capacity_resume percentage. Occasionally it ignores the capacity_pause percentage and charges to 100%. As an example, let's say I set resume=70 and pause=80. ACC almost always stops charging at 80%. Seriously reliable. But, if I plug the device in at, say, 75%, charging should not begin if I understand things correctly till the level drops below 70%.

I cannot prove this yet but it *seems* that updating the ROM (using LineageOS 19.1 which tends to update weekly) somehow breaks the resume function. No idea if this is actually possible (the /data/adb directories should not be touched by an update) or if it is a coincidence. Uninstalling and reinstalling ACC, sometimes a few times, eventually fixes the problem. I have attempted to set/reset config values via ACCA.APK, via ACC in Termux and also via RootExplorer's built-in text editor. I suspect the config file is okay.

Am currently running v2022.7.30-dev version.

Can anyone give me a hint what I might be missing and how I could fix this little issue? Any ideas would be appreciated.

samhhmobil

Senior Member
May 25, 2017 Hamburg
Hi everyone,

I could use some help or suggestions if anyone has ideas. I am running ACC on a OnePlus N200 and it worked great for a while but at some point it started to ignore the capacity_resume percentage. Occasionally it ignores the capacity_pause percentage and charges to 100%. As an example, let's say I set resume=70 and pause=80. ACC almost always stops charging at 80%. Seriously reliable. But, if I plug the device in at, say, 75%, charging should not begin if I understand things correctly till the level drops below 70%.

I cannot prove this yet but it *seems* that updating the ROM (using LineageOS 19.1 which tends to update weekly) somehow breaks the resume function. No idea if this is actually possible (the /data/adb directories should not be touched by an update) or if it is a coincidence. Uninstalling and reinstalling ACC, sometimes a few times, eventually fixes the problem. I have attempted to set/reset config values via ACCA.APK, via ACC in Termux and also via RootExplorer's built-in text editor. I suspect the config file is okay.

Am currently running v2022.7.30-dev version.

Can anyone give me a hint what I might be missing and how I could fix this little issue? Any ideas would be appreciated.

Try downgrading acc to v2021.12.20.

For me this was the solution (on three different devices, but all running LOS19.1).

samhhmobil

Hi everyone,

I could use some help or suggestions if anyone has ideas. I am running ACC on a OnePlus N200 and it worked great for a while but at some point it started to ignore the capacity_resume percentage. Occasionally it ignores the capacity_pause percentage and charges to 100%. As an example, let's say I set resume=70 and pause=80. ACC almost always stops charging at 80%. Seriously reliable. But, if I plug the device in at, say, 75%, charging should not begin if I understand things correctly till the level drops below 70%.

I cannot prove this yet but it *seems* that updating the ROM (using LineageOS 19.1 which tends to update weekly) somehow breaks the resume function. No idea if this is actually possible (the /data/adb directories should not be touched by an update) or if it is a coincidence. Uninstalling and reinstalling ACC, sometimes a few times, eventually fixes the problem. I have attempted to set/reset config values via ACCA.APK, via ACC in Termux and also via RootExplorer's built-in text editor. I suspect the config file is okay.

Am currently running v2022.7.30-dev version.

Can anyone give me a hint what I might be missing and how I could fix this little issue? Any ideas would be appreciated.

Same problem here w 19.1

NYLimited

Inactive Recognized Contributor
Jan 5, 2008 3,824 2,285 New Hampshire, USA
Try downgrading acc to v2021.12.20.
Thanks. I saw a mention of that earlier and just downloaded it to try later today. 👍

NYLimited

Inactive Recognized Contributor
Jan 5, 2008 3,824 2,285 New Hampshire, USA
Try downgrading acc to v2021.12.20.
I installed the 2021 version and it charged to the correct capacity_pause percentage at which point it stopped charging as it should have. Will have to wait to drop down and test the capacity_resume next.

If that works I will apply the next Lineage update in likely a week and see if anything breaks.

Top Liked Posts

  • Hi everyone,

    I could use some help or suggestions if anyone has ideas. I am running ACC on a OnePlus N200 and it worked great for a while but at some point it started to ignore the capacity_resume percentage. Occasionally it ignores the capacity_pause percentage and charges to 100%. As an example, let's say I set resume=70 and pause=80. ACC almost always stops charging at 80%. Seriously reliable. But, if I plug the device in at, say, 75%, charging should not begin if I understand things correctly till the level drops below 70%.

    I cannot prove this yet but it *seems* that updating the ROM (using LineageOS 19.1 which tends to update weekly) somehow breaks the resume function. No idea if this is actually possible (the /data/adb directories should not be touched by an update) or if it is a coincidence. Uninstalling and reinstalling ACC, sometimes a few times, eventually fixes the problem. I have attempted to set/reset config values via ACCA.APK, via ACC in Termux and also via RootExplorer's built-in text editor. I suspect the config file is okay.

    Am currently running v2022.7.30-dev version.

    Can anyone give me a hint what I might be missing and how I could fix this little issue? Any ideas would be appreciated.

    Try downgrading acc to v2021.12.20.

    For me this was the solution (on three different devices, but all running LOS19.1).

    samhhmobil

    Hello,

    Need some guidance as to which switch to select from the 3 options where switch works and battidlemode is true. I have pixel 6 pro and charging using the 30w charger that came with it.

    Try this one:

    5/24: gcpm/constant_charge_current_max 1933090 0
    switch: off (0) current: -0mA (Idle)
    switch: on (1866420) current: -1378mA (Charging)
    Switch works ✅
    - battIdleMode=true

    What do you mean by not visually stop charging?

    The icon will not change when the limit is hit.

    Hi!
    I have a Xiaomi Mi Mix 4 with LineageOS 12 rooted with magisk, and acc is unable to cut the battery charging.
    [...]

    I had similar trouble with the latest build (after many years without any issue).

    Downgrading to build v2021.12.20 did fix this issue. Now again it works as it should.

    samhhmobil

    I've been trying out acc since Monday on my Nothing phone. I cannot reliably put the phone into idle/slow charging mode monitoring the status through AccA and acc -i/dumpsys battery. But I've had minor success on wireless charging and USB slow chargers.
    I've seen unexplainable things so far, probably because i'm handling it wrong; acca(CLI) lockups, accd crashes on valid config changes, accd seemingly sleeping when phone is locked, accd not taking new config changes etc

    I suspect my computer's USB isn't a proper power source to work off, I suspect the power randomly drops to ~0Amps without accd running.
    Fast chargers indeed keep pushing 2+Amps no matter what I do, which is documented in the readme.

    Before calling in help I'm going to try on my own for another while.
    I'm also considering moving over to AccA profiles and DJS, but as far as I can see it's not possible to encode force_off=true into AccA profiles.

    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.


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK