yashsingh1/xdaforums huggingface dataset:
[Magisk] pdmr:
Hi! I swapped out my phone battery two weeks ago, from the original one to this AE brand (Nohon). I'm not an expert, but it seems like the new battery isn't hitting the advertised or expected performance. In the screenshot, the left side is the original battery, and the right side is the new one. I find it odd that the charge_full_design is identical in both batteries, but the charge_full_raw is lower in the new battery. This was based on a comparison I did on the installation day.

Today, I conducted a test with an ammeter, from 9% to 100% battery, and it charged 2605 mAh. Adding the 9% would give a capacity of 2862 mAh, which would align with the charge_full_desing.

Right now, ACC is giving me these values:

BATTERY_HEALTH=93

BATTERY_TYPE=OP_3300mah

BQ_SOC=95

CAPACITY=95

CAPACITY_RAW=235

CC_STEP=0

CC_STEP_SEL=0

CHARGER_TEMP_MAX=812

CHARGE_CONTROL_LIMIT=0

CHARGE_CONTROL_LIMIT_MAX=4

CHARGE_COUNTER=2654396

CHARGE_COUNTER_SHADOW=2648321

CHARGE_DONE=0

CHARGE_FULL=0

CHARGE_FULL_DESIGN=2878000

CHARGE_NOW=0

CHARGE_NOW=19

CHARGE_NOW_RAW=2654396

CHARGING_ENABLED=1

What do you guys think? Thanks."
[Magisk] gnirtS:
Ive just done a clean install on my Samsung tablet S5E using Lineage 20 (nightly) and Magisk-Delta. All good on the install - everything works, root is OK etc but NOT ACC.

Ive installed it, no errors but it isnt working at all.

On boot i get "discharge_priority is not set. Please unplug and wait a while". Its been several days now and that never disappears no matter how long i wait. I have no idea how to set it manually and the docs arent helping.

Any ideas?

Also if i run acc and run "Test charging status" option, i just get "Terminated" appear and have to CTRL C or close the window. Nothing happens further.

ACCD is running according to the wizard.

On running ACCA all appears normal etc but again it doesnt work, it just goes to 100%. The logs appear empty.

In short, it always seems to charge as normal to 100% no matter what i set ACC or ACCA to, i also get the discharge_priority notification.

Any idea how to fix? Previously on an older lineage and ACC build about 6 months ago it worked perfectly.
[Magisk] drmarble:
Lineage 20 on the s5e has charge control built in. No magisc required. It is in settings->battery->charging control. It works great for me.
[Magisk] gnirtS:
That doesnt give me the option to set specific levels to charge, resume, temperatures or anything else. Charge control on that just seems to be like the "Adaptive charging" on AOSP/Pixels where it'll slow charge based on alarms or usage patterns. But it still goes to 100% battery which is why im trying to avoid.
[Magisk] drmarble:
There is a limit you can set. It works. I'm set to 75%.
[Magisk] Uluru25:
... have you plugged in the charger and the unplugged? Else lookhere

... have you tested the charging switches according to the wizard or to the terminal commands?

... have you deinstalled any front ends like Acca or Acc settings so that only acc runs?

... have you verified to run the latest build "acc -v" or updated via "acc -u"?
[Magisk] Schmye Bubbula:
Can somebody help me pick which charging switch to use in AccA? We're told to just test them and use one that works, but I can't make hide nor hair what they mean, and their titles seem so specific that I can't help but fear that I'd choose one out of three or four that pass the tests with which I would be shooting myself in the foot! My use case is here:

[HELP] AccA charging switches

AccA is supposed to be, "developed with ordinary users in mind. It targets mainly people and aliens alike who feel uncomfortable with terminal." But I am bewildered with how to choose a charging switch, or comprehend what they all mean! If I...

xdaforums.com
[Magisk] Zaxx32:
Same here...3 tested good (1 w/ working idle) but I do not know what to look for on my P6a. Finally gave up and installed the 'Charge to 90%' magisk mod for P6...works great but no fine control or idle passthru.

Is there NO telling by the switch specs for a given phone model?
[Magisk] Uluru25:
1. Forget the front-ends like Acca or Acc Settings and deinstall them.

2. Install acc within Magisk

3. Install a terminal, e. g. this.

4. Follow the guidance provided in this thread, e. g. here.
[Magisk] Zaxx32:
Ok....so install newest ACC, test switch, set the 'good' switch with idol.

