yashsingh1/xdaforums huggingface dataset:
[Magisk] Uluru25:
To update to the latest dev-version (uploaded just 20 min ago 😁) open the terminal and enter

"su" then

"acc -u -f dev"

No reboot etc. necessary.

Big thanks to VR25 for his incredible work!
[Magisk] eried1:
Yes. It is expected.
[Magisk] Uluru25:
Do it as described here.
[Magisk] eZ7whZq:
As I've said, the status is okay-ish, I can live with no current and status weirdness.

The problem is that it's only possible to disable charging via echo 0 > /sys/devices/platform/sec-battery/power_supply/battery/online. And the only way to resume is to disconnect/reconnect the charging cable.

And now I'm 99% confident that there are simply no /proc or /sys switches to resume charging as I've went through lots of them.

So my question is - is there a way to somehow reload the charging controller driver under Android or something crude along these lines?
[Magisk] msmcintosh:
I have ACC working where the phone stops charging at 80%. The only problem is that whenever the phone is charging the lock screen turns on and off repeatedly. If I disable ACC, when the phone charges, the screen remains off. Any ideas on what might be causing this?
[Magisk] Uluru25:
Look in the android settings for display. Here (with my phone) an option is to wake up the device on plugging to the charger. I have disabled this.
[Magisk] VR25:
Try again.

New changes pushed.

acc -u -f dev
[Magisk] VR25:
By default, it uses terminal editors in the following order: nano, vim, vi. You can also override that by specifying the desired editor and options.

That aside, you can use an app as well.

Run acc -c g (g is for GUI).
[Magisk] VR25:
Incorrect current reports cause acc to malfunction. It uses current data to determine whether the battery is charging. To use only status, you have to run the suggested commands: acc -s bsw=false; accd -i

After that, try acc -t again. If there are no working switches, try acc -t p

"online" is troublesome. Better avoid it, unless it's the very last resort.
[Magisk] beeshyams:
Me too but with a variation. Use a 15W charger on Pixel 6a with voltage set to 4200 mV and this keeps battery at around 33°C. I know Ideally it should be less than 30 but these Tensor devices at normal voltage hit 40 regularly!
[Magisk] eried1:
Any way to make sure ACC is always running in background? How to make it autorun after reboot?

Edit: Seems it is working for me now. No particular action besides disabling battery optimization.
[Magisk] eried1:
All is working on my P2. My A5 2017, however, is charging very slowly unfortunately - 100 maH per hour - and am trying to track down the culprit. What to do? I suspect it is ROM related.

This?
[Magisk] Uluru25:
This is default behavior (at least for my phone). If not, you can make a simple macro which sends after boot a terminal command "acc -D restart".

🤠
[Magisk] eried1:
I still have problems resetting stats automatically. Working on my A5 2017 which has slow charge issue prob related to ROM/kernel. Not working on my P2. The command acc -R has no effect. Only works manually through frontend app.
[Magisk] Spaceoid:
Worked flawlessly this time. Thank you loads. :)
[Magisk] mGforCe:
Thanks for continuous development of this module

acc -c g gives error "inaccessible or not found"

I have to replace g with text editor app name?

I want to use editor which is part of MiXplorer. How to do?
[Magisk] VR25:
Probably because you haven't rebooted the system after installing acc. If that's the case, prefix every command with /dev/, as in /dev/acc -c g.

This may also happen when you run without root.
[Magisk] Uluru25:
... you could do it this way:

Open your root explorer (I use X-Plore), navigate to /data/adb/vr25/acc-data and open there the config.txt file. Change here what you want (but be cautious). See screenshot.

🤠

Edit: maybe afterwards you have to restart the daemon so that the modified settings get applied. For this, open a terminal, enter "su" and then "accd" or enter "su", then "acc", then "4" and finally "z" to exit from the acc-wizard.
[Magisk] eried1:
Sth is def off with my device. I tried manually the dumpsys reset command in the terminal. It is being registered but does not appear to do anything.

Edit: After updating from 7.17 to 8.12 resetting stats works again. If this hadn't solved my issue, cleaning cache could also have worked.
[Magisk] Kid8:
I can't seem to use the new command feature for checking estimated battery health

-H|--health

How to do it? Please help thank you
[Magisk] eric00x:
AccA is dead, or at least shouldn't be recommended - not only localizations are outdated, but also it loves to hang up while restarting daemon or some of the tests (like ability to idle on charger) do not work, if they ever did.

