yashsingh1/xdaforums huggingface dataset:
[Magisk] masscream:
After the last update, my phone started sending me quite annoying notifications "10%-5% to shutdown, please connect your charger." I've found on github that it's natural for the acc daemon when the schutdown capacity is set (have it on 20%), however, before the update these notifications were not displaying. Simple battery indicator is enough for me to know, how many percent is remaining and usually when I don't plug my charger in immediately, it could be due to I'm not having one nearby when I'm somewhere out. These notifications are quite intrusive, displaying every 2 mins or so and cannot be pushed aside or turned off (only with the phone or complete sound/vibrations shutdown). Is there something I overlooked please in the settings or if I hate these notifications I just have to stop using the shutdown capacity function, which was OK for me the way it was before this update? Imho this is not very user friendly "improvement". Thanks
[Magisk] Darth Bidder:
When I installed the app, I got this error.
[Magisk] duttyend:
I have never faced this issue, you should send the information to the developer
[Magisk] robsonline:
I did try a reset all settings. Did not help. I also tried the troubleshooting link. I used the command:

acc -t

It said all of the charge switches "won't work". I finally reset my phone (Complete wipe) thinking I needed fresh start; however, that did not fix it. This all started after the July Pixel 5 update. If anyone has any insight, I would really appreciate it.

Thanks
[Magisk] duttyend:
I'm sorry for you, hopefully someone more knowledgeable can solve this. You could open an issue on GitHub giving as much details as possible (including the troubleshooting you mentioned above)
[Magisk] famusc:
Hi, is there anyone who know which charging switch to use for xiaomi mi 10 ultra (or maybe for the wider used mi 10 pro)? Battery input suspend seems to work but charging starts again almost immediately: seems the system is restoring it.

Thx
[Magisk] famusc:
Another question : do you know how to reset control files modified by acc to their original values? Thanks
[Magisk] crazelee:
I would like to know this too, I saw 2 related configuration on a old readme files. I tried it and it look like not function anymore.

# Change this only if your system reports incorrect battery capacity ("acc -i" (BMS) vs "dumpsys battery" (system)).

capacityOffset=+0

# This is an alternative to capacityOffset. It tells acc whether the battery capacity reported by Android should be updated every few seconds to reflect the actual value from the battery management system.

capacitySync=false

londbell/acc

undefined acc: Advanced Charging Controller

giters.com
[Magisk] crazelee:
Advanced Charging Controller **v2021.8.29 (202108290)** is available

​

**v2021.8.29 (202108290)**

- acc -t <file> skips panicky switches in subsequent runs.

- `acc[d] -x [options] [args]` sets `log=/sdcard/acc[d]-${device}.log`; it's useful for debugging unwanted reboots.

- accd is always stopped gracefully - to ensure defaults are always restored.

This has a potential unwanted side-effect.

Refer to the release note bellow and documentation for details.

- Additional charging switches

- [Beta] if the file /data/adb/vr25/acc-data/warn exists, accd posts Android shutdown warning notifications at sc+10%, sc+5%, sc+300mV and sc+100mV.

- Charging switches set with `acc -ss` are now persistent (i.e., the string " --" is automatically appended to them).

- Enhanced current and voltage units conversion

- Improved fronted support (installers and doc)

- General optimizations

- If charging switch is set to 3700 (millivolts), acc stops charging by limiting voltage.

-

- Implemented workarounds for unreadable battery/uevent and unreliable battery/status (kernel bugs) affecting mainly Pixel and LG devices.

- Set batt_slate_mode as default charging control file for Exynos devices

