yashsingh1/xdaforums huggingface dataset:
[Magisk] hyborian:
Ok ... let me know what to test.

Oh, yes, one quirk with the Xiaomi 4A where MCS is working fine. Once it reaches the top limit, 95% for example, the phone changes the percentage to 100% at some point of time. I then unplug it after a few minutes, and the real percentage comes out, like 93%. Just info for those with the same phone and going to use MCS, as it can confuse. Must be a Xiaomi thing.
[Magisk] phantom146:
[MENTION=5228676]VR25[/MENTION]

Everything is fixed on my side as well ?
[Magisk] nig4tmare:
its ok to stay with 95/85 or better 90/80 or its not big diffrent between these two options?
[Magisk] Da-BOSS:
I just wanted to add that I did what you said by adding # before coolDown and coolDownUSB on the config file but it was still limiting it to 70% so.. I removed the beta mcs and came back to the stable ones and it works to the limit that I set which is 87% / 85% ;)

I will wait for your next beta ones and hoping it will be fixed.... as having those new features that is found on beta is really amazing and I really want it to be stable to save my battery on long term use :fingers-crossed:

Don't get me wrong... I am not asking for any ETA's!! :)
[Magisk] VR25:
Please, upload /data/media/mcs/logs/mcs-debug-*.log (Xiaomi 4A) and the output of su -c find /proc -type f >/sdcard/proc.zip 2>/dev/null (Xiaomi Note 4X).

Thanks

What matter most in this particular case are the big numbers. There's not a huge difference between 95 and 90 per se, in terms of the impact on battery lifespan. It's still notable, though. Thus, I would go for 90 80 (or 90 85) on regular days and 95/90 (or 95 85) on travel days. You can also get useful tips from electric cars battery charging videos/guides. These are gold.

But you Da-BOSS after all, so...

I gotta show some respect. :p

Anyway, I know exactly what's going on and am already working on the next update.

Thanks
[Magisk] hyborian:
I could not upload proc.zip for the note 4x as the size exceeds, so I put it in Dropbox :

https://www.dropbox.com/s/3o3vpv715g7iyk2/proc.zip?dl=0

I will send you the logs for the 4A later after I reinstall mcs. It turned out to be a problem after all. Once the phone automatically changed the figure to 100%, it stayed that way until unplugged from charger.
[Magisk] VR25:
Better include proc.zip for the 4A too, then.

Thanks

---

**2018.11.12-beta (201811120)**

- Added <9095/travel> preset.

- Blacklisted problematic switches.

- General optimizations

- Merged <keys.txt> into <switches.txt> to prevent misleading value readings; more advanced functions to handle that. These changes solve charging control issues on Samsung devices.

- Pause for 1 second after toggling a switch, only if necessary (accuracy and efficiency).
[Magisk] paolocorpo:
Thanks for update as usual ! :)

How/When do you suggest to use the new Travel setting ?
[Magisk] aouerfelli:
Makes sense to use it for when you're traveling. I guess that means when you're not going to have access to a charger for a while.
[Magisk] paolocorpo:
Yes, I think so too

But what does it mean that it is preset ? How activate it ?
[Magisk] paolocorpo:
Dear [MENTION=5228676]VR25[/MENTION]

I installed last beta

No issue: the max capacity has been raised wo problem ;)

I have only the doubt that the config.txt or the previous version has remained unchanged

In fact I got 85% as my previous setting

Can you double check ?

Inviato dal mio Mi A1 utilizzando Tapatalk
[Magisk] psychoela:
Thanks for updated.:D but this version not work with me, charging stop at 80% but my set 95, u can see my ss, though i restart daemon but still not working,. or something I've forgotten to do? :p
[Magisk] VR25:
Config is overwritten only when I add new variables/info. The latest version has new features but these don't affect config.txt. ;)

Regarding the travel preset... it's meant for ocasions when you don't have as many opportunities to charge your battery (i.e., emergencies, power outages, in the wild, long travels).

