yashsingh1/xdaforums huggingface dataset:
[Magisk] Fostel:
Trying to set up Oneplus 5T (dumpling) and Xiaomi Redmi Note 10 Pro (sweet) with acc.

No AccA installed, just acc in the terminal.

Which switch works best/ one would you recommend taking into account below test results?

Thanks.
[Magisk] G5-User7080:
This is no script, this the config for AccA, AccA is a frontend for acc

Essentially just an app to dial in settings so you don't have to go through terminal.

You can just set those values through terminal directly in acc, I just prefer AccA cause I can switch between multiple profiles depending on how long my day is and how much charge I need.
[Magisk] G5-User7080:
try with the "test switches" option, but for me (pixel 6a) main charger current max xx00000 0 works the best
[Magisk] beeshyams:
Thanks for that clarification?! Will try it out time permitting

Take care
[Magisk] saphta:
Hi, on a Moto G Pure (powered by Mediatek MT6762G Helio G25). Rooted, with Magisk, busybox module installed. I installed the latest ACC module using Magisk, rebooted and I don't see any app to control it. What am I missing?
[Magisk] TKruzze:
The app? 🤔

Edit: A front-end (app) isn't required, but you can try one if you'd like.
[Magisk] fester54:
please for redmi note 8 pro which is command for 100% charging. in my phone it stop 74% i tried acc -f but it works only for one time

ps for this phone there are other best settings
[Magisk] temporarium:
acc stop resume

So, you could do `acc 85 80` or `acc 90 75`.

The whole point of acc is to avoid charging the battery to 100% to extend its life. If you want to charge 100% all the time, just field disable the acc module and reboot.
[Magisk] saphta:
I just installed the front end app. I ran "acc -t" in terminal and got this output:

1/6: /proc/mtk_battery_cmd/current_cmd 0::0 0::1

switch: off (0 1) current: 1mA (Idle)

switch: on (0 0) current: 535mA (Charging)

Switch works ✅

- battIdleMode=true

2/6: /proc/mtk_battery_cmd/current_cmd 0::0 0::1 /proc/mtk_battery_cmd/en_power_path 1 0

switch: off (0 1, 1) current: 3mA (Idle)

switch: on (0 0, 1) current: 542mA (Charging)

Switch works ✅

- battIdleMode=true

3/6: mtk-master-charger/constant_charge_current_max 1980000 0

switch: off (1980000) current: 1mA (Idle)

switch: on (0) current: 463mA (Charging)

Switch works ✅

- battIdleMode=true

4/6: usb/current_max 1500000 0

switch: off (1500000) current: 544mA (Charging)

Switch doesn't work ❌

5/6: mtk-master-charger/constant_charge_current_max 1980000 50000

switch: off (1980000) current: 0mA (Idle)

switch: on (0) current: 590mA (Charging)

Switch works ✅

- battIdleMode=true

6/6: usb/current_max 1500000 50000

switch: off (1500000) current: 588mA (Charging)

Switch doesn't work ❌

I've selected the ones with a green checkmark (one by one) from the above list, and pressed Test the charging switch (from the app), the result: an error has occurred.

Edit: Manually selecting the first profile from the list above stopped the charging at 75% which was the plan. Not sure why the error came up but it works.
[Magisk] G5-User7080:
you dont need to test the charging switches in the app

youre supposed to go to a terminal emulator or adb shell, run acc as su, test switches, then set your desired config, start with acc -ss to select one of the previously tested switches, use acc -s followed by the other options you wanna set such as temp & pause settings, stop and resume levels etc.

see https://github.com/VR-25/acc#terminal-commands

and https://github.com/VR-25/acc#terminal-commands from the "# FINE, BUT WHAT DOES EACH OF THESE VARIABLES ACTUALLY MEAN?" part
[Magisk] saphta:
I did test the switches in a terminal and picked the one from the app. Did the job. Thanks
[Magisk] eried1:
I can no longer reset battery stats. I think it could have something to do with my device since the GSam app is no longer reporting phone and screen stats. What could be the cause?
[Magisk] Lada333:
Hello!

