yashsingh1/xdaforums huggingface dataset:
[Magisk] samhhmobil:
Thanks for this step.

Of course no gui is installed (I hate it).

1) see screenshot, gihubusercontent doesn't seem to work since a few days. But acc is actual version v2023.10.16 (202310160), log is attached.

2) reboot done

3) uncharged to 65%

4) charger plugged in for test "acc -t", log attached

5) reset done, config.txt (here config-01.txt) attached

6) got now: "discharge_polarity is not set"

7) unplugged charger and got: "discharge_polarity set successfully!"; automatically new created config.txt attached (here config-02.txt)

Now it should stop charging at 75%. Correct? But...

8) see screenshot of terminal: accd is running, but battery is at 76% and charging (but it should have stopped charging when reaching 75%)

So... what's to do now?

Thanks a lot,

samhhmobil
[Magisk] knasiotis:
acc is not found as a command in termux, even if i am in su mode
[Magisk] eried1:
Module is properly installed and enabled in Magisk? You are rooted according to installation guidelines? You are sure that you have root access, so that it wasn't lost or anything?
[Magisk] knasiotis:
Of course I have root, the module also works which is weird because I can't access it from the terminal (using kitsune mask with enforced SuList btw). I also rebooted my phone multiple times
[Magisk] Depressed T.Bear:
Same here, as I reported yesterday :/
[Magisk] Uluru25:
... did you enter first "su" and then "acc" (or in 1 step "su -c acc")?
[Magisk] Uluru25:
1) if updating via "acc -u dev" still fails, download the latest dev build from here or here.

2) after having tested the switches, run "acc -ss" and manually select one of two switches shown as 3/24 or 4/24

3) check again with the default config if acc works and if charging is stopped at the pause capacity. Don't worry if it exceeds pc by 1 or 2 %...
[Magisk] eried1:
I have had a bunch of problems with Kitsune. Eventually reverted back to original Magisk.
[Magisk] knasiotis:
I can't run certain apps without it
[Magisk] Elux:
Hi,

unfortunately I seem to have a problem with ACC adhering to the defined limits. Sometimes it's working, sometimes not.

See for example the attached screenshots.

As you can see in the config, the current pause capacity is 75%, but the phone keeps charging above as seen in the battery level screenshot (green). On top of that there's a gap in the graph of the battery level that I cannot explain.

While asleep the limit was at 50% and it was correctly adhered to (red). Before my alarm goes off, Tasker sends an acc command using shell and root to adjust the Pause capacity to 75. This was working correctly (yellow) but it was not plugged long enough to test the new limit.

Afterwards I switched the charger (between yellow and green). With both I ran a charging switch test beforehand and the manually set switch was working for both with idle mode supported. Automatic switch choice failed on me before and the phone charged to full over night.

All in all I'm quite lost, what to look at.

Currently I'm using v2023.12. 25-dev (202312250).

Maybe someone can give me a hint into the right direction?

Thanks in advance :)
[Magisk] Uluru25:
... some hints from my side:

1) the three temps rt, ct, and mt are not logical: change rt to e. g. 30r so that rt < ct < mt < st is true. Don't forget the trailing "r" after the rt definition (use "acc -s rt=30r"). One more comment on that later...

2) you have set both a cc condition and a ct condition. This is possible but may lead to unwanted behavior. I would inactivate cc by "acc -s cc=101"

3) in both cases described in 2) your config lacks what to do in case of reaching a cooldown scenario: either define a cch/cp pair (e. g. "acc -s cch=50 cp=5") to toggle between 50 sec charging and 5 sec not charging) or define a reduced cooldown current (e. g. via "acc -s cdc=500"). You could also combine this, so that during the cch phase charging happens only with the reduced cdc current. I would use only cdc w/o additional cch/cp settings.

4) meanwhile (especially with the acc build you have installed) the inbuilt profile scheduler of acc works pretty reliable and is much more easy to configure. Therefore I would stop the tasker job and define profile changes via acc itself. Let me know if I can help you (just tell me what your profile switches should be).

Coming back to your rt, ct, mt, st settings. Since you seem to live in Germany and are not challenged by too high temperatures, I would define much lower limits in order to increase battery longevity: I use here 32r 34 35 50 which you could set via "acc -s rt=32r ct=34 mt=35 st=50"

I don't know if this will fix your issues, but give it a try...

🤠
[Magisk] Elux:
Thank you for the hints regarding the cool down parameters. Actually I just used the default config without further adjustments.

I change my config according to your suggestions and give the acc profile scheduler a try again.

