yashsingh1/xdaforums huggingface dataset:
[Magisk] RMarques:
[MENTION=5228676]VR25[/MENTION]

I'm so confused...if I run "acc -D restart" it works but all of sudden it stops charging and stats charging again! Even if it's it of the limits I previously did set.

Edit 1: As soon as I close terminal, acc seems to stop working.

Edit 2: Somehow, after a restart, it's working now!

Edit 3: ...and the saga continues. Overnight, it just stopped working and kept the cellphone charging all night long.

I did run "acc -D" command and got the message "accd is running"...even though it kept my cellphone charging overnight. It's battery is 93% and I connected it to the AC in order to see if acc was going to prevent it to charge but it started charging as usual!

I miss the days when it just was working as intended for me. It's the best Android app idea in terms of increasing the lifespan of Celine battery for sure!
[Magisk] Ahugari:
Anyone?? :(
[Magisk] Sreekantt:
These are the switches available for me right now

(i) Available charging switches

- Choose one and press <enter> to set it

1) ./battery/input_suspend 0 1

2) ./parallel/charging_enabled 1 0

3) ./parallel/input_suspend 0 1

I have been testing all the above 3 for the past few days. Only the first one works reliably on my device (Beryllium/Poco F1) but it causes battery drain because of qcom-step-chg.

Attached few logs if it helps you.
[Magisk] Momotani-Hitoshi:
There a quick/simple method to disable MCS/ACC temporarily allowing 100% charging without terminal command line?
[Magisk] Benni:):
I've written a tile for that

https://xdaforums.com/moto-z/themes/tool-efficency-mode-battery-mod-info-t3826694/page2
[Magisk] Ixioon:
By default #onPlugged=./wireless/current_max:2000000 ./usb/current_max:2000000 is not active, Is it good to activated ?
[Magisk] kevsestrella:
Hello, cool app, thanks. Tough I have tried it and seems to frequently request root( frequent toast notif). Is this normal behavior?
[Magisk] paolocorpo:
No, it isn't

Are you using Magisk for root ?

Inviato dal mio Mi A1 utilizzando Tapatalk
[Magisk] k0rner:
It depends on specific hardware - so you may check your device forums to confirm.

For example, on Pixel 3 wireless/current_max is useless and wireless/voltage_max should be changed instead.
[Magisk] kevsestrella:
Hello, yes I'm using magisk. sadly, I'm not familiar anymore of other ways to root.
[Magisk] paolocorpo:
No, it is OK

Magisk is fine ans surely it is not the root cause of your small issue

Into Magisk Manager setting there is the section of SU

let check there if Magisk Manager is granted or not

Which app/process is asking authorization ?
[Magisk] Benni:):
only on refresh.

root session should be kept as long as the tile / app is visible.

But I didn't implement a backing server that keeps refreshing in the background.
[Magisk] Edocsiru:
Can you add this? It's the one that works on my chuwi vi10 plus.

./dollar_cove_charger/enable_charger 1 0 (or enable_charging, but not the current switch named present)

./dollar_cove_battery/capacity (temp, uevent..)

That's also needed I guess..?

edit: I changed the ?attery with *attery and flashed again (with my switch also added), it's working perfectly.
[Magisk] RMarques:
[MENTION=245635]Benny:)[/MENTION]

+1... I've had to uninstall it!
[Magisk] Ixioon:
Update for sm-g935f after i remove the module and re-installing it. I set switch with acc -s to batt_slate_mode and not store_mode like before. It worked perfectly . Charging pause ~80% sometimes 83 or 81 but it's fine.

I found on another sub that for the owner of samsung : "The main difference between batt_slate_mode and store_mode is batt_slate_mode acts like the charging cable is unplugged, so it allows the phone's battery to drain (store_mode kept the battery at the same percentage)."
[Magisk] VR25:
If you can install Magisk and acc, upload /sdcard/acc/logs/acc-power_supply*.log.

Do you remember the last fully working version? Have you switched ROMs/kernels ever since?

Upload all logs you've got.

I read all posts. Wait for the next update.

Upload /sdcard/acc/logs/acc-power_supply*.log. I need to see why exactly "?attery" doesn't work and take a closer look at your device's power supply data.

Weird... I found this to be the other way around.
[Magisk] Edocsiru:
I uploaded it a few pages back... Anyway, as I showed on my last post my folder is called dollar_cove_battery while your are looking for ?attery. ? means zero or one, of course it can't find it.. * works just fine.
[Magisk] VR25:
Yeah... I missed your link (found it again just now) and a couple other things.