I'll be going on vacation, using my phone for navigation for a 7-8 hour long drive. I have a Pixel 6a which doesn't support native idle. What would an ideal emulated idle setup be? Setting resume_capacity to 49 & pause_capacity to 50? Is there any point in going for a wider range - eg.: 45-55? Would any of these ranges introduce mini-cycles?

Another, totally unrelated question: I have max_charging_current set to 750 (which makes the device charge at about 1100mAh - no idea why the offset), but whenever I disable charging (with acc -d), then re-enable it (whether by using acc -e, or if I set a time limit (let's say acc -d 1h) and it runs out), the charging current limit I'd set doesn't apply - device just starts charging as rapidly as it can, unless I restart the acc daemon.

Is this a known issue, am I doing something wrong, or is it a device-specific issue, rather than something wrong with ACC?

Thank you!
[Magisk] G5-User7080:
idk from when on it counts as mini cycle but the range I have set when I have my phone plugged in for a long time is ~3880-3960 I believe, which in % charge for the 6a is about 42% or 45% - 58%, just going around the 3920mV sweetspot
[Magisk] Lada333:
Makes sense to use voltage instead of battery percentage. So should I just use 'acc 3900' (exactly as the example in the documentation, haha), and be set for the trip?
[Magisk] G5-User7080:
charging V is higher than battery V when unplugged, I had to set charging to 4080mV so the battery was at 3060 when it stopped

for the lower bound I suppose setting the voltage shouldnt be an issue though for some reason I always set %age, I'd suggest you try it before your vacation
[Magisk] dzjin:
Would you kindly share your config file for Nothing Phone 1?
[Magisk] panni:
Of course! Using v2022.7.30-dev:

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=true
rebootResume=false
resetBattStats=(false false 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=''
[Magisk] dzjin:
Thank you kind sir! One question you haven't updated your acc how come?
[Magisk] panni:
The changes in the current version have not really prompted me to update tbh: https://github.com/VR-25/acc/compare/v2022.7.30-dev...v2023.6.26
[Magisk] dzjin:
I tried this config file that you so kindly posted on the newer version and it didn't work. If you do manage to get a config file to work with the newest. Please by all means, let the rest of us in the dark know and post it here. I'd appreciate it truly, you're the only one cracking the acc enigma on the NP1. A true NP1 connoisseur. 🙂
[Magisk] dzjin:
I use a UGREEN 100W power adapter with a 100W USB C cable for all my devices. I can confirm that with said version and your config file @panni it works flawlessly thank you. Also @VR25 thank you for all the great work you've invested in creating this awesome mod.
[Magisk] panni:
Oh, so are you certain the newest version doesn't work?
[Magisk] dzjin:
Yes, that's correct. It just charges to 100% like usual. It's a good idea to keep it on the 2022.7.30 version.
[Magisk] Vermillion_PT.2:
Mine too. Anyone has got a solution yet?
[Magisk] TimmyP:
Has anyone used this on a Oneplus 9 with wireless charging? I see some posts, and I can use the custom switch flag:

"/sys/devices/platform/soc/soc:eek:plus,chg_intf/soc:eek:plus,chg_intf:eek:plus,wireless-charge/oplus_chg/wireless/chg_enable 1 0 --"

which works to limit charging max.

The problem actually is when it reaches that capacity, it discharges 3% every hour until I take it off the charger (I do not think its the charger). It clearly works, and I hear the disconnect sound. It seems like ACC itself is doing something and causing some sort of wakelock when it reaches pause value. Off the charger under normal use it doesn't even drop 1 percent in 1 hour.
[Magisk] mavrovelos:
ACC settings just stopped working after an update of the pixel 7 pro and from what I see daemon is not running with an exit code 127.I'm using 2022.6.7 version Any help appreciated. Edit :After I cleared cache and storage it works but with this message as shown in the screenshot. What happened?
[Magisk] Uluru25:
... ignore it if acc is still working.
[Magisk] owlery_hk:
Hello.

Thank you for the dev work on this useful tool.

I am running a Xperia 5 iii on the latest official lineages os 20 build.

On my phone, acc is able to stop and start charging, but the voltage and current limitations do not work.

I have run the test switches command and the output is attached.

Any idea how I might go about fixing this?
[Magisk] Uluru25:
... sorry but nothing is attached 🤠
[Magisk] owlery_hk:
Sorry about that. I re-upload. Does it work now?
[Magisk] Myhand:
Fixed, latest release works fine.
[Magisk] Myhand:
Your kernel must support this.
[Magisk] Uluru25:
... sorry but I rather meant your config file.

You find it in /data/adb/vr25/acc-data as config.txt.
[Magisk] owlery_hk:
I just ACCA for configurations, which edits the config file as I understand?
[Magisk] owlery_hk:
Thanks.

So I have to wait for the Dev of lineage os to implement this?
[Magisk] Spaceoid:
I cannot update to the newest version through terminal. Is that expected behaviour? Did you guys install the newest update (v2023.7.17) manually? :)
[Magisk] Myhand:
... of course.
[Magisk] Sergykm:
any profile for oneplus 9pro or 11? thanks
[Magisk] eried1:
Any way to automatically reset stats when reaching the limit? In front app we only have the choice to do so when disconnecting the charger or pause. Does target mean pause by the way?
[Magisk] Myhand:
Of course.

> Configuration > Statistics > Reset on pause
[Magisk] mGforCe:
Thanks for this... will be quite helpful because we do want full charge once in a while.

Now, need to learn and use MacroDroid... couldn't break through initial learning curve last time when I tried :)
[Magisk] mGforCe:
Sorry for not searching and just asking here...

But how to use terminal to edit config and get out to code. Is there a good guide.

I was using Termux, opened config using acc-c and post that was a challenge how to select, replace, delete etc.

To exit also, had not clue and so had to force close Termux and restart phone.. sorry if asking basics...but really lost here.
[Magisk] Uluru25:
No problem. I will write a short post here on the very basics.
[Magisk] Uluru25:
Basic steps to use the terminal for configuring acc

1. Install a terminal app e. g. from F-Droid. I use this one (old but very lightweight and fully sufficient for me)

2. Open the terminal app and you will see a prompt "$" which indicates that the terminal yet is not running with root privileges

3. Type "su" and enter (always without the quotation marks) and magisk will ask you if you would like to grant root privileges. Grant the rights (su means superuser). The prompt will change to "#" indicating that the terminal now runs with root privileges.

4. Now type "acc" and enter and the acc menu should pop up (see screenshot). If you get an error here, just reboot your phone and repeat steps 2 - 4

5. Check whether "accd is running". Otherwise type "4" so that it will be (re-)started. This will take some seconds.

6. Several other commands (1 - 9, a - f, and finally also z to leave this menu) are available. I routinely only use "9" but only to read the config and NOT to change it there. See following points.

7. What can be changed and how?

Look here under "Default Configuration" or just open your config.txt file (which not only contains your config but also the full documentation) in /data/adb/vr25/acc-data. To get access to this folder you need an explorer with granted root rights.

8. As mentioned in the documentation never modify this config.txt file in Windows!

9. In both locations mentioned in step 7 you find the possible parameters, their meaning, and how to use it. By far, not all of them are necessary (for me). A truncated (!) list of the parameters is shown in the screenshot.

10. Configuring parameters with the terminal:

Do steps 1 - 3 so that you have the # prompt. Now enter "acc -s pc=80". This will set the pause capacity (the limit of charging) to 80 %? You could repeat such commands for other parameters, e. g. "acc -s rc=40" so that the resume capacity is set accordingly (from which percentage of your battery re-charging will start). But you also can combine such settings into one line like "acc -s pc=80 rc=40".

11. To leave the terminal you can forcedly close the window (rather brute 😁) or you can enter2 times "exit". The first "exit" will terminate your root session (the prompt will change from # to $) and the second "exit" will close the terminal.

🤠
[Magisk] mGforCe:
thanks @Uluru25 for this guide.

One quick Q : to edit config file, we have to go to the folder via file explorer etc and then edit via text editor etc.

terminal app not used to edit the file right?
[Magisk] Uluru25:
edit: deleted, since mistakenly posted 2 times (sorry!)
[Magisk] Uluru25:
I recommend you use the "acc -s... " commands in the terminal app as described to make changes to the config file. But you can also change it in an editor (or directly with the root explorer, at least the one I use allows me this directly).
[Magisk] eZ7whZq:
Has anyone got any success with the i9100?

Checked myself a lot of /sys/devices/platform/* entries to no avail, 99% of them are read-only.
[Magisk] VR25:
Have you tried acc -t p?
[Magisk] Uluru25:
Guide how to let acc automatically reset the battery statistics

1. open a terminal with root granted (see here)

2. enter "su" (without the quotation marks)

3. enter "acc -s rbsp=true"

This will let acc automatically reset your battery stats when the defined "pause capacity" (configured limit when charging should be stopped by acc) is reached.

To disable this behavior, just enter "acc -s rbsp=false".

Alternateively, you could use the command

"acc -s rbsu=true" to reset the battery stats on "unplugging" from the charger or "acc -s rbspl=true" to reset on plugging to the charger.

Hope this might be helpful for someone.

🤠
[Magisk] guillermorojaz:
Greetings @VR25

If I wanted to manage it from ACCsettings, which version should I try?

Installed the latest one from your repository, acc_v2023.7.17_202307170.zip
[Magisk] Uluru25:
... you can use this last version
[Magisk] Trakost:
Hi, on my Redmi note 7 an old version (october 2020) worked, but now I switched to my brother's note 8t and any version I tried crashes when using front end apps and I'm not able to change mA. Anyone in a similar situation?
[Magisk] Uluru25:
I run several RN8/RN8Ts and they work. What could crash are the unmaintained and old gui apps (like Acca or Acc settings).

Try to deinstall all gui apps, delete the folder /data/adb/vr25. Reboot and flash the latest dev-version of the acc.zip (not a gui app). Then try if it work from the terminal (I am sure it will😁). This means also to test the switches from there. Then if you REALLY need a gui, install a gui and you have a good chance that the gui will also work.

🤠
[Magisk] Ignass:
Maybe there is a way to make acc fast charge lets say to 60% and after that limit voltage or amps?

I plan on using my phone as gps and it doesnt support idle mode.

Or should i just select resume as 59% and stop as 60%?
[Magisk] zzenyoo:
Fast charge isn't that bad. Temperature is 🤷🏻‍♂️
[Magisk] Uluru25:
Very easy:

e. g. "acc -s cc=60 cdc=500"

will start the cooldown cycle at 60 % charging and will then complete the remaining charging (up to the defined pause capacity) with the cooldown current of 500 mA.

Other values are possible but multiples of 500 (i. e. 500, 1000 or 1500).

🤠
[Magisk] Ignass:
Thanks for answers, tried limiting current with cooldown set at 100 but it still randomly fastcharges for couple seconds.

Limiting % seems to be working more consistently.

Will play with setting and watch battery temps
[Magisk] Uluru25:
But you know that charging to 100 % is not at all helpful to increase battery life time (see here)?
[Magisk] Ignass:
I have limited current to 100ma. Tested some more with voltage limits and limiting % seems to be working best.

Wondering what method is best for battery life
[Magisk] Uluru25:
Macro to toggle between Battery Idle Mode* and normal Charging Mode

For those of us, who are too lazy to manually switch their phone via terminal commands to the "battery idle mode" (BIM) and then back to the normal "charging mode" (CM) or are even too lazy to make a macro for their own, I share here a short MacroDroid macro.

If activated by the widget, you can choose either of these two modes to toggle between. For "safety reasons" unplugging the charger will also switch acc back to CM.

The macro uses the "acc -d" command to switch to BIM but instead of using (logically!) the "acc -e" command to return to CM, the macro will restart the daemon, since "acc -e" failed to work as desired for my phone.

Initially, I wanted to include as trigger to activate BIM automatically the launching of one of several predefined apps, but this didn't work reliably with my phone (the macro fired again and again). For sure you are welcome to adapt or improve the macro according to your needs.

If you want to use the macro, download it, rename it to .macro and import it. Define a widget which will run the macro if opened.

This macro will only work if your phone and acc setup (kernel, charging switch) support the battery idle mode!

* BIM prevents charging of your phone when you e. g. run apps with a high CPU-load (games, navigation) for a longer time and therefore with the charger plugged. BIM lets the charger power your phone directly without charging the battery and therefore without (over-)heating the battery which is unhealthy. So far the theory behind BIM..
[Magisk] SebaS-DG:
Hello!, Im using crdroid rom and ACC in my poco x3 pro

https://xdaforums.com/t/rom-13-0-crdroid-9-official.4516191/

resume is on 40% and 80% stop

BUt is charging to 100% stop and start again at 99%

What I can do?

I installed ACC in my 4 phones note 7, note 6 pro, note 9 and all seems fine but with lieneageos rom

Edit:

Tried:

cooldown temp = 25

max temp = 29

Now is at 32° and is charging when it drops to 99% to 100% all the time

edit 2:

reboot the phone, let it went down to 98%, plug and is charging to 100%

Edit: not sure what I touched, now is working.
[Magisk] Uluru25:
... most likely rebooting helped.

🤠
[Magisk] magi44ken:
I need some feedback for those who are using wireless charging for battery idle mode. How is the battery life compare to using USB charging? Does it heats up to uncomfortable level to hold the phone?

Base on my research, when using power bank to wireless charge your phone, it uses at least 25% more power than USB charging.

Some power bank that is not well design can cause the phone to heat up too much that is bad for the battery.

Now I wonder it will be different if use wireless to power the phone in battery idle mode.

Please share your experience if you using wireless in idle mode.

Thanks
[Magisk] eried1:
Hm. Not resetting automatically. Tried it on two different phones on LOS A11. Same problem with BCL - only works manually 🤔
[Magisk] eried1:
Have exactly this issue on A5 2017. Snapdragon.
[Magisk] eried1:
Any difference from the manual reset in the front app? The default configuration for auto reset is not working in my case.
[Magisk] eZ7whZq:
Not much is happening:

This may take a while... ⏳
Ensure the charger is plugged 🔌
timeout: can't execute '10': No such file or directory
Hang on...
switch: - (N/A) current: 0mA (Discharging)
switch: - (N/A) current: 0mA (Discharging)
Ensure the charger is plugged 🔌
Press CTRL-C to quit
switch: - (N/A) current: 0mA (Discharging)
switch: - (N/A) current: 0mA (Discharging)

As it apparently fails to detect the current it does not even start testing the switches.

It does detect though the voltage and the status (disregard the Discharging below, it says that when sitting at 100%, prior to that it says Charging):

Battery Service
AC powered: false
USB powered: true
Wireless powered: false
Max charging current: 0
Max charging voltage: 0
Charge counter: 0
status: 2
health: 2
present: true
level: 100
scale: 100
voltage: 4184
temperature: 350
technology: Li-ion

Uevent
CAPACITY=100
CURRENT_AVG=1
HEALTH=Good
ONLINE=1
PRESENT=1
STATUS=Discharging
TECHNOLOGY=Li-ion
TEMP=350
VOLTAGE_NOW=4184375
CURRENT_NOW=0.00 Amps
VOLTAGE_NOW=4.18 Volts
POWER_NOW=0.00 Watts
CHARGE_TYPE=BATTERY

Edit:

Lowered the charge from 100%, and retried acc -t p, so that it sees the "Charging" status:

1/7: battery/charging_source 1 0
switch: off (1) current: 0mA (Charging)
Switch doesn't work ❌

2/7: battery/batt_lp_charging 0 1
switch: off (0) current: 0mA (Charging)
Switch doesn't work ❌

3/7: battery/video 0 1
switch: off (0) current: 0mA (Charging)
Switch doesn't work ❌

4/7: battery/mp3 0 1
switch: off (0) current: 0mA (Charging)
Switch doesn't work ❌

5/7: battery/batt_full_check 1 0
switch: off (0) current: 0mA (Charging)
Switch doesn't work ❌

6/7: battery/siop_activated 0 1
switch: off (0) current: 0mA (Charging)
Switch doesn't work ❌

7/7: battery/batt_lpm_state 0 1
switch: off (1) current: 0mA (Charging)
switch: on (0) current: 0mA (Discharging)
Switch doesn't work ❌

And as said above:

I'm not getting any crashes though, just nothing is happening.

So, stopping the charging is indeed possible.

Are there any crude ways to try and reset the driver/controller? Like reload the driver or something?

Spoiler content hidden.

Spoiler content hidden.

What about those uevents? Is there a way to send something this way?
[Magisk] Uluru25:
Try this:

1) open a terminal app with granted root

2) enter "su" and then "acc -u -f dev"

3) reboot the phone after update is completed

4) again open a terminal

5) enter "su" and then "acc"

6) check if the daemon is running

7) if not, enter "4" to (re-) start the daemon

8) now plug the charger (important!)

9) now enter "b" to test the charging switches

10) take a coffee (since it takes some minutes)

11) close the app, unplug the charger, and reboot the phone

12) wait 1 minute and try if acc now works

Steps 3, 11, and 12 may be not necessary but could help.

Step 2 will update acc to the latest available dev-version which is the most up-to-date version including additional charging switches.

Good luck!

🤠
[Magisk] eried1:
The front app force closes for me if I change switches or configure anything else than only the charging interval. Will try do everything manually.
[Magisk] Uluru25:
Dare to switch to the terminal control!

Basically, you only need the command "acc -s xx=yy" in most cases, whereby xx represents the parameter you want to change (e.g. pc for pause capacity) and yy for the value (e.g. 80) so that charging will stop at this level.

Nevertheless, it is strongly recommended to read the documention available here.

🤠
[Magisk] eried1:
Terminal is much smoother than frontend app! Let's hope it works now. I am using a 5W charger to make sure never to quick charge - maybe disabling QC can be done through settings IF kernel supports it.
[Magisk] Uluru25:
I am glad that one more guy left the dark side of the force!

🤠
[Magisk] magi44ken:
Hi, I wanted to a question. You mention you have wireless and wired battery idle mode on your Pixel 7 Pro. How's your experience with wireless battery idle mode compare to the USB one? For example, does wireless battery idle mode gets very warm and maybe uses much more battery life? Which ROM are you using?

Really appreciated any feedback you can provide. I wanted to see if wireless battery idle mode is worth using.
[Magisk] VR25:
Looks like your devices does not report the charging current (or perhaps it uses a weirdly named interface for that).

See if you get lucky after running acc -s bsw=false; accd -i
[Magisk] VR25:
Release v2023.8.12 · VR-25/acc

v2023.8.12 (202308120) -H|--health : Print estimated battery health -r|--readme now sends intent to open README.html Additional charging switches Fix set_temp_level() Fixed one-line scripts identi...

github.com