yashsingh1/xdaforums huggingface dataset:
[Magisk] VR25:
Happy new year!

[MENTION=5094347]RMarques[/MENTION], perhaps it isn't running, indeed.

Does acc -d stop charging?

Does option -e enable it back?

Is there an "acc... executing service.sh" line in Magisk log?

Does the daemon work as expected if you start it manually (su -c accd)?

[MENTION=6245194]KitsuneFoxy[/MENTION], did you change the kernel?

I don't see pm8921_charger/parameters/disabled in your log. That's mako's charging switch.

See whether you can find it with su -c find /sys -name pm8921_charger 2>/dev/null.

If the output gives you the correct path, run acc -s s "PATH 0 1" to set it and see whether acc works afterwards.

[MENTION=7670185]robert019543[/MENTION], are you using the latest version from the repository? Try a different charging switch (acc -s s) -- you too, [MENTION=3525574]xtam[/MENTION] (your current switch may be unreliable when screen is off). Battery calibration is only necessary when you notice abnormally fast charging/discharging rates. The 3 months rule is BS. Also, keep in mind that some "smart batteries" self-calibrate.
[Magisk] Ahugari:
Happy New Year!

I installed this module last night and restarted my phone in the morning after charging it to 83% (I never left it charging through the night though). My phone started charging for a sec and then stopped once I plugged in. Does this mean it's working? Am working with the default configuration. I read that the default setting is (70-80).

On the other hand, I have one more question. According to OP's reply to [MENTION=5307479]niix[/MENTION], he stated that its normal behavior for the phone to draw power from the external power supply and "disconnect" the battery. Does this mean that if I play games on my phone when the battery is "disconnected" (stopped charging) I would only be using power from the external power supply? If so, can this be a way to get long hours of gaming without having an any impact on the battery?:cool:
[Magisk] KitsuneFoxy:
Hi again, i did the command, the first one found it, but the second errored with the command argument, as for the kernel i haven't changed it since i flashed AICP 11 alongside it. I use Quanta v20 with marshmallow.
[Magisk] Erulak:
Hello, I was running MCS and everything was fine, basically I just use the '80 70' function if you see what I mean.

Now I updated to ACC, and I have struggle to make it work properly, what are the commands I have to use if I want to do the same things as before, not more ?

Thanks.
[Magisk] Ahugari:
I had acc running today. After work I had 53% of battery so I decided to charge it and see acc perform. When my phone reached 60% it stopped charging for a few seconds and resumed. I quickly thought it performing a routine battery temperature check and will resume. It did resume charge to 61% and repeated the same thing (stopped charging for a few seconds then resumes). This kept on going till it reached 64%, that's when I decided I had enough of acc for the day (till further clarifications on what's happening).

I installed mcs now because I had it working fine for me on my older device (g5). May I ask why you switched to acc if everything was working out for you with mcs? It seems theres some configurations am skipping before I can rip the benefits of acc. :rolleyes: How are you finding acc so far?
[Magisk] lentm:
LG Device triggers fast wireless charge at 15W only.

Is it possible to activate it at 10W like Samsung device?
[Magisk] Erulak:
Hi, I switched for a simple reason. I installed a new rom on my phone and had to reinstall my magisk modules, I prefer to use the in app installation, and MCS was replaced by ACC so I installed ACC.

I'll probably go back to MCS with a manual installation because I can't make ACC to work properly.

Ps : I would just like to stop charging at 80% and resume at 70%, that's all. If someone can explain me how to do this with acc
[Magisk] Norepinephrine:
That is normal behaviour. Its the Cooldown function set in the default configuration (at 60%),

which means that once the battery reaches 60% it starts Cooldown

When Cooldown is active the charging will stop for 10 seconds then resume for 50 seconds and then again stop for 10 seconds and again resume for 50 seconds.... so on.

This helps battery life by not letting the temperature rise too much.

You can turn off this feature or you can change the Cooldown values by either editing the config file (through file explorer with root) or through terminal.

The procedure is mentioned in OP.

I configured it on my own by going through the OP.

Had to turn off notification sound, vibration alert and display on with charger connected/disconnected in settings of my phone because they become annoying with Cooldown, also they might waste a lot of battery if enabled with Cooldown.