Presets are aplied with <mcs -s PRESET> or <mcs --set PRESET>. These are tailored settings for various situations. To see a list of available presets, run mcs. <-- [MENTION=5056724]paolocorpo[/MENTION], correction here

Thanks

Will take a look. :p
[Magisk] paolocorpo:
Dear

I have clear how change the value

Max

Resume

Etc

Using config.txt or using mcs command

But I have not understood how set one of preset combination

I used the command:

Mcs --set capacity preset

But I obtained on capacity line the value: preset

Is it normal?

I think no

Inviato dal mio Mi A1 utilizzando Tapatalk
[Magisk] VR25:
Applying a preset is as follows...

mcs -s PRESET

OR

mcs --set PRESET

Available presets are: 9590/travel, 9080/lite, 8070/default, 6059/endurance and 4041/endurance+. You can use either the names or the numbers.

Example: <mcs -s default> or <mcs -s 8070> do the same as <mcs --set capacity 5,60,70-80>. As you can see, it's much simpler.

Recall that the generic syntax of <mcs --set capacity 5,60,70-80> is <mcs --set capacity shutdownCapacity,coolDownCapacity,resumeCapacity-maxCapacity>.

Run <mcs help> or just <mcs> for more.
[Magisk] hyborian:
Ok, here are the logs for the Xiaomi 4A. Using the latest mcs-2018.11.12-beta.zip

Once it reaches the top limit, it stops charging, and it no longer changes the value to 100%. However, while still plugged in, the value will remain as it is, never changing. Thus, it will never charge anymore, even if in reality the batter is draining down.

It only goes back to the real percentage value when unplugged.

When plugged in again, it does not charge anymore, even if the current percentage is in between the minimum and maximum.

Thanks, hope you can find something.
[Magisk] javieracdc:
I have the same problem, I've set to 90% but only charge untill 80% :(

Using the latest mcs
[Magisk] Da-BOSS:
testing on my note 9 now.... :)
[Magisk] psychoela:
[MENTION=5228676]VR25[/MENTION] sorry about this, now i understand what going here,my mistake, this version work like is supposed. Thanks again:p
[Magisk] Da-BOSS:
It is working as intended :) and it reaches to what I have set which 87%... Thank you BOSS! ;) Now you are the BOSS not me :D
[Magisk] VR25:
Please, share your findings to help others who still face that issue! ;)

Thanks

Cool :p
[Magisk] Da-BOSS:
Unfortunately... there's bad news or by other meanings I think it is a new bug?

MCS charges the battery to 87% as I set to it but when I unplug the charger and it goes under 85% and then plug it again... it won't charge at all :( it just work for the first time to the target I set 87%. After that when it stops charging it won't recharge again when it goes under 85%

I tried to change the target for example I put charge when it goes under 90% and stop when it goes 95%. It will reach 95% of charging and stops there... once I unplug and play with my mobile and goes under 90% it won't charge at all... I must reinstall MCS just to work for the first time only :(

Here's the logs :)
[Magisk] VR25:
The logs say there's a small problem with temperature readings. This is yet another device-specific issue. I'm fixing that.

Thanks
[Magisk] VR25:
**2018.11.13-beta (201811130)**

- Fixed temperature reading issues (Samsung, Xiaomi, possibly others).

- General optimizations

[MENTION=8671532]hyborian[/MENTION], try this on the 4A. Charging should resume automatically now.

- The percentage issue may be related to the system itself.

- As for the 4X, please upload its /proc/mtk_batttery* as a zip.

Thanks

[MENTION=4575578]Da-BOSS[/MENTION], try this one too.
[Magisk] javieracdc:
Is there a command to reset the battery chart every time it reaches the set load?
[Magisk] VR25:
su -c dumpsys batterystats --reset

MCS runs that automatically once max capacity is reached.

This is a built-in system command. It may not work on all ROMs, though.
[Magisk] Da-BOSS:
Testing right now BOSS... :)
[Magisk] paolocorpo:
First trial with last beta

Plugged to AC charger over night no problem: the max capacity has been reached

Thanks [MENTION=5228676]VR25[/MENTION]