Begs the question, if one doesn't know the commands, parameters and arguments...where do I find a noob-friendly guide?

The only thing I want is to stop charging at 90% and it to trigger idle mode on/off when needed...nothing fancy really. Could you just give me that much? Plz...

I assume it uses a control or config file to store these settings and load them at boot...I don't know where it's kept or how to add 'stop at 90%' and 'idle when needed' instructions.

I'd bet these are the most commonly desired settings among potential new users of ACC. Tia for any assistance...
[Magisk] Uluru25:
1. Here is the manual

2. here is the config.txt: /data/adb/vr25/acc-data (NEVER edit it in Windows)

3. enter this command in a terminal app with root privileges: "su", then "acc -s pc=90"

4. scroll through this thread, several guidances and links are still available

🤠
[Magisk] Zaxx32:
Awesome...

I assume I don't have to do this everytime every reboot?

Thx again man!
[Magisk] Uluru25:
... do it once and let it run...
[Magisk] Schmye Bubbula:
Set my text editor line endings to linefeeds — LF (\n), right?
[Magisk] Uluru25:
... never tried, but could work.

I took the warning from the dev

# WARNINGS

# Do not edit this in Windows Notepad, ever!

# It replaces LF (Linux/Unix) with CRLF (Windows) line endings.

serious and could modify the config.txt always via the terminal or via a root explorer in Android.

you could also open the config.txt via "acc -c g" so that you can choose an editor to do so.
[Magisk] Zaxx32:
So...install latest ACC, open Termux, set switch then set my % and I'm done? No need to touch the config file? Awesome.

Sry...just get nervous when I dunno wtf I doin'...🤔😆
[Magisk] Uluru25:
... that's it!

But I am sure, if you read the documentation you will get "hungry" to do some more modifications, e. g. limit the charging current and/or control the charging process acc. to the battery temperature etc.

If you dare to take the next steps (now with this very first command you are standing upright, but your legs could also help you to go or run)...

🤠
[Magisk] Schmye Bubbula:
But now I'm back to, which switch to use? I don't even know what a switch is. It says to run tests and pick one that passes, but their names seem so disparate that I'm afraid that if I just blindly choose one switch out of, say, four that might pass the test, that it will be inappropriate for my use case and I'll be shooting myself in the foot!... Is there not a list anywhere that describes exactly what each of the switches does?

Goddamnit, I just want to set a max %, a resume %, and I don't know what a switch is, and don't know whether it's best for the battery to prioritize battery idle mode (or whether my Pixel 4a (5G) even supports it — it seems to stick, and not cycle back & forth however I set it, but when I do the test in AccA, it just runs forever) for my use case of just holding at 40% or 30% most of the time day-to-day (Battery University recommends both for long-term storage in different articles, grrrr), and effectively just running the phone off external power.
[Magisk] Uluru25:
... did you follow the hints I gave you in my last answer (and started with deinstallation of any front end) and then read (and did) what was referenced by me?

I am asking since you still refer to Acca (which is the frontend you shouldn't use if you expect help here)...

If you did and have been informed about more than one working switch just try the first one. And even this is not necessary since after having run the test for the switches, acc will remember and use those which you work.

If the result has shown that idle mode is supported (by your kernel) idle mode will work.

See attached my output of the wizard test for the switches: several are working but only one (no. 4) is supporting idle mode.

Don't be afraid to make a mistake you can't correct later. Nothing is changed permanently, if you as a ultima ratio deinstall acc, all modifications will disappear and stock charging behavior of your phone will be present again

🤠
[Magisk] Schmye Bubbula:
Well, I already had ACC installed as a Magisk module — which I had to have done, anyway, to even use the AccA front end, no? — and it's the same ACC, isn't it? Or isn't it?... And I didn't think I had to overtly deinstall AccA to try the command line stuff, as long as I turned-off its daemon in AccA, thinking that doing so would avoid any contention. (It's Acca's own daemon, isn't it?, or is it turning off ACC's?)

Anyway, I had started your instructions, and pretty soon it seems like I was up against the same confusion: run tests on all the switches and pick one that works. What's the difference from doing the same thing in AccA? (Or is your point that AccA should be abandoned because it's broken or something?) Either way, I still don't know what a switch even is, and VR-25's switching page is 404:

https://github.com/VR-25/acc/blob/dev/acc/install/ctrl-files.sh)

...and I still wouldn't know which of the three four switches that might pass the command line test to pick appropriate for my use case because I don't have a list of exactly what they all do.