Indeed "?" won't work.

I'll make changes accordingly.

:good:
[Magisk] Bortex19:
With the last update, sometimes, when I connect the charger, it takes a few seconds to start charging, is it normal?
[Magisk] VR25:
That just means accd is cycling through available charging switches until it finds one that works. There's a delay of 1 second in between -- to determine whether the operation was successful and restore default switch state if unsuccessful.
[Magisk] Bortex19:
Perfect! Thank you for the answer :good:
[Magisk] Kglim:
IDK why but in home screen saying 100% of battery but when i go in to recovery, it saying 94%. So any help for this? I think it's not a problem with recovery.

Any helps?
[Magisk] knreddy:
Experience sharing of MCS with Charge Switch

Experience sharing (This is tried as min level of GUI based Battery charge limit is not working)

Phone: Redmi Note 4x Mido dual boot

1. I have Installed mcs-2018.8.8.zip downloaded from

https://xdaforums.com/attachment.php?attachmentid=4568778&d=1533910128

through Magisk Manager 6.1 with magisk 18.

2. Rebooted

3. Settings

a)edited config.text file at /data/media/mcs/config.txt.

(/data/media/0/acc/config.txt in case of acc downloaded from https://xdaforums.com/attachment.php?attachmentid=4669155&d=1545251869 )

b)I have used Charge Switch apk (it has min max battery charge settings only ) downloaded from

https://xdaforums.com/attachment.php?attachmentid=4539977&d=1530525294

Note:

1) This apk will not work with "latest version of MCS " =ACC

2) To by pass the retention of info that it has reached max value (to start charging battery at above min value ) we have to restart phone in case of Charge switch app

Thanking the developer for such useful app
[Magisk] Zouizoui:
I just wanted to thank you for this great app, it manages so well the thresholds, pausing/resuming etc and now my phone doesn't overheating while charging, very good for batteries' lifespan ! Great work, thank you :D
[Magisk] aron11195:
can someone pls help me, my battery sensor is busted it keeps saying my battery temperature is 56c even tho its not even warm, but my phone does not charge when battery temperature hits over 55c.. is there a way to up the threshold with this module?
[Magisk] MarcoCount:
Just edit the config in /sdcard/acc following op
[Magisk] neverremembermyusername:
Is there a list of devices / kernels known to support / not support voltage_max? I'm able to write to /sys/class/power_supply/battery/voltage_max on my Nexus 6 (shamu) after doing chmod 644 on the file, but after echoing various numbers to it, it just stays at the default value. Is this a kernel issue (default LineageOS 15.1 kernel) or is it possible that it's simply impossible to modify voltage_max on the N6? Has anyone been able to change voltage_max on the N6 on any kernel?

Also, is it possible to change when the "full" signal is sent to the wireless charger? acc successfully stops the charging process on my N6, but the fact that it's still on the wireless charger causes a wakelock so it keeps dropping to 70 and charging back to 80 all night. But, back when I was letting the battery get to 100% every night, at 100% the charger light on my wireless charger would turn green and it would "disconnect" from the phone until I took it off and put it back on the charging stand. Is there a way to make the phone send the "charging done" signal to the Qi charger at 80%? Alternately, does anyone have any experience with using Qi charging and preventing the smb135x_wake kernel wakelock that happens when the N6 is on a Qi charger?

Or, I guess more generally, is it possible to be not charging, but plugged in, and not have any wakelocks due to the presence of external power?
[Magisk] VR25:
This is a classic sign that your smart battery needs calibration. The smart battery is like a reporter of the actual (chemical) battery's properties.

If your battery is hot-swappable, remove it, keep the power button pressed for a few seconds, then put the battery back in and power up the system.

If the battery is sealed into the phone, the smart battery may be able to self-calibrate overtime, using impedance tracking. Generally, you don't have to worry about capacity discrepancies, unless you notice significantly reduced runtime due to lower capacity estimates.

Your last resort is draining the battery until the devices shuts itself off, then charging it to 100% capacity before turning it on again.

If charging was significantly faster from 0-100%, leave the device plugged in until you think the charging time elapsed is close to original.

Keep in mind that this is really a last resort, as it puts great stress on the battery.

You may want to follow the above procedure. Temperature values are updated by the charger and battery drivers. These are built into the kernel itself.