Paolo

Inviato dal mio Mi A1 utilizzando Tapatalk
[Magisk] Da-BOSS:
Still the same issues :( It works for the first time only to the target I set which is 87%.. once I unplug the charger and use my mobile until it becomes under 85% and then I plug it on the charger and it doesn't charge any more :( same issues.. it works only for the first time after that it doesn't charge at all no matter how low you are.. :( I tried to disable #coolDown #coolDownUsb even the #temp and still the same issues.

Here's the logs... :)
[Magisk] VR25:
Here's the error:

+ dumpsys battery
+ grep -iq 'powered.*true'
+ grep -v USB
Can't find service: battery

What's the output of su -c dumpsys battery?

And...

1) su; sleep 10; dumpsys battery

2) Immediately turn screen off and wait 15 seconds

3) Check the output

Thanks
[Magisk] Da-BOSS:
Here.. I did it all but I have one question... do I need to do this while it is plugged in? Or unplugged? And do I need to do it while MCS is installed? Or not? :) I just wanted to give you the logs you need :) Anyway here is the screenshots doing what you asked for while unplugged :)

I did multiple screenshots just trying to give you what you need BOSS :)
[Magisk] VR25:
For now, that's all I need.

Thanks

---

[MENTION=4575578]Da-BOSS[/MENTION], I found one issue, but it doesn't justify the main problem.

Please grab </data/media/mcs/logs/service.sh.log> a minute or so after battery capacity drops to (or below) resumeCapacity. Charger must be connected. This is the time when charging is supposed to be resumed.

The log you provided doesn't show anything relevant to the "charging not resuming" issue. You grabbed it too late.

---

This is for all: whenever you come across an issue, immediately copy </data/media/mcs/logs/service.sh.log> to somewhere safe if you can't report the problem right away. This ensures you always provide the most relevant logs.

Those who are familiar with logcats know these must be grabbed while or shortly after the target issue occurs. Else, nothing relevant is found. Same story...

Due to this rather inconvenient bug reporting requirement, I'm putting MCS's debugging tools on steroids once again. Users won't need to worry about grabbing logs on time, as these will have a larger size limit and be preserved for longer.

Thanks
[Magisk] psychoela:
I got 2 time today, charging not start below resume capacity, thanks
[Magisk] Da-BOSS:
I did that and another thing... I noticed is when I lower my battery near to 50%... It began or resume charging!! Look at my screenshots...While it is already must begin much earlier than that when it goes under 85% But... while it was charging it reached to 70% and stopped there while the target must be 87% :(

I did what you said and here is the logs :)
[Magisk] J4jks:
With latest beta

Charging didn't stop at set value

Moto G 2014 with magisk 17.3+systemless xposed

Thanks
[Magisk] VR25:
**2018.11.15-beta (201811150)**

- Always overwrite charging control files to ensure kernel always notices the changes on time.

- Disabled <coolDownUSB> (dedicated); the current implementation doesn't work for all. For the time being, <coolDown> (regular) will work with USB charging as well.

- Enhanced debugging tools (better logs, more info)
[Magisk] paolocorpo:
Dear [MENTION=5228676]VR25[/MENTION],

I have immediately installed last beta

I am trying it into my car using lighter charger adapter

I come back soon with my report

For now ... All look well

Thanks as usual

Paolo

Inviato dal mio Mi A1 utilizzando Tapatalk
[Magisk] Da-BOSS:
Testing right now with my Note 9 :) I'm in search and destory bugs mission BOSS :highfive:
[Magisk] onliner:
Hi, I just want to say thanks for this incredible tool, I've been using it for months (since Jan I think) and it's just amazing.
[Magisk] tcnineteen:
Hi [MENTION=5228676]VR25[/MENTION], thanks for providing this incredible tool for us. I've been using this for several months, but the function seems to be inconsistent. Besides, in the recent betas (after 2018.11.8.1), my battery percentage stays unchanged even though it's actually being charging. I tried to keep it charging and reboot, and the battery percentage will jump to a higher level, eg. it stays at 34% with cable plugged in for 20 minutes, and when I reboot it, it jumps to 58% or something. It didn't happened before the 2018.11.8.1 beta. Could you please check it out? Thank you!