Also no compatiblity for KernelSU, but that should be obvious - have to install modules manually.
[Magisk] Uluru25:
If your battery should have a capacity of e. g. 4000 mAh you have to open the terminal, enter "su" and then "acc - H 4000".

If no result is shown, either check with an app the designed capacity or just enter a slightly higher value. In my case I have to use 4100.

🤠
[Magisk] Uluru25:
You are also aware of this?
[Magisk] Kid8:
thanks got it. i have surprisingly low results in my 2 phones - 91.5 and 93.4 XD
[Magisk] eric00x:
yeah thanks for that - literally just in time
[Magisk] jacobchins:
Has anyone had much luck with specific switches on the Pixel Fold? Very few are available, and almost none of them maintain my mcc 1500 mAh cap set in console. I also have an issue with the charger showing connected but not charging even below my resume capacity. Temperatures are below the cooldown temp, pbim (idle) is false.
[Magisk] Uluru25:
... update to the most up-to-date dev version by entering "su" and then "acc -u -f dev" in a terminal. VR25 recently added some new switches, maybe you have more luck with them?

🤠
[Magisk] jacobchins:
I updated to the August 12 version, which seems to be the most up to date and still no luck after running acc -t p. Is there a way to remove switches that are marked X in the test so only ones that are valid show up in the list?
[Magisk] Uluru25:
deleted
[Magisk] Uluru25:
Yes, this is possible.

Look here and follow the conversation up to it's beginning and you will learn how to blacklist switches.

As a short extract from there:

You can blacklists troublesome control files by adding them to /data/adb/vr25/acc-data/logs/ps-blacklist.log. To do so you could run the following command in a terminal (or add it manually there):

echo <control file> >> /data/adb/vr25/acc-data/logs/ps-blacklist.log where <control file> is the switch you want to exclude.

Truncate the switch at the first space: if the switch is "battery/charge_control_limit 0 battery/charge_control_limit_max" then only add "battery/charge_control_limit" to the blacklist.log.

🤠
[Magisk] jacobchins:
Running through acc -t p again right now to log the ones that do not work, but am wondering if they will be removed from acc -t or acc -ss in future runs once they are put in the blacklist. Is this correct?

I'm attaching my log, but I only have one switch available using the charger I always use, but when I run acc -ss, it is displaying none of the ones it ran in acc -t p.
[Magisk] Uluru25:
What is shown when you run "acc -ss"? Please upload a screenshot.
[Magisk] jacobchins:
Do you have a way for me to contact you privately with a few questions?
[Magisk] eried1:
Stats now reset automatically. But it has been replaced with a new problem: Slow charging 😄 Probably ROM/kernel related.

Macusercom
[Magisk] eried1:
I have a new battery and am getting 0.0%. Could it mean 100?
[Magisk] Uluru25:
I guess not.
[Magisk] VR25:
Share a log archive.

acc -le
[Magisk] VR25:
No.

Most likely, the command "dympsys battery" shows a wrong "charge counter" value (ROM/kernel issue).
[Magisk] VR25:
Release v2023.8.19 · VR-25/acc

1936210 Fix print_quit error 28d68bd Fix -f and temp_level 08e2c3f Fix --upgrade 6f69b45 Add constant_charge_current* control files 312a429 Update resume_temp information 2744859 Fix module info up...

github.com
[Magisk] eried1:
What is battIdleMode now again?
[Magisk] VR25:
Battery idle mode, also called "standby mode" or "charging bypass", is the ability of running off the charger, as if the battery were disconnected from the device. Not all devices support this, but there's also emulated idle mode (refer to the readme). Emulated idle mode works on all devices.
[Magisk] eried1:
So in theory, if I always had it plugged in this mode battery would not deteriorate by other means than age?
[Magisk] VR25:
Yes, but only if the battery is neither low nor full.

If you store a battery fully charged or drained, it'll deteriorate faster.

The ideal state of charge for this scenario is about 40-60%.
[Magisk] eried1:
Any way to use Tasker to quickly change pc and rc limit settings?

I thought of only running on AC while at home and limit the charge to 50%. Before going outside I could click on a Tasker shortcut which executes a command to charge to 90%. When I return to my home - using a toggle profile - it will switch back to 50%.
[Magisk] spoonic:
Hi, I've just discovered ACCA and I'm totally begin with. Is there some tutorial or something for a beginner ? I'm on a redmi note 10 pro.
[Magisk] gordon631:
your work is awesome on this module. thank you for making this module, vr-25. i used acc flawlessly on android 12 , crdroid 8.5 on poco f1 with ngk kernel. everything worked. (with idle charging)