Today the limits seemed to be working. I'll keep an eye on it and see how it behaves in the future.
[Magisk] samhhmobil:
I tried via your links (v2023.12.25-dev and now v2024.1.7-dev), but there is only the "source.zip", and — of course — that is not installable.

samhhmobil
[Magisk] Uluru25:
... just update via acc -u -f dev diectly to the lasted build or try acc -u v2023.12.25-dev --force

Does it work?
[Magisk] laur89:
On my system this returns nothing. I've been filtering acc-i output via grep:

# acc --info | grep -E '^[[:space:]]*(HEALTH|CAPACITY=|CURRENT_NOW.*Amps|POWER_NOW.*Watt|VOLTAGE_NOW.*Volts|STATUS|TEMP)'
CAPACITY=61
HEALTH=Good
STATUS=Discharging
TEMP=236
CURRENT_NOW=-0.22 Amps
VOLTAGE_NOW=3.98 Volts
POWER_NOW=-0.88 Watts

But now having learned of acca, this can be simplified to

acca -i | grep -E '(CAPACITY|HEALTH|STATUS|TEMP|CURRENT_NOW|VOLTAGE_NOW|POWER_NOW)'
[Magisk] liott:
When I plug in my device, the battery level drops rapidly (4.8%/h).

Like a wakelock; I can't find any information about usb_notify and usb_work. Any suggestions?
[Magisk] Uluru25:
... how might this be related to acc?
[Magisk] Gilg@mesh:
what is the recommended settings for Pixel 8 Pro? I want it to charge to 95% or less if it's recommended, but I don't keep my phone's very long, max 2 years, I live in Sweden (Stockholm)
[Magisk] android.outliner:
For my Pixel 7 (Android 14) the old switch I used (gcpm/constant_charge_current_max 1933090 0) did not work any more after the December Update. It seems as if the file is readOnly now.

acc -t only suggests a single working switch with idle mode. I have been testing it for a while now and it works like a charm (including idle mode).

The working Pixel 7 switch:

/sys/devices/platform/google,charger/charge_stop_level 100 battery/capacity
[Magisk] Uluru25:
... what do you mean with "recommended settings"? Are you asking for a charging switch or for tge configuration of the other acc settings like pause etc.?
[Magisk] Gilg@mesh:
haha I dunno, how do I install the switch? acc settings with termux works too as I've been playing with it.
[Magisk] android.outliner:
Simple Tasker GUI for acc

After you have successfully set up acc with a working switch, you can use the attached VERY simple Tasker script/scene with a GUI for the most important acc commands. The output of the commands is shown in a scrollable text view at the bottom.

The main task is "AccActions".

Connect a Tasker widget with the task for a quick access from the launcher.

acc -s Print config
accd, Print acc/daemon status (running or not)
accd Start/restart accd
acc 80 70 Charge from 70% to 80%
acc -f 95 Charge once to 95%
[Magisk] trevtdogg:
if you are talking about when the battery is between the level to start and stop charging, I believe this is a known issue - and a solution has not yet been found for.

eg. I have set my device to charge to 80% then stop, and not to start charging again until it goes under 70%. but once it hits 80%, if I leave it plugged in, the battery drains fast down to 70% until it starts charging again.

if it's unplugged at 80%, it goes back to the normal slow drain instead.
[Magisk] Uluru25:
1) deinstall all guis like Acca or acc settings

2) then install the latest stable build e. g. from here in magisk

3) reboot the phone

4) open a terminal

5) enter su and grant superuser rights if asked for

6) update acc to the latest dev build via acc -u -f dev

7) start reading here (and go back the links) to let acc check the available switches via acc -t

Keep in mind that acc will automatically check for working charging switches, but that you can define it manually if you have identified one.

🤠
[Magisk] Gilg@mesh:
I've followed everything now and chose the switch which enabled idle mode, anything else I need to do? thanks
[Magisk] Uluru25:
... use it with the standard configuration or adapt the settings as you want them...

🤠
[Magisk] samhhmobil:
May I remember:

Phone is OnePlus8 (IN2013, instantnoodle),

OS is LineageOS20 (Android13)

(1) Yes, now online update did work again. It is now v2024.1.7.2 (see screenshot)

(2) phone is rebooted

(3) Battery level is approx on 65%, charger is plugged in

(4) "acc -t" was running (see logfile)

(5) reset via "acc -s r" is done, immediatly ther was a popup, "discharge_polarity is not set" (see screenshot)

(5a) so I did plug out the charger and in again,, the next popup "discharge_polarity set successfully" (see screenshot)

(5b) config file even in attachment