- Support for plugins, refer to [plugins](#plugins) for details.

- Removed potentially troublesome switches.

- The wizard includes battery info (--info).

- Updated documentation (more information, now with a table of contents and in HTML format)

Release note: plug the charger if the install, upgrade, stop or restart processes seem to take too long.

GitHub - Magisk-Modules-Repo/acc: Upstream repo:

Upstream repo: . Contribute to Magisk-Modules-Repo/acc development by creating an account on GitHub.

github.com
[Magisk] crazelee:
- Implemented workarounds for unreadable battery/uevent and unreliable battery/status (kernel bugs) affecting mainly Pixel and LG devices.

Hi VR25, I would like to know how to active this workarounds? Im using pixel 3.

edit the config files "currentWorkaround=true" or it will detect and activate automatically???

thank you.
[Magisk] famusc:
@VR25 the original values of /sys/class/* come from kernel image? If I flash system image again through recovery are they restored to original values?

Or they are like data partition, which survives flashing, unless you format it?

Thx
[Magisk] VR25:
The workarounds are automatic and aim to fix charging switch issues introduced by Google, LG et al..

"currentWorkaround" has nothing to do with this! If you don't clearly understand what it's meant for, leave it alone (set to false and reboot to apply the change).

Read the doc. It's now available in HTML format as well (table of contents included).
[Magisk] VR25:
Just like changes made by kernel management apps (in /sys/), those made by acc also don't persist across reboots.

There's an exception - a Power Management Integrated Circuit (PMIC) bug described here.
[Magisk] famusc:
Ok thank you very much.

I feel like phone is discharging quicker than befoce Acc setup, but I have no proof. I mean there was a wakelock but it's gone since I changed charging switch. So now everything's fine, apparently. I thought I messed battery max capacity or something like that and wanted to restore those settings. Good to know this is not possible.

Anyway, for my Xiaomi Mi 10 Ultra there are 2 charging switch that appear to work:

bbc/charging_enabled

bbc/hiz_mode

The first seems pretty clear but have you ever heard about the second or know what is hiz mode?

Thx
[Magisk] VR25:
Have you tested those with acc -t?

acc -t bbc/charging_enabled 1 0

acc -t bbc/hiz_mode 0 1

The second makes no sense to me.

I'll do some research.
[Magisk] famusc:
Yes, I discovered them with acc -p and then tested with acc -t.

And they work good. But while the first is clear, the meaning of the second is a mistery to me (and to you too, I see).

If you find something about it, good to know.

Thx
[Magisk] nostromo12:
I want to run it on my Pixel 5.(original kernel, august update) Installed ACC 2021.8.31 with magisk and acca from f-droid

In ACCA I set loadswitch to dc/input_suspend 0 1 and change switch automatically.

With version 31 of acc the actual current is no more 0 mA, now its displayed but charging does not stop at the upper limit (set to 80%)

What have I to adjust?
[Magisk] crazelee:
AccA v1.0.35 (Hotfix of release 1.0.34) is available at GitHub​

​

Release Hotfix of release 1.0.34 · MatteCarra/AccA

This update fixes release 1.0.34 (see issue #189) Old release notes: It includes updated versions of ACC and DJS: https://github.com/VR-25/djs/releases/tag/v2021.8.26 https://github.com/VR-25/acc/r...

github.com

​

Thanks VR25 for the useful apps.​

​

​
[Magisk] VR25:
Are you sure dc/input_suspend 0 1 works?

Let acc figure out and set a working switch on its own.

Run acc -s s= to re-enable automatic mode.
[Magisk] nostromo12:
ok, VR25 lets do: switched to automatic mode and executed auto loadswitch test. One was found.

Now charge stops at desired limit, but charging symbol in device top line is still active, also infotext: device is charging.

But % indication is rapidly decreasing! 2% in a few minutes! power supply still connected.

acca shows actual current changing between 2 an 4A !!!! Should be negative and 0,1A !

Could I harm the pitiful battery?
[Magisk] mwahahaa:
Thanks for the update; acc is now working again for my Pixel 4a 5G.
[Magisk] VR25:
Manually select another working switch (with acc -ss) from the output of acc -t.

Refer to troubleshooting > charging switch.
[Magisk] nostromo12:
New approach with Pixel5:

acc -t shoes the switch sm7250_bms/charge_disable 0 1 working

I set this switch with acc -s s="sm7250_bms/charge_disable 0 1"

But result is the same : load stop at 80%, but then high discharge with power attached

wrong command? Little experience with shell commands :-(
[Magisk] T Ghost1:
My phone is making charge plugin sounds often enough.

Infinix Note 2, Resurrection Remix Nougat 7.1.2 default kernel. ACCA always crashes very time I set a charging value, tried ACCA and Magisk module none is very persistent with the value I set.
[Magisk] famusc:
@VR25 I see you included hiz_mode charhing switch. Did you get any more info about it?
[Magisk] Textilfrenzy:
Hi all! Im trying to use advanced charging controller on my xiaomi a2 lite with lineageos 17.1 and visually it does itss thing (except the battety icon remains with the charging icon) I set the max to 80% and it stops there, but somehow its hard to belive that it doesnt loose 1 % overnight. How can i check of it keeps charging or not? If thats the case what should i change in order to make it work?

Thanks for the help in advance!
[Magisk] gorilla p:
Im having trouble getting this to work on my OnePlus 9. Its worked find on my OP5/6/7/8 but on this 9, its having trouble.

At first ACC Daemon would run, but no charge stopping on wireless charger.

Now after updating to latest app and ACC version, the Daemon wont stay running and I keep seeing an error on acc -t

:/data/data/com.termux/files/home # acc -t

:/data/data/com.termux/files/home # acc -t

(!) Charger must be plugged to continue...

(i) Alright, this may take a minute or so...

(!) [/sys/devices/platform/soc/ soc:oplus,chg_intf /oplus_chg/battery/mmi_charging_enable 1 0] won't work
[Magisk] whitedavidp:
Hi. I have a similar vintage Note I GT-N7000 which is running NightOwl Lineage. Did you ever find an answer?
[Magisk] nostromo12:
Installed ACC 1.9.5 on my Pixel 5.

But still high discharge current, when charge limit is reached. ACCA now recognizes load switch sm7250. Thats new! Keep on track guys!
[Magisk] whitedavidp:
Hello. Here is another question. I went looking at the online file as you mention above. I can cat its contents and it seems that 0 is not connected at all, 1 is connected usb, and 3 is connected AC. Is this consistent with your findings? I note the file has permissions all read-only. How did you go about stopping charging with this file? To write to it would require a chmod as it is all read-only. And what did you write to it? Thanks
[Magisk] ncsuwolfs:
this works perfectly on wall chargers but if i use it plugged into my car the daemon stops running and i have to restart it manually. when its plugged into my car it starts android auto. is this normal?
[Magisk] amn1987:
Maybe bypass charging is working in which case battery charge level won't drop. It works in my Poco F1 (voltage limiting based) and older Redmi devices. I keep Redmi 3s plugged in all the time to minimise stress on the battery and the battery charge doesn't budge for days at a time. You can use 3c Battery Manager to keep track of battery current, voltage, temps. etc in the background.
[Magisk] VR25:
Is it the only working switch?

Keep in mind that this is a kernel issue.

I can only do so much to mitigate it.

The actual fix must come from upstream.

Try acc -s s=3700

This instructs acc to use voltage control files to stop charging.
[Magisk] VR25:
MediaTek devices are problematic by design.

Upgrade acc and try the following:

acc -t /proc/mtk_battery_cmd/current_cmd 0::0 0::1

If the switch works, set:

acc -s s="/proc/mtk_battery_cmd/current_cmd 0::0 0::1"
[Magisk] VR25:
I still have no information.
[Magisk] VR25:
As long as charging stops (i.e., battery level stops rising), you can ignore charging indicators.

Those are the result of flawed design by OEMs themselves.

If the battery holds its charge overnight, it's operating in idle mode.

Refer to the doc for details.
[Magisk] VR25:
Upgrade acc and try acc -t again.

Wireless charging control support is not as common (kernel issue).

Refer to documentation > troubleshooting > charging switch.
[Magisk] VR25:
@whitedavidp

Install the latest acc and share the log archive generated by acc -le.
[Magisk] VR25:
online is a status file.

It cannot be used to [reliably] control charging.

acc -p prints a list of potential charging switches that you can test with acc -t <line> and set set with acc -s s="<line>".
[Magisk] DuskGolem:
[MENTION=5228676]VR25[/MENTION], thanks for the awesome mod. Been using it from the start. I am confused. I have recently flash stock rom on my Xperia Z5 Premium Dual E6833. Today when i rooted my phone with magisk and installed this module and entered the command " cs -t 95 60" i get the following error given in the screenshot. Am i doing something wrong cuz it worked on previous versions.

Secondly, what is the need of automation service when we can use tasker??????
[Magisk] Sreekantt:
if suppose i applied cs - k 83

is there anyway to activate this command automatically when i plugin d charger though terminal

is cs -a command enough for this task ?
[Magisk] VR25:
Try this and report back:

su -c source /magisk/cs/system/xbin/cs

It seems your device doesn't want cs to run normally.

I'll fix that and release a new build soon.

What is the need of Tasker when we can use the built-in automation service? ;)

You can always disable it if you prefer Tasker.

cs -a is not suitable for this purpose. I have to incorporate this feature into cs service itself. Wait for the next build.
[Magisk] Sreekantt:
What is d default percentage set in cs service??
[Magisk] DeeZaster:
Thanks VR25, this looks to be correctly working now:

su -c source /magisk/cs/system/xbin/cs

(i) No settings found.
- Applying defaults -- cs 90 10...

(i) cs service is already running.

I do need to run the switch "-c source /magisk/cs/system/xbin/cs" everytime I use cs for it to work. Is there a way to fix the PIE issue permanently?
[Magisk] VR25:
PAUSE: 90

RESUME: 10

It automatically picks up new settings whenever you run "cs PAUSE RESUME" command.

For now, there are two ways:

su
. /magisk/cs/system/xbin/cs

or

su
. /system/xbin/cs

Note that "." is analogous to "source". So if you wanted to run, say "cs 80", you would rely on

. /system/xbin/cs 80"
# That's "dot space/system/xbin/cs 80"

I'll investigate the PIE issue further.
[Magisk] Jaymin.0.1910:
Hey VR25, please include a module.prop in zzz-cs-service so that, we can identify that better in the Magisk Manager's modules section...
[Magisk] wilberfan:
Pardon me, but I need to risk going Full Retard here for a moment. I want to make sure I understand a specific real-world use of this module.

I flash the .zip, reboot, open a terminal and run it as root. (Let's say with a # cs 80 20 ) ....and then....? Go about my day? Then, say, plug the phone into the charger at bedtime (for example). In this scenario, let's say the phone is at 30% when I plug it in. The phone will NOT start charging until it hit's 20%, is that correct? And if it DOES reach 20% it will charge until it reaches 80%. If that's how it's supposed to work, that's pretty nifty.

If I'm off-base here, clarifications are most welcome!

Thank you. We now return you to your normal programming...
[Magisk] wilberfan:
Looks like it's working! :good:
[Magisk] onliner:
Yep, but don't forget to keep the process of the terminal open, and you will have to reconfigure it every time you restart your phone.
[Magisk] t3chwizard:
That is not convenient at all. I don't want to have to reconfigure every time my phone reboots.
[Magisk] iluvatrix:
It's mentioned in the op that the terminal can be closed as long as it's not battery optimized?
[Magisk] Jaymin.0.1910:
We can close the terminal, but must leave the session running
[Magisk] iluvatrix:
Do you mean we can back out of the terminal app but it remains running in the notification area?
[Magisk] dyingbread:
You can use macrodroid if you don't want to reconfigure after reboot. Just set some triggers and action and save. Macrodroid is a simple app.
[Magisk] VR25:
Change included in the upcoming version.

cs 80 20 means battery charging pauses at 80% and resumes at 20%. However, after a reboot, battery will be allowed to charge till 80% even if the starting percent level is not less or equal to 20. In other words, rebooting the device switches charging "disabled" state back to "enabled".

Lets say you use your device till battery level drops to 20% or below. If you then put it to charge, cs will automatically stop charging at the upper threshold (80%). Now, if you don't reboot you phone after that, cs will wait till 20% to start charging again.

IMPORTANT NOTES FOR EVERYONE

- It seems some people haven't been reading the README thoroughly. Regarding terminal usage -- it has to be left running in the BACKGROUND. The presence or absence of "terminal running" notifications DOESN'T matter.

- If cs service is ON, though -- you DON'T need terminal, except for setting "pause%" "resume%" values (cs % %). If you install the module, reboot the device and don't configure cs, it uses the default settings (90 10). Again, terminal doesn't have to be running in this case. Also, you DON'T need MacroDroid, Tasker or any similar app to do the automation job. cs service got your back. So, no UI, no extra space in your internal storage, pretty easy and straight forward setup -- once you have this thing up and running, you can forget it exists.

Now, regarding the next version...

- It was planned to be released sooner, with the most notable change being the ability to "program" charging in a more advanced way. You can think of it as chaining cs command together with way more flexibility (i.e., cs -e 30m && cs -d 5h && cs -e 70% && cs -d 1h && cs -k 90).

The reason why I delayed the release...

- Make cs service able to work with "cs -k" too. Another command (cs -s) was born to switch (in real time) between the standard "cs % %" operation and "cs -k %". More details on that later.

-- If this ends up requiring more time to finish, I'll release a new build tomorrow with the already fully baked new stuff. Humans hate waiting, and I think I'm not an alien -- so... I feel your pain.
[Magisk] wilberfan:
Hmm. I think I'm getting closer. Thanks for the additional examples. So if we have the Magisk module installed, it will start on it's own with the default settings of 80 10 (max/min)? The default is "on" if the module is installed? So we would only have to start a terminal if we wanted to change settings? And following the change of settings we could Ctrl-C out of the terminal? (Would a reboot after changing the settings be necessary?) I've been re-opening a terminal following reboots and re-entering my cs 80 20 and then just letting Termux run in the background.

Is there a way to confirm cs is running?
[Magisk] VR25:
1. Yes, but 90 10, not 80 10

2. Yes

3. Yes

4. CTRL+C is NOT needed -- cs will exit on its own if service is running (you'll get a message stating that). A reboot is also not necessary.

5. You know for sure cs service is running when /data/media/cs/batt_level changes every 25-60 seconds.

Pro tip: all these answers are given by cs itself! ;)
[Magisk] wilberfan:
Yeah, I've read the README a few times... For whatever reason it's not all getting thru immediately. (What would help ME is real-world examples associated with each command example. But maybe I'm just a dunderhead...)

[edit] I think it's the latter. It's all there in the README...but it's confusing to me (at this point) about how the various things (module, terminal, MacroDroid) affect when it starts and stops, what has to be running, and what doesn't. I can tell it's very versatile!
[Magisk] VR25:
Upgrade acc and run acc -t while in your car.

Set a working switch with acc -t.

Refer to doc > troubleshooting > charging switch for details.

ACC does not launch apps. This must be triggered by something else.
[Magisk] T Ghost1:
I deleted the Magisk module of ACCA and installed the apk version and i haven't made any breakthrough 😞. Set my charging to stop at 90% but when at work up, 100% and still charging 😠. But i wondered how does stock OS stop at 100% how the chemistry work and custom ROMs still fail to borrow that.
[Magisk] amn1987:
I think by default the battery is 100% charged when the battery voltage reaches the maximum value which is typically 4.4V. In my Poco F1 bypass charging worked out of the box at 100%. I manually limited the maximum charging voltage so as to get it working at say 60% charge.
[Magisk] T Ghost1:
How did do that?
[Magisk] amn1987:
With root I edited the file permissions of the voltage_max file located in sys/class/power_supply to rw-rw. Thereafter I changed the default voltage from 4400000 (micro volts) to 3950000. Since the device was to be used plugged whenever possible a lower voltage is better.

P.S. I couldn't edit the file permissions on Pie or earlier. Only worked in Q+.
[Magisk] whitedavidp:
Hi and thanks for this! I have already been through the switching files found here and here. While I found the one for my LG V40, I could NOT find one for my old Samsung Note 1 (GT-N7000). Maybe it is just too old to have one? I am using that phone as a security camera, plugged in 100% of the time so I wish I could control the charging. I may have to resort to some external mechanism like a wifi smart-switch. Obviously, an internal mechanism is far better and less fragile. Anyhow, thanks for the response.
[Magisk] nostromo12:
acc -t finds only one working switch. Is there an option to list all working ones?

I set acc -s s=3700 and charge stops properly as required !!

Thanks VR25!!

Although device still reports charging is in progress it has stopped. That`s a kernel function? Maybe I have to switch to EXkernel...

My next task is to check wireless and find the appropriate working switch !
[Magisk] VR25:
It can be done with acc -sv 3920.
[Magisk] VR25:
Share the output of acc -p while the battery is charging.

This command helps find potential/new charging switches.
[Magisk] VR25:
The device will still report "STATUS=Charging", since this is a voltage tweak.

Rarely you'll see a different behavior.

You can ignore this fact and praise what you have already achieved.

P.S., try acc -p. It may reveal hidden/new charging switches. Test whatever makes sense.
[Magisk] ncsuwolfs:
I worded that wrong. Android auto starts bc I plug it into my car. I didn't know if that was why the daemon stopped. Sorry.
[Magisk] gorilla p:
I got it working again after removing and reinstalling everything. Now Im back to the issue of the Daemon regularly stopping.
[Magisk] gorilla p:
Got more info. Started ACCA and started daemon. It stopped in about 10sec. Got the info below.

OnePlus 9 - OOS11 (latest release) - BluSpark Kernel

27: test -f 'sm????_bms/status'

30: grep -Eiq 'dis|not' battery/status

32: '[' -f battery/charge_type ']'

0: cat battery/charge_type

33: '[' .Unknown '=' .N/A ']'

120: return 7

120: exxit

89: exitCode=7

90: false

90: set +eux
[Magisk] pmkalo7:
me too
[Magisk] gorilla p:
Flashed Omega Kernel and experiencing same issue.

Tried 9.5 and 8.31 with same results.
[Magisk] T Ghost1:
I have a question bugging me, does my acc (magisk module) settings persist after a reboot?
[Magisk] gorilla p:
I was eventually able to get things working again by removing the ACCA app and magisk module, rebooting and only installing the ACCA app. I dont know why both being installed would cuase the problems that it does.

Update: Now the Daemon stops while plugged in.
[Magisk] T Ghost1:
Did it work?
[Magisk] T Ghost1:
Discovered that for Acc Magisk module settings to take effect i.e., stop/start/restart daemon, you need to replug. Found this after starting my daemon just for my phone to restart charging and left without checking if it's charging (for 2hours) only to come back and see at 4*%😞😞