https://drive.google.com/file/d/1mRVrfdCzcidSJSvkf9WCEf1XHKRAMNST/view?usp=drivesdk
[Magisk] Da-BOSS:
Unfortunately... still kinda the same issues :( but different this time... I charged my mobile to the limit I set 87% but it stopped at 91% so it is kinda stopped too late.. anyway... I unplugged the charger and used it till it is under 85% and I put it on the charger again and it began charging! But.. it stopped too early this time at 80% :( and it doesn't want to charge my battery at all...

Here's the logs.. :) I provided a 2 screenshots to see what is happening ;) one of the screenshots says it is charging... but on the status bar there's no sign of charging and it keeps getting lower even though it is plugged in to the charger.

Edit:-

I even provided the output [su -c dumpsys battery] in order to see what's is happening including logs2.zip at the time of taking this screenshot :) while still the battery gets lower even though it is on the charger... you can see at the top it became 74% now :(

Edit:-

I did another try right now.. and I think whenever it goes under 70% of battery it will begin to charge but once it reaches 70%.... it won't past the 70% and it will stop :( .... check logs3.zip :)
[Magisk] javieracdc:
With the latest beta I set to stop charging at 90% but it stops in 65%

Enviado desde mi Redmi Note 5 mediante Tapatalk
[Magisk] paolocorpo:
No problems here with last beta ;)

I used it overnight with AC charger and into the car with lighter adapter

Inviato dal mio Mi A1 utilizzando Tapatalk
[Magisk] slayer1991:
I just tried latest 11.15 beta, and it caused a reboot when charging from USB.

It also didn't stop wireless charging at the set 80%.

I'll try to spot something in the logs myself.
[Magisk] VR25:
Thank you all for the reports, supporting logs and feedbacks!

At this point, I'm thinking that toggling multiple charging switches (control files) may be the root cause of some, if not all of the reported issues. Lets see how that holds up after reading all logs.

Meanwhile, more experienced users could try setting <customSwitch=> to see how things go.

A few examples...

Motorola devices (Qualcomm SoCs only):

customSwitch=./battery/charging_enabled 1 0

or

customSwitch=./battery/battery_charging_enabled 1 0

Samsung

customSwitch=./battery/batt_slate_mode 0 1

or

customSwitch=./battery/store_mode 0 1
[Magisk] paolocorpo:
Dear [MENTION=5228676]VR25[/MENTION],

please ... can you clarify better the funcionality of setting <customSwitch> ??

Thnak you

Paolo
[Magisk] VR25:
Setting <customSwitch> forces MCS to use only that one switch for charging control.

When it is not set, the module uses all the available switches from its charging control files database (switches.txt).

Setting customSwitch=<path> <onValue> <offValue> is particularly useful when the database doesn't contain a suitable switch for your device, but you happen to known a working control file for it.

/data/media/mcs/mcs-debug-$deviceName.log contains available switches and other device-specific info.
[Magisk] dragoi90:
Dear [MENTION=5228676]VR25[/MENTION]

Im on a Oneplus 6 running stock rom (9.0.2 - PIE) with xXx latest module.

Anyway your latest beta work fine but it breaks Viper4Android.

The stable MCS works as intendet with viper.

Anyway please have a look.If you need anything (logs,etc) just ask

Thank You in advance
[Magisk] phantom146:
[MENTION=5228676]VR25[/MENTION]

Everything works fine but the dreaded qpnp smbcharger17 wakelock is back for my N6P. Right after going to 80% that partial wakelock wont allow my device to sleep. Attach are the logs:

EDIT: it seems you are right on changing the control files. When I changed it to charging_enabled the wakelock goes away, it seems that multiple ctrl_files within mcs creates this wakelock. How about trying to incorporate a choice method in terminal for this?

Thanks
[Magisk] VR25:
Working on that and more...

Thanks
[Magisk] slayer1991:
Logs from this morning, the phone was supposed to charge up to 80%, but at every increment charging would stop, and screen would turn on; then a bit later charging would resume.

Skimming through the logs, I guess that's how the cooldown feature at work?

capacity=5,60,77-80
coolDown=50/10
temp=400-450_90
verbose=false
loopDelay=10
maxLogSize=10
[Magisk] phantom146:
It is. If you are running a custom ron, disable "turn screen on when plugged in" if you dont have that option then theres pretty much nothing you can do. It is baked on Android ever since lollipop.
[Magisk] J4jks:
With 20181115 beta, changing didn't stop at set value, with and without custom switch

Complete config and logs attached.

Thanks
[Magisk] javieracdc:
Anyway to disable cooldown?
[Magisk] paolocorpo:
Find the config.txt into /data/media/mcm folder

Open it and edit the line:

coolDown=50/10 # ....

as

#coolDown=50/10 # ...

close and save
[Magisk] davidzam:
Hi. Do you remember me? [emoji4] I would like to update to the latest beta. But I want this behavior while charging.

When it reaches a 100% I would like the chargin process to stop... Them restart chargin again when the battery it's drained at 80%, without disconnecting the charger. (USB or wired charge)

Also I don't want the device to turn off at 5%, if necessary, I need it to drain completely...

Where do I change those values?

Is there anything else I need to know?

Thank you.

Enviado desde mi SM-G550T1 mediante Tapatalk
[Magisk] VR25:
Yes, set capacity=0,100,80-100. You can do that either manually (with a text editor) or by running mcs --set capacity 0,100,80-100.

---

FAQ

1) What do these numbers mean?