Install acc and upload /sdcard/acc/logs/acc-power_supply*.log for further assistance.

When values don't stick, it means the kernel doesn't allow custom charging voltage. There's no formal list of devices that support this. To my knowledge, some Xiaomi and ZTE devices do.

Don't worry too much about modifying voltage_max if your kernel doesn't allow it. This is one of the reasons I came up with the coolDown algorithm. Besides, in a sense, limiting battery capacity also limits voltage. Obviously, that's not as good as specifically setting a max charging voltage value. But it is undeniably way better than doing nothing.

Actually, when capacity hits 100%, many systems fool users to believe that battery level stays there the whole time.

Some devices do put the battery on hold and draw power directly from the external power supply when charging is switched off. Certain charging switches favor this behavior. Examples are batt_slate_mode (Samsung) and charging_enabled (Moto G4 Play).

By default, acc cycles through all available charging switches until one works. You can tell it to use only one and that one may work as you desire. It's up for you to test. The command is acc -s s.
[Magisk] VR25:
**2019.1.24 (201901240)**

- Additional devices support

- General fixes & optimizations

- Generate power_supply log in the background.

- Enable charging after stopping accd (acc --daemon stop).

- More accurate encrypted data detection

Posts #1 and #3 were updated.
[Magisk] paolocorpo:
Dear [MENTION=5228676]VR25[/MENTION],

I updated my Mi A1 and N5X of wife

All looks as running well

Thansk a lot for your effort
[Magisk] neverremembermyusername:
Yeah, that's what I'm sticking with for now. I've actually asked in the N6 forum about if any kernels support voltage_max, because I'm not opposed to flashing FrancoKernel or something else to achieve this.

Unfortunately acc -s s only lists one mode (the charging_enabled 1/0 mode), which I assume is the one currently being used. In any case, I don't think that the wake lock I'm seeing is actually because of acc or the charging switch used. I think there's just a wakelock any time this phone is on any kind of charger at all. That's why I inquired about if it's possible to send the "charge done" command to the Qi charger, so then the Qi charger would disconnect and the wake lock would end.

I guess it's possible that the wake lock is somehow connected to setting charging_enabled to 0, but IIRC my phone never went to sleep on the charger on the stock firmware either. It was awake any time there was a power supply other than the battery. Back when there was the wake graph in Android 7, it was always awake any time it was on the charger. The wake graph is gone on 8.1, but AccuBattery tells me that the phone is asleep for 0% of screen off time when it's been on the charger, and generally about 92% of screen off time when it's not.
[Magisk] Sachitoge:
I noticed when phone reaches to certain percentage, and stops but while plugged in, it discharges a bit of juice.

Aproximately 1%/h - 1.5%/h.

Well, its not app to blame (i guess, or?) More like the cable being plugged in, draws a bit power or?

Im not sure.

Either way, MacroDroid works good but typing in "su cs 80 20" does not make it charge from 20% but in fact, few percentages lower than that, but stops at the right time!

Why is that tho?
[Magisk] khangcobra:
How to use Macrodroid ? I can only use tasker and when i use command cs -m 80 20 i get invalid argument
[Magisk] Taracair:
It's not the cable.

It's probably some app which generates wakelock and doesn't let your cpu go in full deep sleep.

Try to find what's going on with CPU Spy Reloaded apk from the Play store.

It shows the frequencies table - you may check which frequency was used during the charging (reboot before charging and check it in the morning)

There's also a wakelock tab - sometimes it's indicated because some ****ty apk which generates wakelocks.

If you are on MM ROM install Wakelock Detector apk from the store, it gives more detailed information about wakelocks.

The other reasons of battery drain:

- GPS is turned on and Google play services is using it from time to time

- Wi-Fi/mobile data is on

- specific kernel settings (what kernel do you use?)

- at last, specific ROM settings or some bugs

First try to check out the wakelocks.

The other things you may want to do:

- if you are using xposed framework stop doing that :)

- install Greenify apk and set apps to force deep sleep

- there's a good magisk module: "Enable Doze For GMS Magisk Module" - it lowers the wakelocks caused by the Google Play Services to minimum.

- install different kernel (I recommend Solid Kernel if you are on AOSP/CM ROM)

- if you can't find the reason of battery drain after all these steps check out your logcat (with for example MatLog apk) and seek for help with someone who can read and understand that kind of things