This module is awesome though.
[Magisk] Ahugari:
Oh, I didn't know acc replaced mcs. I thought the dev said it was undergoing heavy reconstruction (If I remember correctly).

It turns out I can't get mcs to work as I did on my old g5. I recall it was install and reboot. But it didn't work as my phone ended up charging till 93%. My g5 used to charge till 90% and I was happy with that.

To get your preferred settings running on acc, you probably should enter this in your terminal (termux):

acc -s capacity 5,60,70-80

(5: shutdown (default), 60: cool down (default), 70: resume, 80: pause)

You can also have that shutdown and cooldown disabled by leaving the as null:

acc -s capacity ,,70-80

PS: All these commands and more can be found in OP

Thanks for this info. I think I didn't pay that much attention while perusing through the OP's post. It's great to know it was actually working. :) Am going to install this again as mcs is not working out for me as expected. How did you get to turn off notification sound, vibration alert and display on with charger connected/disconnected? Did you run a command in terminal?

All these features besides the basic pause/resume make this module a must install after root! Great job VR25!
[Magisk] SMNM_:
loving the thread and this module looks promising. can someone help me with how to set up so that my phone charges only till 85%, charges again at 60% and power off when at 2%?
[Magisk] Norepinephrine:
My phone (Poco f1 + Lineage OS 16) has options to change these things in the phone's settings menu itself.

Open terminal and type following commands:

su
acc -s capacity 2,60,60-85

The above settings has Cooldown enabled at 60%.

If you dont want Cooldown then use following commands instead of the above ones:

su
acc -s capacity 2,,60-85

To check what configuration is currently set use following command (with su):

acc --set
[Magisk] Ahugari:
Sadly my phone (v30+ & stock rooted rom) doesnt. Guess I have to learn to turn my head away when it gets to the cooldown stage. When does the cooldown stage end though? Does this go on till the pause/resume stage?

OP recommends the difference between the resume and pause should not be more than 10. SMNM_ should keep that in mind when running these commands.

---------- Post added at 11:41 AM ---------- Previous post was at 11:38 AM ----------

If I halt charging for i.e. 6hrs and I play games while plugged in, does the phone use power from the direct power supply and leave the battery idle?

Thanks
[Magisk] Norepinephrine:
Yes. Till the pause capacity is reached.
[Magisk] Shirosuki:
The voltage_max is still annoying, i set it to 3.92 volt, and it's work for some times till i reboot it and the voltage back to more than 3.92 volt. Is there an appropriate procedure for applying it ?
[Magisk] Ahugari:
Thanks.

I think am going to nullify the cooldown since I cant disable the device charging notifications. So does this work like the way mcs did when the pause capacity is reached. My phone never went passed/below 90% once it got there while charging. Does acc work the same way or the battery has to be drained till resume capacity and then back to pause capacity (loop)?
[Magisk] paolocorpo:
Dear [MENTION=5228676]VR25[/MENTION]

I am running a Mi A1 with PIE stock (only bootloader unlocked)

Now ... I would like to reuse acc as before

I am proposing you a couple of scenarios

1. I can boot using a patched_by_Magisk_Manager_boot.img in order to have the privilege of root

I could use a terminal emulator with root privileges in order to write some commands to obtain acc (as I did recently to have API2 necessary for a porting of Gcam)

Of course on successive boot ... I will loose root

2. I can boot a temporary TWRP session, flash the zip, reboot to not root system

Is one of these scenarios able to achieve acc running on my not root device ?

Thanks for your support

Paolo

Inviato dal mio Mi A1 utilizzando Tapatalk
[Magisk] guest4711:
It depends on the implementation your kernel uses. On some kernels it will work as you describe, on others it drains the battery until the min charge value is reached... You should try it yourself...
[Magisk] paolocorpo:
[MENTION=5228676]VR25[/MENTION]

I loose root just because I install temporary it; it is a my choose ... It is not a fault

I decided after Pie to stay a couple of months stock in order to appreciate the features of stock

But ... I would like to use acc (or mcs)

I just need something to limit maxCapaxity and (if possible) the cooldown strategy (but it is not mandatory)

Inviato dal mio Mi A1 utilizzando Tapatalk
[Magisk] Ahugari:
Does this mean if I just limit charge voltage I don't need the rest of the other settings i.e. cooldown, resume, pause, clean shutdowns?