A: capacity=shutdown,cooldown,resume-stop
[Magisk] davidzam:
Testing now. Thank you.

Enviado desde mi SM-G550T1 mediante Tapatalk
[Magisk] Da-BOSS:
[MENTION=5228676]VR25[/MENTION] Is there anything I could do to help you getting Note 9 fully functional with new betas? like logs or files you need? etc.... I love the idea of reducing battery stress and using your mechanism of preventing battery from degrading on long term ;) as I am now sticking with the stable release which is working as intended :)

I already provided all the logs in the latest beta 11.15 on previous posts :)
[Magisk] cybugz:
i tried to use this command but error occur..

(!) Invalid argument(s)
[Magisk] paolocorpo:
Hi,

In which way have you done it ??
[Magisk] cybugz:
I tried the command using terminal.

mcs --set capacity 0,100,80-100
[Magisk] cybugz:
This is the error occur on terminal
[Magisk] paolocorpo:
let try:

mcs -s --set capacity 0,100,80-100

or

editing config.txt using txt editor

You find here:

/data/media/mcs
[Magisk] javieracdc:
What is the meaning of 50/10 in Cooldown?

What happen if I change to 100/10?
[Magisk] psychoela:
Charging will run 100 seconds then stop 10 seconds
[Magisk] paolocorpo:
Yes you are right but only if the % is inside cooldowncapacity and max capacity and only if the Temperature is lower than max

Inviato dal mio Mi A1 utilizzando Tapatalk
[Magisk] javieracdc:
The cooldown method doesn't damage the battery?

Because the battery is constantly charging and pausing charging in each time in seconds due cooldown method.
[Magisk] psychoela:
Good question, but which is better for the battery in a hot state or we can keep the battery temperature in a comfortable state
[Magisk] javieracdc:
The high temperature can be produced using fast charger, because it uses above 2A and using high voltage.

If you use a normal-low charger, (below than 1,5A and constantly 5 v) the temperature will be low.
[Magisk] psychoela:
And this is the purpose cooldown for 2a n up
[Magisk] onliner:
No.
[Magisk] Da-BOSS:
Testing on my note 9 now... will report as soon as possible :)