(6) What's more to do? It even does not stop charging at 75%

Very strange looks, that "discharge_polarity" was automatically set to "-" in acc-v2023.10.16,

but now, in v2024.1.7.2-dev it is set automatically to "+". So I had to run (4) "acc -t" with the new config-settings again.

But... What the hell does that mean? (stable release sets to "minus", dev-release sets to "plus"?)

May be there is a bug in LineageOS20 for the OnePlus8?

Because... ... with LineageOS19(Android12) acc (of course older version) did work flawlessly well.

Thanks a lot,

samhhmobil
[Magisk] Uluru25:
In case your rom provides any smart charging features in it's settings, disable these first. Then reboot once (only to be on the safe side). Then check in the terminal if the daemon is running (just enter su, then acc) and let the phone charge. According to your config it should stop around (!) 75 %, thus watch how far charging goes and let me know.

🤠
[Magisk] Uluru25:
Your support is appreciated!

As you may know, I am writing some macros (shared here with interested users) dealing with acc.

In order to better understand whether the acc command acc -i (or acca -i) returns for different phones always the same info or whether this might slightly differ from phone to phone, I kindly ask you to run the following commands in your terminal (without the quotation marks ""):

1) "su"

2) "var=$(acca -i); printf "$var" > /sdcard/Documents/result_acca-i.txt"