Good luck in finding battery drain reasons.
[Magisk] colinlinton:
That does not help. I have tried both with and without support first and it says the same thing either way. I'm hoping I can just find a copy of the tasker profile from someone so I can add that to my tasker and actually start using it.
[Magisk] Kinger1970:
Attaching GoogleDrive file

Hi, sending link to GoogleDrive, Sony XA

https://drive.google.com/open?id=0B1-xgut1Wqh2SEowZ01lZGlfQm8

---------- Post added at 07:27 AM ---------- Previous post was at 07:23 AM ----------

Sorry, still not have rights to post links, pasting as the text.
[Magisk] VR25:
The discharge has do with a rogue app holding more wakelocks than it should. You have to figure out which one that is. There might as well be more than one, though.

About MacroDroid -- that's one of its limitations. The app itself won't allow you to set a "<=" (less or equal to) trigger value, only "<" and/or ">=" (greater or equal to). So, it'll only be triggered by values below 20% and greater or equal to 80% in your case. A workaround is setting the lower value to say, 21%.

Odd... I just tried that again. Check the screenshot.

After generating MacroDroid's config, you simply open the app & import the file /sdcard/MacroDroid/cs.category.

Strange issue...

Are you sure Magisk is working correctly? Find attached a Tasker project (80 20) you can import.

EDIT: [MENTION=4861450]colinlinton[/MENTION], did you check whether the file /magisk/cs/system/xbin/cs exists? If it doesn't, copy it from the zip to that location and set 755 permissions (chmod 755 /magisk/cs/system/xbin/cs).

[MENTION=8017584]Kinger1970[/MENTION], got it.
[Magisk] dyingbread:
Latest version with macrodroid is not working for me. It just enable and disable charging repeatedly. I used the provided cs.category.

But it's work great with manual setting in terminal.

----------------------edit---------------------

It's working good with macrodroid. You just need to set the trigger and constraints with the right choices and it should be good.
[Magisk] Sander9847:
The MacroDroid scripts don't work like you made them. Your triggers are wrong.

I think they are supposed to be like this not sure though, but my device starts charging under 20% at least. ;)
[Magisk] Sander9847:
EDIT: The AND switch isn't even needed because device has to be connected to a power source to go above 80.

I also edited my Macros to include a Quicksettings toggle to overwrite the automatic settings in case you really need to charge.

Here you go :) (you'll have to chance the upper limit to 80 again)
[Magisk] danicadanicadanica:
Pls add support for my device

drive.google.com/open?id=0B9JU6z3rW4qLTXplY0lsZTVWVnc
[Magisk] alextytan:
Thanks mate!
[Magisk] gloeyisk:
Works fine, everything looks good, passed SafetyNet.

Loved it, thanks!
[Magisk] deepak549:
1) I am facing weird issue while charging when commands are executed through tasker. Though phone charges normally when i disable tasker . But when i run commands " CS " through terminal , it started to charge normally and also charging stops at desired threshold %age .

I think there is some issue with tasker implementation .

2) Also how to change PAUSE and RESUME battery percentage. Initially set it for 80% to 40% but now i want to change the limits. But I am not able to generate new XML file for new PAUSE and RESUME battery percentage.

Other then that this module is best one to extend battery life span. I have been looking for such app for a long time. It is close to perfect.

I am on Oneplus 3 , OOS 4.5.1, Magisk rooted.
[Magisk] bkuri:
Many thanks for this. It works great on my OP3T. :good:
[Magisk] Sreekantt:
tested on 2 phones

redmi note 3- stops charging after extra 10%...

honor 6x- doesn't work(we discussed earlier)

UPDATE - NOW WORKING
[Magisk] Sreekantt:
Finally good news bro-

got it working on Honor 6x after d latest update perfectly

Redmi note 3 stops charging after extra 7% - not a big deal ...i'm just setting 7% lower than desired(may be just a rom issue in updating battery stats)

Thanx [MENTION=5228676]VR25[/MENTION] - now looking into macdroid/tasker- lets c how it goes

Update - using macdroid - redmi note 3 also stops charging perfectly at desired percentage
[Magisk] Sreekantt:
This profile working perfectly... Thanx bro

Btw it stops charging at 70%(my value)... But it doesn't discharge anymore if it stays connected to charger.. Whatever we do(even playing h265 video)... Is that normal that its holding charge at 70%...if we disconnect & reconnect charger... It starts charging again normally..
[Magisk] VR25:
Been a little busy lately. Will resume development soon. I see we've made great progress so far. :)