This might be a noob question - If I limit charge voltage that means I can reach 100% (not that I would - just saying) without any effects on battery ( temperature )?

Could the best combo be to limit charge voltage, set shutdown, pause and resume capacity?

Is fast charging affected when charging voltage is limited to 3.92V?

Regards
[Magisk] VR25:
[MENTION=5056724]paolocorpo[/MENTION], it may be possible to make acc daemon auto-start and work normally without root by patching boot.img > ramdisk > init.rc. The terminal commands won't work, though. You'd have to edit config with an app. I'll explore that possibility.

[MENTION=8737656]Ahugari[/MENTION], yes, if you limit the charging voltage, other features (except auto-shutdown) aren't strictly necessary. If you want these anyway, <onBootExit> must be <false>. Fast charging may not be compromised at all. In fact, it could be slightly faster, just without the extra stress on the battery.
[Magisk] paolocorpo:
Thanks

So the strategy could be:

boot to system but using a patched_boot.img by MAGISK MANAGER

For a while I will have root privilege

In this condition the terminal emulator works having root privilege (I already used it with success in order to change prop file and obtain API2)

Now ... can you clarify wich kind of modification I have to do into init.rc file ?
[Magisk] Ahugari:
[MENTION=8737656]Ahugari[/MENTION], yes, if you limit the charging voltage, other features (except auto-shutdown) aren't strictly necessary. If you want these anyway, <onBootExit> must be <false>. Fast charging may not be compromised at all. In fact, it could be slightly faster, just without the extra stress on the battery.[/QUOTE]

I have tried searching for the voltage_max file in the directory you provided (./Folder/voltage_max - Folder: main, etc, battery). No luck. If I go with the method of adding the line in config.txt. How can one confirm its working?
[Magisk] lentm:
VR25, I attached the log file for further assistance.

Looks like it doesn't show the default value that you mentioned.

Thank you so much for your help!!
[Magisk] gordonpn:
I really like this module, but the screen keeps turning on and off. Is there a way to disable that?

I'm using stock OxygenOS and the option is not offered within the ROM. I know this option is featured in custom ROMs usually...
[Magisk] paolocorpo:
As VR25 said ...

... To prevent the annoying charging notifications, there's an app... Snoozy Charger... whatever... look that up on the Play Store.

Inviato dal mio Mi A1 utilizzando Tapatalk
[Magisk] gordonpn:
I've actually tried that app before, but it didn't work for me. But thank you for mentioning it
[Magisk] slimshouki:
Actually its not on play store anymore.

Can [MENTION=5228676]VR25[/MENTION] implement this feature in his module
[Magisk] paolocorpo:
That's bad

It was working well on my Mi A1

Inviato dal mio Mi A1 utilizzando Tapatalk
[Magisk] RMarques:
[MENTION=5228676]VR25[/MENTION]

Thanks for your help.

Happy New year bud.

Does acc -d stop charging? Yes

Does option -e enable it back? Yes

Is there an "acc... executing service.sh" line in Magisk log? Nope

Does the daemon work as expected if you start it manually (su -c accd)? I'm not sure what to expect when this command is ran but it throws an error msg (see attached SS)
[Magisk] Norepinephrine:
What is this c440000 kernel wakelock keeping my device awake all the time and draining battery?

I am on LOS 16 and 8.12.27 + r12
[Magisk] Da-BOSS:
I think [MENTION=5228676]VR25[/MENTION] need to post it on the main OP to avoid repeating the same question & answers.. :fingers-crossed:

But here's the official website for SnooZy Charger ;)

http://snoozy.mudar.ca

It works wonderfully on my Note 9 ;):cool::)
[Magisk] Ahugari:
I found the voltage max file and the value is 4395000 (I guess this is in uA). Can someone help me clarify if this equals to 4.3V? If so, does this mean if I want to set the value to 3.92V I should enter 3920000?

Sorry I don't know much about power.

Thanks and regards
[Magisk] slimshouki:
Where is that file located?
[Magisk] Ahugari:
On an lg v30 it's found in this path: root/sys/class/power_supply/main/

What OP is trying to say is, on other devices .../main might not be the location. In the power_supply folder there's other folders i.e. battery, dc_wireless etc. The file could be in any of those folders.
[Magisk] slimshouki:
Why did you choose 3920000