and then pm me the created file (which you can find in your Documents folder within your internal memory.

The result will look like the attached one from my phone.

Thanks!
[Magisk] indo man:
When battery limit reaches (80%), is it safe to leave the charger connected for a long time?
[Magisk] Uluru25:
... firstly, a lower value would be better. Does idle mode apply or is toggling between charging / discharging?
[Magisk] indo man:
does status "not charging" means idle mod enabled?, if yes than its on idle mode
[Magisk] Uluru25:
idle mode is working if you could let the phone connected to the charger when it has reached the defined pause capacity and if then for several hours (or during use) this capacity remains at this percentage*. You could also check in this condition if a charging current is applied (should be not).

* for sure, between pause and resume capacity there should be a difference of 5 % or more.

If your phone could run in idle mode, a charging percentage "in the middle range" would be optimal. 80 % is far better than 100 % but 60 - 70 % would be a little better. 😁
[Magisk] indo man:
i understand, thank you
[Magisk] samhhmobil:
Here I'm back again.

LOS20 (Android13) has three switches (Battery Saver, Battery Manager, Charging Control). All three are disabled.

Phone is rebooted.

accd is running.

But... acc does not work, charging isn't stopped around 75%.

It seems, I should give up. It doesn't work, sigh.

samhhmobil
[Magisk] Uluru25:
I recommend you to join the dev's tg-group, being sure that your problem will be solved there.

🤠
[Magisk] samhhmobil:
I don't have any connection to TG, sigh.

samhhmobil
[Magisk] eried1:
Any way to activate idle mode immediately after charger is connected? I was thinking of having Tasker return the current battery percentage level and have PC=RC=Current level+1%. The 1% to allow for some adjustment time.
[Magisk] Uluru25:
... sure! Read also here.

But are you aware of the rather new feature of acc to define one (or more) apps which - if running in the foreground - automatically set acc to idle mode?

idle_apps (ia) # Default: null

This is a list of comma or space separated patterns matching Android package names.

When a matched app is running in the foreground, idle mode is enabled.

e.g., idleApps=(maps navig somegame) or idleApps=(maps,navig,somegame) or mixed

Could be a way smarter solution for you...

🤠
[Magisk] Napafroi:
Me as well, with version 2023.10.16, if I run acc / "Test charging stats" I get "Terminated".

On the other hand using Front-End Acc Settings ( version 2022.6.4), the test runs correctly.

It's an old J3 Samsung [2016]; LineageOS 14.1 with a Magisk 23.4 version (updates cause Magisk not to work for obtaining root rights).

See on screenshot #1 the WARNING unsupported flags
[Magisk] Uluru25:
Try with the latest (dev) build via "su", then "acc -u -f dev". You should get at least build 202401280. Let then acc try to find a switch without manually searching for.

🤠
[Magisk] Napafroi:
Thx, shame on me, I get an error when trying to update to dev build with "acc -u -f dev" :

curl: (4) A requested feature, protocol or option was not found built-in in this libcurl due to a build-time decision.

tar: invalid magic

tar: short read

Please could help me to manually download dev build because for some reasons I failed : I tried acc-2024.1.19-dev.zip but again I get an unzip error :oops:

EDIT : also unzip error with acc-2024.1.28-rc.zip
[Magisk] Uluru25:
... then try either flashing via magisk or enter "su" and then "acc -F" (case sensitive F!) so you are prompted to choose where the zip-file is.

🤠
[Magisk] Napafroi:
It really doesn't want.🤔
[Magisk] Uluru25:
... seems to be nothing caused by acc. I assume you have magisk as root solution? If not, check here what to keep in mind.
[Magisk] BarrettBear:
I've recently started having trouble with this today when I noticed my phone wasn't charging.

Details are below

Device: Pixel 6 Pro

Android: 13

Build: TQ3A.230901.001

Magisk Version: 27.0 (27000)

Magisk App: 27.0 (27000)

ACC Version: v2024.1.28-rc

ACC App: 1.0.35

ACC Settings:

Capacity Control:

Shutdown: 5

Resume: 70

Stop: 80

Charging Switch: Originally set to Auto, now defaults to "/sys/devices/platform/google,charter/charge_stop_level 100 5"

Auto cycle through switches: ON

Charging Power Control:

Off

Prioritize battery idle mode:

OFF

Temp Control:

Cooldown: 35

Max: 50

Pause sec: 49

Cool Down:

OFF

Apply on Boot:

OFF

Apply on Plug:

wireless/voltage_max::9000000

Misc:

BOTH OFF

When I plug it in via USB it works perfectly fine, however the two wireless stands I use now jump between Charging, and Discharging, while the "Charging Speed" varies wildly (It does not do this via USB).

If it were just one of my stands I'd consider it a hardware issue, but not both, on the same day, with the same issue.

Before today it worked perfectly fine, I'm at a loss as to what has changed, perhaps a background system app has updated and skewed something?

Edit: I ran through the "acc --test" via terminal, and it pooped out the attached file. I'm currently trialing the 6th switch, "dc/current_max 250000 0", which so far has been good. I'm still confused as to why my OG switch suddenly decided to have a heart attack though :'(
[Magisk] bsimpson1:
I have a control file to enable/disable charging, and I also have a control file that can limit the charging current all the way down to battery idle mode (0mA), but how to i configure ACC so that it can enable/disable charging with one switch and also enter/exit battery idle mode with the other? how do i tell it which control file can be used for battery idle mode?

I guess the real question is: Is it possible to have the daemon disable charging as well as enable battery idle mode depending on the circumstances, or do i have to choose one method or the other?
[Magisk] Uluru25:
... you only need 1 switch. Use the switch which showed idle-mode support after testing with acc -t.

Battery idle mode means firstly that when chaging has reached your pause_capacity that then not the battery but the charger powers your phone. Secondly, a switch which supports idle mode allows you to manually switch on / of charging while plugged to the charger and/or even set automatically to idle mode when certain apps are running in the foreground (e. g. navigation apps).

Tell me what you are looking for...

🤠
[Magisk] Uluru25:
... if you describe more clearly what you exactly mean by "depending on the circumstances" we can try to help you...

🤠
[Magisk] bsimpson1:
Okay, so I was reading on the github page that keeping the battery at full capacity for long periods of time degrades its lifespan.

I would like to know if acc can be programmed to disable charging completely when the phone is plugged in and the battery level is above say 65% so that it can discharge. When the battery level drops to somewhere around 50% I would like it to activate battery idle mode.

The problem is that my phone doesn't have a single switch that can enter all 3 states (disable charging, idle mode, enable charging). Instead, it has a control file that can enable/disable charging, and another file that controls the current which can activate/deactivate battery idle mode but not completely disable the input.
[Magisk] Uluru25:
... you would need to

1) set prioritize_batt_idle_mode (pbim) to "false" when reaching a capacity of 65 %

2) set prioritize_batt_idle_mode (pbim) to "true" when reaching a capacity of 50 %

3) set pause_capacity to 65 %

4) set resume_capacity to 50 %

This would

1) start charging your phone if the capacity drops to or below 50 %

2) stops charging at 65 %

3) "ignores" when reaching 65 % that the charger is plugged and will drain the battery until 50 % is reached

If the 1 switch which supports battery idle mode really doesn't match these modes (can't believe but I don't want to put in question what you wrote) you could set the needed charging_switch via acc -s s= "xxx" (I guess it will need quotes for the charging switch).

Acc is providing one-line-scripts but I know them only to fire at given times and not at given charging states. But I also know that the dev frequently provides in his TG-group valuable support for such questions. So maybe you ask there...

On the other hand side, such changes depending on the charging state can easily be fired by a macro app (I use MacroDroid, but Tasker etc. should be able to do the same).

Personally, I wouldn't do it so complicated: If your phone is always plugged, I would activated idle_mode (is the default) and set pc=50 rc=45. If you use your phone also unplugged, I would define profiles which charge the phone during the night only to 50 % and which continue charging to 70 % (or what you need to survive the day until the next possibility to charge) in the last 30 - 60 min before you usually need your phone.

Don't care too much! If you avoid charging percentages below 20 % or above 80 % and try to avoid temperatures above 35 ºC or below 15 ºC during charging (only personal recommendations from me, don't take them too strict) you are in a good situation...

🤠
[Magisk] Koeties:
Good morning.

I've now had ACC running on my Pixel 8 for just over a month. The main usecase for me is to limit the max charge and then to have idle mode maintain that level throughout the night. So far it's working as expected in that sense.

But recently I got a new power brick to boost the charging speed (my old brick was not up to the task) and I've noticed that ACC seems to limit the charge rate to around 12%/h. It seems to limit the current to around 1000mA max, with it hovering between 700mA and 900mA most of the time. If I disable ACC and plug in the charger it quickly goes up to the high 2000s or even above 3000mA.

My config is the default with only the charging switch changed to one that supports idle mode. There are 4 switches that works with idle mode and all of them have this symptom of limiting current. I've not tried other switches as that defeats my main usecase. I also played around a bit with the temperature settings but that didn't have any effect, so I reverted to default.

Does anybody have any idea what I can try to get ACC to let through more current?
[Magisk] Uluru25:
First, update to the latest build via "su" then "acc -u -f dev". Secondly, if the issue still persists, test again the charging switches with the new charger plugged to the phone.
[Magisk] Koeties:
Updating to the dev version worked. Thanks!
[Magisk] Uluru25:
... glad to hear!

Unlike dev-builds for some other software, updating to the latest acc dev-build is not a painful ride on the razor blade but a good idea towards stability, issue solving, and new features - thus, stay always updated!

🤠
[Magisk] sosimple:
Hi. I have a galaxy note 8. Can i use this to make charging stop in 80%? How, thanks?
[Magisk] sic0048:
Yes. Read the materials on Github.
[Magisk] Uluru25:
... dare to search and read in this thread. Start e. g. here
[Magisk] sosimple:
Thanks, this is really helpful because the thread is huge..
[Magisk] VR25:
[MENTION=356675]McM[/MENTION]otherEffin, I'll take a look. Thanks for all your suggestions -- definitely refreshing my ideas. :)

[MENTION=7217268]x1reN[/MENTION], that might be linked to the lag issue. Have you tried "...debug-2.zip"?

Known causes:

1. Magisk version greater than 14.3

2. F2FS bug

3. cs doesn't like you :p
[Magisk] x1reN:
Just the normal debug command? Or what do you mean?
[Magisk] Jaymin.0.1910:
Thanks a lot
[Magisk] Sachitoge:
How can I grab it for MacroDroid? I tried with su command but I dont know why it failed, maybe I did it wrong.

Is there anyone who can share their setup for MacroDroid task, and/or help me somehow get it ready for MacroDroid through some sort of command? Not sure how, need help quote me thanks.
[Magisk] guest4711:
The last zip (a test version) in post#2: https://xdaforums.com/apps/magisk/module-magic-charging-switch-cs-v2017-9-t3668427/post73676133
[Magisk] x1reN:
Ah thanks, will give it a try later
[Magisk] Sreekantt:
Ha ha...it was working flawless before d new update which is causing terrible lag...

I don't remember exact date but 19th november build was flash & forget on my device
[Magisk] Sreekantt:
For all those who r having lag problems as of now....u can try this build...it used to work flawlessly for me... Luckily found it in archive backup
[Magisk] :
Can someone help me understand exactly what this module does? Like using the default limit of 85 and min of 10, does this mean that if I plugged the charger in at 50%, it would charge to 85, stop and then won't charge again until it hits 10%? Im confused, or would the phone not charge at all between 85-10? Thanks!
[Magisk] guest4711:
Yes, you are right. It will charge until it reaches the max value and then stop charging until the min value is reached. Then it will try to charge to the max value again .. and again .. and ...
[Magisk] :
But let's say I charge it and it hits the top limit 85... I wake up in the morning and it's at 84 and during the day it goes all the way down to 45. Then I want to charge it again. Do I have to wait until it hits 10% to charge again or will it starts charging right away again till 85%? That's my question I guess
[Magisk] guest4711:
If you disconnect the power supply and reconnect it it will start charging again while < 85. Or if you restart the service.

The min value is useful to avoid frequent charging cycles while using the phone with power supply attached.