[MENTION=4973064]bkuri[/MENTION], that's not a good idea (yet). I'll work on a better way to automate things without apps -- yes, no Tasker/MacroDroid needed. Back to the "not a good idea" part -- the current version is not optimized for what you're trying to do. A post-fs-data script starts running too early, might generate too much garbage & even drain your battery a little bit faster.
[Magisk] wu86z:
My phone stop charging after I commend 'cs 80'. But battery haven't reach 80%.

How can I deal with this situation?

I am using htc 10 with Leedroid rom and magisk root.

Thanks in advance.
[Magisk] deepak549:
If you manage to work this module without MacroDroid or Tasker then that will be great idea. I find these app less reliable than Terminal, some time they work while some they don't.

But when i use this module through Terminal it works like a charm.

So if you can make this module simpler then that will be great idea and more and more people can use it.
[Magisk] warrencoakley:
Can someone possibly do a YouTube video on how this installed properly. It would be very helpful.
[Magisk] VR25:
[MENTION=9690574]neverremembermyusername[/MENTION], I'm certainly going to remember your username for a while!

Anyway, perhaps we can go over this by fooling your system into believing that no external power supply is connected.

Lets test that

1) Stop acc daemon (acc -D stop).

2) While connected to an external power supply, disable charging (acc -d).

3) Check whether the values in /sys/class/power_supply/TYPE/online and present are 1. If the number is 0 (zero), stop here. The plan won't work.

4) Change both to 0 (zero).

5) Leave the device alone for a while then check whether that wakelock is still up.
[Magisk] dimm0k:
just curious, does 'acc --set' show the current config in the config file or the current config of the system? I'd like to know what the settings are set to prior to installing this module if possible
[Magisk] paolocorpo:
In order to do it is sufficient to read OP

Is is written clearly ;)
[Magisk] dimm0k:
I have the read the OP and wanted to not only clarify, but also request this feature. as far as I'm concerned, --set shows what's in the config file and not the system's current settings.
[Magisk] to1ya42:
Help pls! Axon 7 custom Oreo magisk 18

After 60% my battery take 1% then shut down charging, but then it's starts again, but not for long - at 1%. This happens fast again and again till 80%. Is it OK? To my opinion and test, those actions takes too much cycle of charge (pics included) thanks for reply (stock acc, don't use terminal)

[IMG="1"]https://ibb.co/vjg48Ln[/IMG]

[IMG="2"]https://ibb.co/5hdXwpg[/IMG]

Mirror

https://cdn1.savepice.ru/uploads/2019/1/25/015170e004639f99dda4bdd8925495c6-full.jpg

https://cdn1.savepice.ru/uploads/2019/1/25/27ad6f7e72cccdcf8b477f25419fc43d-full.jpg
[Magisk] VR25:
What you want is acc -i (or --info).

By default, under certain conditions, charging is disabled periodically (for 10 seconds, every 60 seconds). This reduces battery temperature and voltage induced stress.

Conditions are:

- Battery capacity greater or equal to 60%.

- Battery temperature between min and max (defaults: 40-45°C).

Since the "pause" time is very short (default: 10 seconds), its impact on cycle count in negligible. The benefits far outweigh the odds.

60%+ capacity is the threshold at which battery voltage starts getting into the less friendly zone (4+ Volts), particularly with fast charging. Pausing charging periodically for a few seconds allows voltage to settle down.

Of course, all these values can be changed.
[Magisk] to1ya42:
Wow thanks, it's nice to hear, so I should not afraid of losing that 0.01 cycle per every 1% after 60%? It's safe enough for charge controller and battery life?
[Magisk] melgar:
I measured the current with a Multimeter while charging my Pixel 3 with a Wireless charger(RavPower) and noticed that the current is not stable when charging.

It jumps between 250mA and 700mA all the time(roughly every second).

Same behavior when changing "/wireless/voltage_max" value to 9V, then it´s always between 350mA and 1100mA, but never stable.

I monitored it for about 5 minutes only, so my question is if this is normal or just some kind of calibration cycle that will end after some time?

EDIT: It seems the problem here is the Power-Adapter. With another Power Adapter I don't have such glitches anymore.
[Magisk] semdxd:
[MENTION=5228676]VR25[/MENTION] bad battery flag = 1. What does that mean?
[Magisk] Kglim:
Really appreciate for your work sir!

Works fine and really good module i guess!, ?