Look, I majored in math & physics, but I still want something that passes the grandma test. I have a life — computers should be doing all of this for me; I shouldn't have to spend my life futzing with a computer! I started with the old Battery Charger Limit 1.1.1, and it plowed right through my upper charge limit. Ditto Charge Control 3.5. Probably because my new Pixel 4a (5G) came with Android 14 on it, damnit. Then I encountered AccA, and it works, if a little flaky, but I don't know which of these charge switches to use. (I'm using one now that *fails* the test, sm7250_bms/charge_disable 1 0, but it's the best one so far, yet I have no idea if I'm shooting myself in the foot somehow.)

Why does this crap have to be so hard?!... I'll keep plugging with your command line stuff, but I'm not so sure that once I find the best switch, and right prioritize battery idle mode setting, I won't go right back to AccA for ease-of-use & user-friendliness for quick adjustments.
[Magisk] Uluru25:
... sorry, but this will be my last attempt to support you:

Either follow what I have told / written starting with deinstallation of any front ends or do it your way. I have not studied maths, physics, engineering etc. and like you completely lack any knowledge on charging switches. Nevertheless, acc (not Acca!) runs for me.

Acca is very outdated, unsupported, and contains a very old acc "engine" which will likely miss features / switches needed to fully run with a newer phone.

You can get the most up to date acc (!) version here which you should flash via magisk after having uninstalled Acca. Then follow the guides here and do what acc eventually prompts you. Finally, to set your pause and resume capacity you only need one command line "acc -s rc=30 pc=40" if these are your desired values. You will see that adjusting (if ever needed) via some very simple terminal commands is easier (and by far more reliable!) than in the front ends!

But step by step: tell me when you have deinstalled the front ends, installed the latest acc (!) via magisk, opened a terminal (which you have grantes superuser rights after entering "su") and the have entered there "acc" to start the wizard and have chosen there "b" to let acc check the charging switches for you...

🤠
[Magisk] Schmye Bubbula:
v2023.10.16 is my ACC Magisk module I've had installed from the get-go.... But it sounds like you're saying that AccA has it's own mini-ACC that overrides it, and that's why I need to completely deinstall it, and merely turning-off within AccA what it says is the ACC daemon isn't enough. OK, that's different, I can do that.... Stay tuned.
[Magisk] Uluru25:
... you can run Acca with a more up to date acc, but don't ask (me) if you struggle with Acca...
[Magisk] Zaxx32:
Heh...thats totally me, once I get my toes wet and like it, I'll dive in or at least wade in...lol Thx again...
[Magisk] Schmye Bubbula:
OK, so now that you say that AccA is using whatever version of ACC I have as my Magisk module (albeit whose hooks into it may be outdated & faulty), and not some built-in "mini-ACC" that overrides it, I gather that AccA is truly just a front end, so I only stopped it before proceeding in Termux because I want uninterrupted use until I can wean myself off AccA. (But I noticed that as soon as I fired up ACC in Termux, it showed up as running again in AccA, so that tells me that it indeed is only a front end.)

So in Termux, I had four that passed both the charging switch & battery idle mode tests:

14/35: main/current_max 2000000 0

15/35: main/current_max 2000000 10000

21/35: sm7250_bms/charge_disable 0 1

22/35: sm7250_bms/constant_charge_current_max 3700000 0

I wonder which is best, if any, for my use case of holding my battery at, say, 30% or 40%, to effectively run my phone all day off external power.

I just happened to have been blindly using the

sm7250_bms/charge_disable 0 1

for the past week with AccA, but as I said earlier, no matter whether I disabled the battery idle mode, it seemed to stick, running solely off external power, and not cycle back & forth between my max & resume levels.... Also, it often went over my max level by as much as 5% before halting, but maybe that's just par for the course. Or maybe those two anomalies will straighten out after I get rid of AccA completely and run everything from Termux.
[Magisk] Uluru25:
... now you can either let acc choose automatically one of the working switches or force one and check if everything works.

For doing so switch the terminal prompt to superuser (root) by entering "su" and then "acc -s s" or "acc -ss".

A list of all charging switches will be shown and you could choose by entering the corresponding number which switch should be enforced.

See the screenshot where I have enforced my cs 4 (which is the only one supporting battery idle mode for my phone / kernel).

Now enter e. g. "acc -s rc=30 pc=40" and check if your phone will start charging only if being discharged to 30 % and then will be charged until 40 %.

Don't worry if the percentages shown will vary by a few units since the percentage of the battery charge is calculated from the voltage of the battery.

🤠
[Magisk] Schmye Bubbula:
I still don't know what a charging switch even is. Say I have things set to limit charge to 40% & resume at 33% — is the charging switch what happens when my charging stops in this example at 40%?... I only kinda sorta comprehend what some of them mean from their titles, but most of them have me bewildered, and

VR-25's switching page is 404:

https://github.com/VR-25/acc/blob/dev/acc/install/ctrl-files.sh

Here are my charging switch tests that passed in Termux. Which is best for battery health (and why) for holding the battery at 40% all day, effectively running my Pixel 4a (5G) phone off the charger? (I've included the ones that failed battery idle mode because I've been running for a couple of weeks on sm7250_bms/charge_disable 0 1 under AccA, which passes, but sticks at 40% and doesn't cycle back & forth between 40% & 33%, anyway, when I have Prioritize Battery Idle Mode *disabled* in AccA.... And yes, I'm going to dump AccA for good when I get settled down in Termux.)

13/35: main/constant_charge_current_max 3700000 10000

Switch works ✅

- battIdleMode=false

14/35: main/current_max 2000000 0

Switch works ✅

- battIdleMode=true

15/35: main/current_max 2000000 10000

Switch works ✅

- battIdleMode=true

18/35: main/voltage_max 4200000 3600mV

Switch works ✅

- battIdleMode=false

21/35: sm7250_bms/charge_disable 0 1

Switch works ✅

- battIdleMode=true

22/35: sm7250_bms/constant_charge_current_max 3700000 0

Switch works ✅

- battIdleMode=true

23/35: sm7250_bms/constant_charge_current_max 3700000 10000

Switch works ✅

- battIdleMode=false

24/35: sm7250_bms/constant_charge_voltage_max 4200000 3600mV

Switch works ✅

- battIdleMode=false

25/35: sm7250_bms/voltage_max 4200000 3600mV

Switch works ✅

- battIdleMode=false

30/35: usb/input_current_max 2000000 0

Switch works ✅

- battIdleMode=false

31/35: usb/input_current_max 2000000 10000

Switch works ✅

- battIdleMode=false
[Magisk] samhhmobil:
Just a (stupid?) question...

ACC sends the notification "discharge_polarity is not set. Unplug and wait, or set it manually."

And (of course), acc is not working.

But "Unplug and wait" does not work, it changes nothing.

So... How can I set it manually, and what's the right value (+ or -)?

Device is Samsung SM-P610, Galaxy Tab S6 lite WiFi, i.e. "gta4xlwifi", LineageOS 20.0 (Android13), ACC v2023.10.16.

Thanks,

samhhmobil

PS

With LineageOS 19.1, or 18.1 acc did work without setting this switch.
[Magisk] Uluru25:
I assume,

a) you run the most up-to-date build of acc (otherwise upgrade with "su -c acc -u"

b) any front-ends like "Acca" or "Acc settings" are deinstalled