now i switched rom to pixel os , a13+ngk kernel as before. but acc never stops charging, sometimes the daemon crashes, but it always passes the charging limit set by me. charging current control somehow works . i am attaching log files. please hv a look at the issue.
[Magisk] eried1:
Yep. Learn ACC through terminal. Never bother with the app.
[Magisk] VR25:
Your config is incorrect. The switch you chose won't work with battStatusWorkaround=false. The default is true. Also, you're not running the latest version.

Fix it all with one line: acc -s bsw=; acc -u -f dev
[Magisk] WhoIsJohnGalt1979:
@VR25 Hello :). I have for a couple of years now have had my eyes set on using this mod, but something or the other derailed me from using it. I am currently on acc_v2023.8.19_202308190 with no GUI apps installed. Using the terminal is more convenient.

The acc -H command shows that my 5002 mAh battery is at 98.2% health using the wall charger (official 30W Google charger) and 99% health using the USB cable. I have attached the acc -I outputs for both. Without any cable connected, the command outputs 96.5% health.

The acc -t command shows that the only switch which works with battIdleMode=True is sys/devices/platform/google,charger/charge_stop_level 100 battery/capacity. Is this accurate or should I run

I am also attaching the acc -le dump.

The setup posted by @Uluru25 "acc -s pc=80 rc=79 cc=101 ct=50 mt=34 rt=32" is something I would like to persue, I understand the meaning of it. Would like to change it to "acc -s pc=85 rc=84 cc=101 ct=50 mt=36 rt=32"for my phone.

I remember in my earlier attempts ayear back on Pixel 6 Pro, the battery capacity as displayed by my phone used to toggle a lot after disconnecting from charger-like 80 would certainly show as 78 and then back to 80 etc.

My apologies if you are wondering "while all this is good, what is your question". To be honest am not sure lol. Considering all the above information, is it okay to go with acc -s pc=85 rc=84 cc=101 ct=50 mt=36 rt=32? Is the charging switch correct or should I run acc -s bsw=false; accd -i and then run acc -t? Also what would you recommend for battery reset for Pixel devices basis the https://xdaforums.com/t/advanced-charging-controller-acc.3668427/post-88813971
[Magisk] VR25:
Yes, that's the switch.

Settting bsw=false is not recommended under normal circumstances, as it'll significantly decrease the number of working switches, including this one.

That config is fine. However, if your device's temperature tends be be very close to those values, you may not have the best experience, as charging would be constantly pausing within short timeframes.
[Magisk] jacobchins:
Below is my output, and I also submitted my power supply log via the dropbox link.
[Magisk] jacobchins:
Yes, you can tell tasker to run a shell command which is how I run different profiles, since the method in the readme doesn't work any longer. Simply enter:

The ; separates commands that might normally go on different lines, or you can alternatively use &&. You also have the option to display a message with the -n command through acc, which can simply be chained to the above string by adding either && or ; then acc -n "Charging to 90%". This would look like:

Doing the above under "Tasks" in Tasker, then creating a location or time based trigger for each under "Profiles" will automate the process, and push a notification saying eg. Charging to 90%. Make sure to "enable root" under each task that you set.

I hope this helps.
[Magisk] eried1:
Thank you! And to find out about if idle works?:

By the way, I've had three false positives on my phone re working idle switch.
[Magisk] mGforCe:
Hi, I have different phones with different ROMs. Everywhere I have same Magisk Delta Delta v26105 with ACC and ACCA installed.

But charging is quite different across devices.

In some phones, ACC just works out of box. Charging is fast as per charger and stops at defined %.

But in some, charing is supr slow or like no charge. In these phone with issues, if in ACCA, I select Charge Once to % (and here make 85% or 100%), it starts charging fast.

Example of Phone/OS with Working ACC