Why not 3000000?

Which value safest and wont heat it up device?

And if we set it at 3.0 instead of default 4.3, do we still need the cooldown feature?
[Magisk] onliner:
smb is related to the charge/r, but that time is not normal, reboot, and if the problem persist: - Send logs, - Try with another kernel.
[Magisk] MarcoCount:
Thanks for this module!
[Magisk] glemco:
Hi guys, first of all I want to thank [MENTION=5228676]VR25[/MENTION] for this beautiful module, it's working like a charm on my mobile. Indeed I'm trying to take the most out of it by also installing it on my smartwatch (here the problems come). I know magisk is not supposed to work on smartwatches, but actually it does pretty well and I can run your script smoothly. What I cannot find is a valid switch file to make it work, all the files I could find that are related to battery, charging or whatsoever are not writable or do not seem to be actual switches (they contain text). Can u tell me if it's possible my smartwatch does not have such a switch so that I can simply give up (wear os is not that different from android actually and I may find kernel sources too). I'm uploading acc logs as well to make it easier to figure it out. :D
[Magisk] MarcoCount:
Is acc deamon supposed to be running when I disconnect charging cable after charge is completed?

Thanks
[Magisk] lvbaal:
I have installed the module on Huawei P20 Pro with custom rom Google Pixel3 Experience (firstever)

acc build date 2018.12.26.1

I am experiencing a problem trying to stop the charging at a certain level.

accd is running

acc -s capacity=6,60,75-78

With this setting I expect the device to stop charging at 78% en start again at 75%, but it does not stop at 78%.

I attach the installation log.

Also, acc -i says: ¨sed: ./battery/uevent: no such file or directory¨

Any suggestion to tackle this are most welcome
[Magisk] Dant3s:
For some reason yesterday it behaved as it was charging even without charger, and when I restarted phone and connected to the charger it was "ok",I mean it was not charging but I had all charging indicators,what could this be?
[Magisk] Ahugari:
Refer to OPs answer:

Refer to OPs answer:

---------- Post added at 10:15 AM ---------- Previous post was at 10:12 AM ----------

I strongly believe so. How will it detect that your phone's battery has reached shutdown capacity in order to perform a clean shutdown? ;)
[Magisk] MarcoCount:
Thanks for you answer, but I've disabled minium capacity shutdown.
[Magisk] Ahugari:
You can go ahead and run the onBootExit command since you have disabled minimum capacity shutdown.

PS: Don't forget to hit thanks for all helpful answers! :)
[Magisk] MarcoCount:
Thanks a lot.

I will try and report back in the next days if everything is working fine!

EDIT: Trying to charge right now. Accd is not running even if the phone is charging. Let's see if it stops at 80% or not. Btw if accd is not running will it prevent the battery from overheating?

I was hoping that accd auto started on plug event (if such event exists) and auto stopped when it ended.

EDIT 2: Nope. it's not working.
[Magisk] semdxd:
I can't set on/off values for my charging switch (honor 8, EMUI 5)

I run this code

Su

Acc --set switch "/sys/class/hw_power/charger/charge_data/enable_charger 1 0"

But it gives me this error

Acc -s: max two arguments

I found this directory from battery charge limit app which is working perfectly
[Magisk] paolocorpo:
Dear [MENTION=5228676]VR25[/MENTION]

Do you have news on this topic for me ?

Thanks

Paolo

Inviato dal mio Mi A1 utilizzando Tapatalk
[Magisk] MarcoCount:
[MENTION=5228676]VR25[/MENTION] I have a weird acc deamon log spam: sh: -le: argument expected

I've attached the log file + the config.

I thinks it's related to the fact that I've disabled minimum capacity: https://github.com/Magisk-Modules-Repo/acc/issues/5

Thanks a lot in advance.

I've a question about onBoot in the default config "onBoot=./usb/device/razer_charge_limit_enable:1 ./usb/device/razer_charge_limit_max:80 ./usb/device/razer_charge_limit_dropdown:70"

I don't even have these files. What is it supposed to do?
[Magisk] Dant3s:
Hey, could anyone tell me if how to set it to stop charging at 100%, disable cooldowns etc., I just want it to stop charging at 100% and start charging again when dropped to 90%, nothing else. How do I do this?
[Magisk] lvbaal:
Anybody?
[Magisk] Ahugari:
Why do you want to charge it till 100? Anyhow here's the code you need.