then enter "su -c acc", check if the daemon is running. If not start here the daemon.

Plug the charger, let acc check the charging switches and the remove the charger.

If you are still prompted with the discharge polarity message, try to set this parameter manually, see here how.

🤠
[Magisk] Schmye Bubbula:
Would somebody please tell me what a charging switch is?... When does it come into play? How do I decide which to use of the several that pass my ACC wizard test in Termux? (In my experience, auto-anything is auto-stupid, and context-dropping.) I can't find documentation or a post in this thread that tells me what the various ones do. I've googled, "charging switch" until I'm blue in the face, but no hits other than this thread, not finding anything on reddit r/batteries, or on BatteryUniversity.com.
[Magisk] samhhmobil:
==> (a) yes, 202310160

==> (b) yes, of course

==> daemon is running, yes

Plugging in the charger, waiting, and removing it didn't change anything! (Sigh!)

But... manually setting "dp=-" is working now.

Thanks a lot.

BTW, with Android 11 and 12 (LOS 18.1, 19.1) this step wasn't necessary. What's the difference in charge-handling in Android 13 (LOS 20)??

Thanks again

samhhmobil
[Magisk] Uluru25:
I guess you now use a newer build of acc
[Magisk] Zaxx32:
Lil' easy for me as only one supports idle mode...tho I'm too sure how when works. Do I have change the switch back when I don't need or want. What determines when it triggers on and off? If I do have manually change away, then I've choose between 2 others that both passed the switch test. Is there NO decent front end since AccA os outdated?
[Magisk] laur89:
First off, thanks for this great project. Having installed and dipped my toes in it a few questions however came up:

Am inclined to share Schmye Bubbula's concern/question around the switch definition.

Judging from the names, I assume they are logical ways of triggering charging/not-charging states based on different sensor output such as battery voltage, charger amperage et al. Is this a close enough understanding?

Given switch support for "true" native idle mode is stated by the acc -t output, correct?

When charger is plugged in, my phone would still charge to 100% capacity. Only after acc -t was ran it started respecting the default [70 75] limits. Is this expected? Note so far it's been the case both with charging directly from a laptop USB port and via one of them cheap qualcomm fast chargers, i.e. with both of these charging methods acc -t had to be first ran for [70 75] limit to come into effect.

Possibly related to previous - what's the real difference between acc -t and acc -t p? Can't quite grok the meaning from the manual.

Where to see the switch currently being used? Only from the config file?

How to verify actual charge current at any given moment?

Is there any point in regulating both by capacity levels and charge voltage, given they're essentially the same thing?

When phone reaches the pause_capacity and starts depleting the battery towards resume threshold, is it normal for the phone to continue displaying "X% - Charging (rapidly)" (or similar)?

FAQ states following:

How would one define 'too often' in this context and does this recommendation also apply to the emulated (i.e. non-native) idle modes? Asking this as I'm trying to determine the ideal profile for when phone is sat at the desk most of the day.

Troubleshooting has following:

How to determine whether given wakelock switch causes wakelock to be held?
[Magisk] Schmye Bubbula:
All of a sudden, I can't get into ACC any more. It's gotta be something simple. I've given it root in Magisk like I always have. What could my problem be?... Only thing new I've done is install Termux:Widget so after I learn how to use it I can add some shortcuts to duplicate GUI profiles functionality I used to have in my much-missed AccA.... Do I have to find my way into another directory to access ACC?... Gawd, I hate the command line!!
[Magisk] Uluru25:
... already tried to reboot the phone once?
[Magisk] Uluru25:
Trying to give you some answers:

2) yes

3) once (!) acc knows a working charging switch it should always control the charging according to the config (but keep in mind that not all kernels support all functions like mcv-modification)

6) use "acc -i curr" or dynamically "acc -w curr" or use an external app like Wattz or a simple macro logging it

7) yes: a charging percent e. g. 70 % corresponds to a voltage at that charging status. But w/o a limited charging voltage, the max. possible voltage will applied by the charger to reach this percentage. With a limited mcv only this mcv is used and therefore is less stressful for the battery.

9) you did not paste the full text: IMPORTANT: lithium batteries have the longest lifespan when kept about 40-60% charged (about 3.7-3.9ish Volts). That said, try not to use idle mode above 60% too often.

I understand that - if you are permanently plugged to the charger - you should avoid a percentage of e. g. 70 % (since 40 - 60 % are the optimum)
[Magisk] Schmye Bubbula:
Yes, but still as in my screenshot.... I gather that your not addressing my question of whether I need to be in a different directory means that I have some other problem.

I can't stand this; I'm going back to AccA. (The last time I was able to get into ACC in Termux, I looked at my config, and all of the settings I had made in AccA — bundled, although I have the ACC 2023.10.16 module in Magisk, so I have no idea which it's using — capacity control, charging switch, charging power control, idle mode, and temp control; they all made it into my config, so I guess AccA is still working well enough for the basic settings.)

Christ, I all wanted to do, and mostly the only other reason I rooted my phone than to be able to make a proper backup and flush my DNS, is to be able to set a 40% charging limit so I can run my phone at my desk off AC all day. This has become a nightmare from hell!... Back in the 20th Century, I got a Mac to escape DOS Hell; now in the 21st Century, I have to descend back into hell just to do what would be one simple thing in a GUI. This is like going to an Acura dealer and being given the short shrift because the mechanics would rather work on Porsches!
[Magisk] laur89:
Thanks for taking the time

7. makes sense, but wouldn't limiting the voltage then interfere with the capacity limit? Say our max capacity is set at 90% and max voltage is at 4100mV. 4.1V corresponds to roughly 70%. What would be the effective max level in this case? This makes me think perhaps limiting max capacity and max current (instead of the voltage) is a better way to go. What are your thoughts on this?