And thanks! Yea this picture makes more sense related to my name :cool::D
[Magisk] psychoela:
[MENTION=5228676]VR25[/MENTION] latest beta not working here, stop charging at cooldown. Thanks
[Magisk] jordiz86:
15-11 beta didn't work for me, didn't work cool down and stop/resume so basically nothing :D switched to 13-11 and it works flawlessly! Will try after work new beta! Ps: I have a galaxy s8+ F model :)
[Magisk] javieracdc:
I will test :)
[Magisk] paolocorpo:
Thanks for the update

Very soon I will come back with my trials

Ciao

P
[Magisk] phantom146:
[MENTION=5228676]VR25[/MENTION] I will test more but unfortunately on my first try the latest beta isnt working as intended. I may be wrong but I will be back with logs soon (I have restarted acçidentally).

Also with your voltage_max template under misc, mine was set to 4400 upon checking /battery/voltage_max but when I checked max_voltage_design i5 eays 4400000. Thats a lot of missing zeros. So Im wondering if mcs limited this?
[Magisk] georgiapi:
EX Kernel Compatible?

Hi, I did a search but see no yes or no to my question. I'm running a Magisk rooted OP6 with EX Kernel & latest Pie..

If there is no info here one way or the other on the EX Kernel what Kernel do you guys recommend? I like the Kernel but not married to it.

Thanks
[Magisk] VR25:
MCS won't automatically set this unless you config it to.

The difference in zeroes is common.These are just two distinct measurement units -- 4400 mV (millivolts) and 4400000 uV (microvolts) -- 4400000uV = 4400mV = 4.4V.

Obviously, while modifying voltage_max, you must take into account whichever unit is in use. That's a relatively dangerous territory. Also, beware that not all kernels allow changing that value.

By the way, whenever you change voltage_max, you don't have to modify voltage_max_design too. Tweaking the latter is very likely a dead end anyway.

For OP devices, any kernel is fine.
[Magisk] paolocorpo:
Dear [MENTION=5228676]VR25[/MENTION],

I installed yesterday your last beta release

It look as running well

I plugged device to AC charger when. It was 50% around charged

I went to sleep

I found device this morning (after around 9/10 hours) with 75% and in discharging trend too

I suppose that it reached 80% and started a discharging rate (for my fortune no so speedly) showing a 75% after probably 5/6 hours

Now I edited (as my habbit) the config.txt increasing maxCapacity (from 80 to 85) and resumeCapacity (from 70 to 80)

I restarted and plugged to AC charger again

I will post my report later

Let see pictures related to first trial

[EDIT]

2° trial

I confirm: NO PROBLEM with last beta using AC charger - I reached maxCapacity

Weel done

Nex trial: I will use USB charger

Inviato dal mio Mi A1 utilizzando Tapatalk
[Magisk] georgiapi:
Never Mind Folks, FYI,

After having MCS installation fail issues on my Systemless Magisk rooted OP6......

I found the apk "Battery Charge Limit" (BCL) on play store and although its not as configurable as MCS it was plug and play.

I never shut my phone off so I don't need most of the options MCS can provide. I really just need it to start @40% and stop @80%.

A sweet option I do need in both BCL & MCS is when transferring files and such its not charging over the set limit. When I was unlocking and rooting I had hiccups and the phone was connected to do ADB work longer than I would have liked.

No need to use an emulator either.

Thanks,
[Magisk] VR25:
**2018.11.23-beta (201811230)**

- After starting/restarting daemon from terminal emulator, the app can be closed.

- Clean downgrade support (prevents incompatibility issues)

- Fixed <mcs -s s/switch>

- General fixes & optimizations

- Open log (mcs -l/--log) and README.md (mcs -r/--readme) w/ specified <editor [opts]> (else, with vim/vi).

- Support for system mode (legacy/Magisk-unsupported devices) and Magisk Canary builds. Flashing the same version again uninstalls MCS from /system. If your system doesn't support init.d, use an app to run <(mcsd &) &> or <mcs -d/--daemon start> on boot. Once mcsd starts, the app can be closed.
[Magisk] phantom146:
I just saw this thread and was waiting for the telegram notif lol. I hope you havent forgot your channel.