Nothing Phone 1 with NOS 1.5.5 (Android 13) wherein v2022.7.30-dev works well (got this version post reading post from @panni here

Example of Phone/OS with Non-Working ACC

Redmi Note 9 Pro (miatoll) with LOS 18.1 (Android 11) wherein latest version also has issues. Slow charge unless I select charge once to % or I disable ACC demon

Pls let me know what all details should I share here for troubleshooting?
[Magisk] WhoIsJohnGalt1979:
Am successfully using the profile acc -s pc=85 rc=84 cc=101 ct=50 mt=36 rt=32 for the last 3 days. No aberrant behavior, phone stops charging at 85 and temps are cool. To be honest am happy with this. Thank you and @Uluru25 for all the help. Will bug you in TG if I need.any help, hopefully not :)
[Magisk] eried1:
Idle mode is now working on both my tablet (2019) and phone (2016). Phone is a bit unreliable though as it sometimes stop working - might have to do with it being really old and running 3.18 kernel.
[Magisk] eried1:
A tricky issue: When using ACC and battery level is above pc my phone probably cannot determine if charger is connected since status will always be discharging. Any clever way to detect if charger is connected in this situation? Tasker's power state won't work as long as phone is discharging.
[Magisk] eried1:
Update: Phone is working flawlessly now for some reason. Now the issue is with the tablet. It seems it changes charging switch to 'automatic' after battery level drops below rc.

Any way to force a switch permanently?
[Magisk] goRt:
-- at the end of the switch
[Magisk] eried1:
Update (for other who struggle with idle mode): Keeping it simple by only using rc and pc - no voltage or current changes - seems to do the trick for me. Then my tablet does not charge beyond the limit or change switch. Had to restore the default config a couple of times to arrive at this conclusion.
[Magisk] eried1:
I sometimes had problems on my tablet with it charging past the limit and at one time I confirmed that it happened bc ACC was killed. My only configuration in A13 for ACC is to set Magisk to unrestricted battery usage - do not know what else I could do since I have no device specific battery management. In addition, I have a Tasker profile which checks every 10th minute if ACC is running and restarts it if it isn't.
[Magisk] eried1:
This problem I have had on several devices - still don't know the answer to this. Everything else is working pretty well after having experimented for a while.
[Magisk] eried1:
What does forceOff mean? Couldn't find anything in the readme.
[Magisk] magi44ken:
Does pause and resume capacity works with your setup? Which charging switch you use?

I testedba few Android 13 ROM my OnePlus 8: crDroid, Nameless, OxygenOS, Zephyrus, AlphaDroid.

Most of them uses the either LOS kernel with added features or Meteronic kernel. All supported idle mode but some is inconsistent where it charges for two seconds and go back to idle mode and repeats in irregular intervals.

But none of them able to get the pause capacity to works. Always continue to charge after pause capacity is charged to.
[Magisk] eried1:
In case ACC fails to enter idle mode, I made a profile in Tasker with "acc -d" and "acc -D restart" which becomes active if phone is charging and battery level is above pc. Reading this thread from c:a page 200 I first thought "acc -d" should be enough but it seems it kills the daemon as well.
[Magisk] goRt:
I find that the daemon can be running (accd,) but not functioning, so issue accd
[Magisk] eried1:
Another thing: I've noticed that idle mode may prevent deep sleep - no suprise. Any advantages/disadvantages with using idle instead of deep sleep that aren't obvious?

Was thinking of only letting me devices idle while in use, otherwise disconnected and in deep sleep.
[Magisk] Borosin:
Hi folks,

Even though ACC "works" on my Redmi Note 10 Pro with stock Xiaomi kernel, it has weird issues.

Even though the battery/input_suspend switch "works", in terms of the charging animation showing when temps and charge percentage are in the range for recharging, the phone actually keeps charging at slower rate after the desired percentage is reached. ACC meanwhile thinks that it's discharding, and the fuel gauge stays the level that I set in ACC.

So, when discharging, the battery-full percentage stays at the set upper limit for a very, very long time, and the calibration can never really catch up with what's happening.

The only thing that works is setting a max_charging_voltage to roughly what the upper limit should be. However, in this case i have to charge the battery to "100%", which results in the upper half of fuel gauge being depleted unrealistically fast, until it becomes reliable at around 50%.

Has anyone encountered such a behaviour by a kernel?
[Magisk] Uluru25:
... have you tried to update to the very last version by entering the terminal command "acc -u -f dev"? Acc is meanwhile regularly updated and provides e. g. more switches which could bring you a solution.
[Magisk] Borosin:
I did what you suggested... still have some testing to do, but it seems to actually work "out of the box", with automatic switch selection. (y)

In case any other users experience the same problem: When you unplug the phone while it is "not charging" / "discharging", the voltage of the battery should NOT immediately drop further. That's what it did before in my case. It was a tiny, like ~0.02v drop.

Anyway, I'll go back to reading the docs of ACC (it's overwhelming...but in a good way :LOL:) . It's a shame no front-ends have kept up with the development, many new features are not accessible even if compatibility exists.

Right now, i consider using a script manager and launching shell scripts for different charging scenarios.

Anyway, thanks a lot!
[Magisk] Uluru25:
New dev build available

As always, run "acc -u -f dev" in the terminal to update to the last dev build.

Thanks to @VR25!
[Magisk] VR25:
There could be something wrong with your config. Reset everything with acc -sr a
[Magisk] VR25:
Not all kernels provide that information. There are no workarounds. On the other hand, when status is "Not charging", the charger is detected.
[Magisk] VR25:
Just set it with acc -ss

It'll automatically append " --"
[Magisk] VR25:
force_off (fo) # Default: false

Enable this only if the set charging switch is stubbornly reset by the system.

Oftentimes, userspace thermal management daemons (e.g., mi_thermald) and/or driver issues are behind charging control issues.

Some people "systemlessly" disable certain thermal daemons with Magisk. While this is not a general recommendation, they swear by it.
[Magisk] VR25:
Which acc version are you using?

ACC checks the current as well, to determine whether the battery is actually charging.

If you kernel is reporting “discharging” current while the battery is actually charging, then you have a major kernel bug.
[Magisk] eried1:
Thanks! Has happened to me on rare occasions.
[Magisk] eried1:
Anyway to print the current voltage? I am only getting "Default Millivolts" when typing acc -s v.
[Magisk] Borosin:
I used the one that came bundled with the last ACCA...so, it was pretty old. But at least that should rule out incompatibilities between ACC and ACCA.

Both your current dev and release versions work correctly. I kept the phone plugged in overnight with a 3850-3900mv idle emulation, and it did not charge any further.

With the old version, the voltage kept creeping up over many hours...yeah, with ACCA showing "discharging". One thing that I also noticed was that the fuel gauge always kept rising at the same speed, regardless of the charging current set in ACCA. Even setting it to 100mA would get it from 50% to 80% pretty quickly, while the voltage kept rising as slowly as you would expect from such a low current.

This also isn't the case anymore since I updated.
[Magisk] Uluru25:
I have written a short MacroDroid macro which reports current during charging (along with actual time, charging percentage, battery temp, and actual time all changes into a file.

If deemed helpful, I can upload it here.

🤠
[Magisk] VR25:
A few ways...

acc -i

acc -i volt

acc -w

acc -w volt
[Magisk] beeshyams:
Please do
[Magisk] Uluru25:
Macro to write some values like batt. temperature, charging current, batt. percentage etc. to a. txt file during charging

edit: for an updated post, see here and here

Since I wanted to monitor during charging how some related parameters change over the time depending on my settings, I wrote a short MacroDroid macro, which I share here for those interested.

If you want to use the macro, download it, rename it to .macro and import it. It will start automatically when the charger is plugged.

edit:

Meanwhile I found a way to also log the voltage. This version 2 is now attached, too.

🤠
[Magisk] beeshyams:
Thanks a lot, possible to add voltage too? It would be good to see as one experiment s with voltage levels and see the corresponding battery temp?

Do a good thing and people will ask for more 🤣
[Magisk] Uluru25:
If I could, I would! (but this value is not provided by MacroDroid afaik).

For reporting of battery voltage I use a 3rd party app (see ss enclosed).

🤠
[Magisk] bizkit_120:
Custom ROM Should already come with build in battery charging optimization feature.. you don't need ACC anymore, I have OP9 runs on nameless, build in feature works perfectly fine..have removed ACC since then.. but agreed with what you said, ACC doesn't works well with custom ROMs
[Magisk] Uluru25:
Sorry that you had no luck with acc up to now. This post was considered to be a recommendation to you. If you are still interested in acc, you could post your issue here in VR25's TG group, where the dev is very active and committed to help literally each and everybody.
[Magisk] Uluru25:
If you only need the pause capacity feature of acc then you might be right that this feature is available in several custom roms.

But if you are seeking for advanced features like defining the charging current (and this depending on several factors e. g. the charging percentage) or enhancing the longevity of your battery with temperature controlled charging patterns, at least myself have never seen this in custom roms.