acc -s capacity , ,90-100

Read OP for more details! :cowboy:

---------- Post added at 09:16 AM ---------- Previous post was at 08:28 AM ----------

Could you attach your log/config file in another format; preferably non zipped/archived.

---------- Post added at 09:24 AM ---------- Previous post was at 09:16 AM ----------

Does acc auto start when your phone has booted? If not, you should manually start the daemon. onPlugged event exists (last line of your config file) but I guess it would not be logical to start/stop the service on plugged/unplugged events.

---------- Post added at 09:26 AM ---------- Previous post was at 09:24 AM ----------

Sure. :)
[Magisk] lvbaal:
I attache config and log files as plain text. Thanks!
[Magisk] Dant3s:
I've set it as you said but it stops charging at 70% even though it says 90-100 in the config
[Magisk] Ahugari:
Run this command as su in terminal:

acc -s capacity 6,60,75-78

Make sure acc is running by executing this code:

acc -D

---------- Post added at 07:22 PM ---------- Previous post was at 07:21 PM ----------

Please attach your config file for further assistance.
[Magisk] lvbaal:
Okay, I will test this again.

And what about the message ¨sed: ./battery/uevent: no such file or directory¨ following acc -i command? Any ideas?
[Magisk] Ahugari:
This might imply that the uevent file is not in the location that's being searched. Confirm that the uevent file exists in the directory mentioned. Although on my phone that file exists in the .../power_supply folder.
[Magisk] VR25:
**2019.1.9.1 (201901091)**

- Fixed `acc -s s <path> <on> <off>`.

**2019.1.9 (201901090)**

- Additional devices support

- Enhanced power supply logger. Owners of still unsupported devices, upload the newly generated acc-power_supply-$deviceName.log file.

- Cycle through all supported charging switches (new algorithm). Users no longer need to run <acc -s s> if charging control is inconsistent - unless they want to enforce a particular switch or set custom charging switch parameters.

- General fixes & optimizations

- Updated building and debugging tools.

- Updated documentation & default config.

Please, READ the updated documentation (or at least config.txt). Note that ignoring this can potentially lead to logical errors in config and cause malfunctioning.

Owners of unsupported devices (e.g., [MENTION=1861039]lvbaal[/MENTION], [MENTION=5915591]imHadees[/MENTION]),

Upload the new acc-power_supply*.log file. It has way more information now (inc. data from /proc). Your beloved, yet unknown charging switch may just be sitting there, waiting to be noticed.

[MENTION=5056724]paolocorpo[/MENTION], I looked into that. Unfortunately, it requires several modifications I'm not willing to do without a major reason to justify the workload.

P.S., I see people downvoting the project. Hopefully that's not because of "unsupported device". This would make half of my fingers sad. :)

By default, not all chargers or charging drivers are able stop charging below 100% capacity under normal circumstances. There's nothing acc can do about that. Figuring out whether there's a switable charging switch available for a certain device is by no means an easy task.
[Magisk] lvbaal:
Thanks for your continuous work on this :)

I have attached acc-daemon-HWCLT.log & acc-power_supply-HWCLT.log from sdcard generated installing the module. I sure hope that the switch on my device will surface when you have a chance to look at it :)

Device: Huawei P20 Pro with custom rom Google Pixel 3 Experience (firstever)
[Magisk] aouerfelli:
What a pleasant surprise! Here's my power supply log file:
[Magisk] alex moymoy:
Unfortunately I have one unsupported device. I tried some options but I can't find the right file. Maybe someone can help me with that?? I appreciate it, please. Thanks in advance
[Magisk] VR25:
**2019.1.9.2 (201901092)**

- Added support for some Huawei devices' weirdnesses.

alex moymoy, see whether you can change </sys/devices/platform/battery/ADC_Charger_Voltage> or </sys/devices/platform/battery/power_supply/battery/ChargerVoltage> value to 3920 and it sticks. Do that after setting write permissions (chmod +w FILE1 FILE2).
[Magisk] Ixioon:
Could you explaib to me in capacity option what coolDown resume and pause means :confused: