yashsingh1/xdaforums huggingface dataset:
[Magisk] AlienTeck:
This is a great idea except for one problem. You plug it into the charger and in 2 hours the phone is charged and then it runs on battery.. Until the lower threshold and then it charges the battery again and then stops charging at the pre-set limits..

I think this actually is worse for the battery as the phone keeps running on battery power for most of the day even if its plugged into the wall charger..

Normally the phone charges to 100% and at least on mine, it stays at 100% where it had trickle charged from 95% to 100% at around 500ma or so.. Then it drops of like under 200ma with screen off until deep sleep when it drops even lower and when I turn on the screen it shoots back up to 500ma or so.. The battery is not used as long as the phone is connected to the charger.. So for over 12 hours a day the battery is not used..

It would be great is we can set a limit like instead of 100% it is 80 or 90% and the phone stops charging but the battery is not used to power the phone. I did set 90 90 but then it stops charging at 90% and when it drops to like 89% it starts charging again. Which is again using the battery to power the phone. But this way I doubt the battery will last any longer than the default normal charging routine in the phone.. I have noticed that Samsung only charges the battery to 4.29 volts while LG charges it to 4.35 volts. And this does show where capacity has dropped by 10% per year while in the LG it has dropped by 20%. So while you get a higher rated capacity with the LG, it degrades faster than the Samsung which starts off with a lower capacity but the battery lasts longer holding more charge as time passes by.

---------- Post added at 10:59 AM ---------- Previous post was at 10:56 AM ----------

All I did was to uncheck the app in magiksk app module section and rebooted and the module did not load at boot time. You can also delete it instead of just not running it as well in the same place. And I did notice it did charge to 100% and worked normally.. You can use accubattery to check..

---------- Post added at 11:03 AM ---------- Previous post was at 10:59 AM ----------

I am on Nexux 5x OS 8.1 as well and once it reaches 90% it stops charging and the number goes -ve.. ie the phoen is now working on battery until it reaches 80% and the number will go +ve again..

So this is not a 8.1 issue but particular to that phone. I only have magiksk and rest are default..
[Magisk] mobilizmo:
Hello!

Good job, i try it. But with 'cs', it isn't working, only with 'mcs'. You should fix it in the description.
[Magisk] mistermojorizin:
Does it still work on pixel 2 xl after June update? It took me forever to find this comment, and it finally told me that it's working but it doesn't seem to be really working. I had it working on the May update.

edit: that command worked with magisk 16. For 16.4 the command is su -c /sbin/.core/img/cs/system/xbin/mcs -i Anyway, mine says 80/90 and service is running, but doesn't seem to work on June update.
[Magisk] GammelBS:
It works on DP3 with magisk 16.4 and using the tasker-profile.

The script has to be in $PATH, what is the output of:

su -c which mcs

If nothing, have you tried to rename the xbin-folder of the module to bin?
[Magisk] mistermojorizin:
output of that command was nothing, i changed xbin to bin and the mcs *command* started working, but it wasn't stopping the charging as supposed to. I tried some commands to get it started and it said that the service was already started. I finally got it to start by doing mcs -x picking a different charging switch (4) battery/parallel/input_suspend and then mcs -x picking the default charging switch (1) battery/input_suspend. But it did not survive a reboot. Had to do same procedure to get it going again. The way I had it before the April update, with same 16.4 magisk, it would work automatically after a reboot, without tasker or anything. I'm not a fan of running tasker, so maybe there's an init.d script I could use?

edit: it seems to be working now, just take a few minutes after a reboot to kick in. I don't know if this did anything, but i ran mcs -t, even though I don't have tasker installed just to possibly get a script. a folder was created on the sdcard but nothing was generated inside. after that I noticed it started working. could just be a coincidence.
[Magisk] cyberace1985:
https://pastebin.com/nStnN0xk Heres one for the Pixel XL [not the pixel 2 XL]
[Magisk] Kirito.sh:
Hi,

On my s5 when i install this module the phone suddenly reboot.

What can i do to fix this issues?
[Magisk] nig4tmare:
Guys, what will be the best set up for my S8?

ATM, i set my mcs to (mcs 20 100) - what settings do you reccomend?
[Magisk] guest4711:
For a good balance between battery life and SOT I'd use 20 80...
[Magisk] pippoaacc:
Am I the only one totally unable to use this? Switching works, but everytime after a -d event (eg, mcs 70 30 when reaching 70%) charging disables but battery level stays stuck at that 70% never discharging unless I unplug, which will cause the percentage to jump down.

Oneplus One Oreo (various roms, same behaviour)
[Magisk] Nordblum:
OnePlus One 64 GB, Sultan's LineageOS 14.1, won't work. Please, send help.
[Magisk] MajinkenSword:
Unknown or Unsupported Device

Hi, hope I can have this on my phone. Thanks a lot!
[Magisk] aheadofsingularity:
Huawei P20 Pro Unsupported Device Issue

Hello dev,

I recently changed my phone Huawei Nexus 6P (N6P) to Huawei P20 Pro (P2P).

I have rooted P2P with Magisk and installed Terminal Emulator and installed MCS module via official Magisk repository.

I typed su and then typed mcs, connected charger but MCS says unsupported device.

Can you fix this please?

Regards,
[Magisk] sandaljrpit:
sometimes it can, but sometimes it can not

Stock Rom ( Nougat )

Samsung A7 2016

:)
[Magisk] kawaiiDango:
Doesn't with with OnePlus 6 dash charge
[Magisk] SankyEI:
I am using mi max 2,how to is this? I have flshed it but don't knw how to use it,can't find it anywhere in app tray.
[Magisk] aheadofsingularity:
Install terminal emulator via Google Play and then open it, type "su" then type "mcs"
[Magisk] awesomeironman:
Doesn't work on my redmi miui device
[Magisk] kakajoe:
Like this? Is it right?
[Magisk] aheadofsingularity:
right.
[Magisk] kakajoe:
Thanks
[Magisk] kakajoe:
Ho everyone..

Is it ok if i set 100 95? Cause its a little bit strange for me, when i wake up, i see my battery only 80% :laugh:
[Magisk] aheadofsingularity:
You can do that, but seeing from view of extending battery lifespan.. I don't recommend it.

If you charge your battery 100%, it uses 1 cycles.

If you only charge your battery 80%, it uses only 0.2 cycles.

This means your battery can be used 5 times more than 100% charged one.

With current technology of Li-ion battery, its lifespan is around 500 cycles.

If you keep charge your battery up to 80%, your battery's lifespan will be extended up to (virtually) 2500 cycles.

This means the battery will stay useful even after using 4 years passed. This is actually big difference.
[Magisk] sailsell:
how to use

Downloaded the module but don't know how to use it or how to set limits .. ?? Please guide me bro
[Magisk] guest4711:
You just quoted the guide. Start a terminal, use su to start cs with proper parameters, e.g.

"su -c cs 80 20" --> pause charging at 80%; resume if battery drops below 20%."
[Magisk] sailsell:
I didn't know the su process bro ? and to disable it just disabling the module?.... Bro command not found
[Magisk] guest4711:
The "zip" command is not supported on all busybox-variants. So

BusyBox v1.27.2-meefik (2017-08-27 07:52:02 BST) multi-call binary. supports unzip, but not zip.
[Magisk] priyeshbhawsar:
Awesome module! Can you add a command to control voltage? Is it possible?
[Magisk] guest4711:
su is part of any rooting solution. But you have to grant root permissions to terminal first.

Perhaps you should first try it step by step

(open terminal)
jactivelte:/ $ su
(permit root on popup window)
jactivelte:/ # cs -i

Battery Info
STATUS=Discharging
CHARGING_TYPE=N/A
HEALTH=Good
....
...
LEVEL=93%
TEMP=271
TEMP_AMBIENT=293
jactivelte:/ #

If this succeeds you may try the 1st suggestion...

To your other question: The simplest way to disable the function is by closing the terminal window where cs is called...
[Magisk] VR25:
Those getting the "Unsupported device" message... I've got a little job for you!

Please, pay close attention to the details below. While no cats have been harmed by such a debugging procedure, I shall not be held responsible for anything that may go wrong with your cats due to what you're about to do.

Alright, let's dive right into it then.

As per the debugging data provided, there are several possible control files to test for the charging ON/OFF mechanism.

Your job is to determine which of the files listed is the one we're looking for, and which values (i.e., 0 for OFF, 1 for ON) it works with. A relatively easy way to do that is to take your charger and see how the values change when it's connected/disconnected. Most devices use the values 1 & 0.

Once you have a good guess, then proceed to changing the control value to it's opposite while the device is charging. Use a root text editor or terminal emulator for that. If your battery saver can be enabled while charging or any other signal tells you the battery has stopped charging, then you've got the puzzle solved.

Here's a list of control files I put together:

Galaxy S8

- /sys/devices/platform/battery/power_supply/ac/power/control

- /sys/devices/platform/battery/power_supply/battery/power/control

- /sys/devices/platform/battery/power_supply/battery/batt_slate_mode

- /sys/devices/platform/battery/power_supply/battery/store_mode

Nexus 5

- /sys/devices/f9924000.i2c/i2c-2/2-0070/charger

- /sys/devices/f9923000.i2c/i2c-84/84-006b/power_supply/ac/charging_enabled

Zenfone

- /sys/devices/pci0000:00/0000:00:08.1/i2c-2/2-0036/power_supply/battery/power/control

- /sys/devices/pci0000:00/0000:00:08.1/i2c-2/2-0036/power_supply/battery/power/async

- /sys/devices/pci0000:00/0000:00:08.1/i2c-2/2-0036/power_supply/battery/power/runtime_enabled

- /sys/devices/virtual/switch/battery/power/control

- /sys/devices/virtual/switch/battery/power/async

- /sys/devices/virtual/switch/battery/power/runtime_enabled

Hopefully that list doesn't look intimidating to any of you! If I had all these devices I could've tested them all by myself. Of course, each person has their own ways of doing things. Some can do stuff faster than others, but the truth that matters is, we all can do something. So, get your hands dirty!

Speaking of getting hands dirty... [MENTION=8442574]sailsell[/MENTION], quoting the whole OP is a really... bad... thing... to do. :rolleyes:
[Magisk] guanto96:
For the Nexus 5 changing - /sys/devices/f9923000.i2c/i2c-84/84-006b/power_supply/ac/charging_enabled from 1 to 0 stops the charging
[Magisk] VR25:
Odd... that's exactly what I included in the latest version. Are you sure you've got build 2017.10.11 installed?
[Magisk] guanto96:
Here it is...strange :rolleyes: if I tip su and then "# cs -80" it tells me unsupported device
[Magisk] Sachitoge:
Hey there, my device is:

OnePlus 3

Android Nougat 7.1.1 SDK25

MagiskSU 14.0 by topjohn

Xposed Framework 88.1 (official by rovo89)

So, my device has DASH charging, this means it charges at 4AMP (roughly 3.600mAh on amperemeter inApp/dongle).

And with your software, it doesnt work! I set charge limit to 80% by writing in su "-c cs 80" (without quote marks)

It said everything done, I hooked up the terminal you suggested as a wakelock and disabled doze, it was running and i turned screen on, it hit 80% but still continued charging (it slowed down to 1.800mAh because DASH slows down after it hits ~77%). So, it continued to 82% and then it said charging reached, disabling SF thing, but it continued to charging because it went up to 83% from 82%.

So, doesn't this work with my device?

I am certain terminal was not in doze because it was the main app opened + did check wakelock thing on notification so it doesnt get killed, I counted charging but nope, still charges.

I even tried

su -c cs 80 75

But I plugged in phone and it charged with 77% (when it should charge in 75% of less value).

I would appreciate if you could help us, yes phone gets to 80% in half an hour but as you may know already, fast charging means you could let it go easily to 90% or 100%, thats why I would love this to work on my device, and not to mention that slow cable would mean I had to wait for an eternity go get it charged (imagine, that 30min charging is whats being feelt as normal, and suddenly switching to 1hour and above, that feeling...)
[Magisk] guanto96:
Nexus 5, this is the problem I think:

hammerhead:/ $ su

hammerhead:/ # cs -80

/system/xbin/cs[272]: s=/sys/class/power_supply/ac/charging_enabled: not found

(!) cs: Unsupported device
[Magisk] VR25:
Build 20171013 is up (Magisk repo)

Please, read the notes in the OP before installing!

[MENTION=6165419]Sachitoge[/MENTION], you should be fine now.

Possible, but extremely risky. So, I'm not thinking about doing that anytime soon.
[Magisk] VR25:
Duplicate
[Magisk] Sachitoge:
Still not working.

su

cs debug

Gives an error no zip found in xbin.

I wish this could work with mine.

I use Franco Kernel if its going to help find the reason.
[Magisk] VR25:
[MENTION=6165419]Sachitoge[/MENTION], does charging stop after running echo 0 > /sys/class/power_supply/battery/charging_enabled?
[Magisk] Sachitoge:
Yes it works!

Amperemeter is now on the discharging state (but now its hooked up, even killing terminal does not help). It still does not charge, unplugging doesnt help phone not charges how can i set it back to normal?

Edit: It shows charging indicator but charging led is off + instead its on ~ -300mAh (meaning its discharging but what do i need to write to make it normal back?)
[Magisk] VR25:
Nice! I'll make the necessary changes to the module.

To re-enable the charging mechanism, simply run that command with value 1 (echo 1) or reboot the phone.

Also, can you please post the output of getprop | grep product? I need that information to properly add support for your device. -- Thanks
[Magisk] Sachitoge:
Alright, thanks alot.

When will you push the new update to Magisk Repo?

Edit: how can i get it extracted to text file? Will extended screenshoot be enough or?
[Magisk] VR25:
You can add > /sdcard/info.txt in front of the command. A screenshot is also fine, though.

Will push the new version in a few minutes after getting that info from you.
[Magisk] Vattu:
Thank you so much for this spendid Magisk module!

I used half this weekend to try to figure out how I personally wanted to use this great feature. It turned out to be a nifty and f'ugly UI "app". Try it for your self, either with the attached apk or Tasker project!

So instead of making tons of rules depending on where I am, what I am charging the phone from (computer, adapter, car, wireless...) time of day etc, I just use this quick app to change how I want the battery charging to behave.
[Magisk] jc1266:
I install this magisk module but i unable active it ..pls help
[Magisk] kiseftw:
I'm currently using it and I think it's a great app. My question, how will I know if it is working on my phone?

May I also ask your settings (percentage) on those varying conditions (computer, adapter, car, wireless)? Many thanks!
[Magisk] Jaymin.0.1910:
Your mathematics is correct, but not basically the perfect. It might help you extend the battery, but that should not be a so much like 5 times the original. Although I would recommend charging to 85% and not 80 since that follows better mathematics. BTW, I am the developer of "My Charging Controller".

Regards.

Is this app open source?? Does it support Intel CPUSs (it should not, but still)?? Can we talk a little about dynamic supprt for all devices??
[Magisk] Vattu:
It IS open source. Just download the Tasker stuff!

I have no clue about various hardware support. Just built the app with the help of Tasker's app factory. If your processor supports Tasker, this should be no problem.
[Magisk] Jaymin.0.1910:
Based on my personal experience, Intel CPUs don't have the capability to disable charging (or they don't allow to), so I wanted to know whether you developed a tool for that. But anyways, where can I find sources for the APK??
[Magisk] fi5z.x9:
Hello all, I'm relatively new to this module. I've it installed and ran the terminal codes ( su -c mcs 95 80) upon which I got a response to plug my phone and there after a confirmation that my device is compatible, so I assume it's working

However, my phone charged all the way up to 100%. This got me baffled because I expected it to stop at the value I set (95).

But for reference purpose, in between charge, I disconnected my phone and plugged it back. Pls I'd like to know if this is the cause and does that mean that I've to do the terminal code before charging every single time as long as I don't disconnect the charger?

Or I simply don't need to do the code thing everytime before charging? Pls I'd appreciate any insight. Thanks.
[Magisk] kiseftw:
Could you please tell me what is your default min-max using your charger switch app? Thanks in advance!
[Magisk] wilsonhlacerda:
Bug with Magisk 16.6 Beta???

First of all: thanks for this nice module!

I've been using it fine for a few days with Magisk 16.4 Beta + LOS 14.1, together with 12 other magisk modules. All fine.

After upgrading Magisk to 16.6 Beta MCS stopped working. I tried to disable and unistall it...ok. Now when trying to install again I get:

- Copying zip to temp directory

- Installing Magic_Charging_Switch_(mcs)-2018.3.6.zip

(!) Magisk mount point not found

Failed!

! Installation failed

Seems incompatible with Magisk 16.6. Anyone else?

By the way, the other 12 modules I'm using is running fine with new Magisk version.
[Magisk] Didgeridoohan:
Same answer as here:

https://xdaforums.com/showpost.php?p=77016234&postcount=163
[Magisk] wilsonhlacerda:
Thanks! I'll try it. But strange that it was already installed and was the only module that stopped working after upgrade. Let's see if after twrp flash it works.
[Magisk] Didgeridoohan:
That's because [MENTION=5228676]VR25[/MENTION] uses a custom installation script, where he's added extra checks for the image mount point. Now the loop devices used for that check has changed and is therefore causing issues for [MENTION=5228676]VR25[/MENTION]'s modules. This one is also using the loop device check in the mcs script, so I'm not sure it'll function on Magisk v16.6+ without an update.
[Magisk] wilsonhlacerda:
Thanks for clarification! Yep....tried it, can flash on twrp v3.2.2 without errors, but MCS fails on android terminal: say magisk 16.6 incompatible. We will need a fix.

I also use another [MENTION=5228676]VR25[/MENTION] module, the Magisk Manager for Recovery Mode and this one seems to be working fine considering the quick tests I've done.

So let's wait for VR25 or another dev that can help on that.

By the way, thanks for the good Magik help Wiki!
[Magisk] Jaymin.0.1910:
Could you have posted your installation logs??
[Magisk] RMarques:
MCS module is installed and commands are set, even when that message saying new values were added or something along this love, however, it just work as intended with Magisk 15.4, any other Magisk version above 15.4 and the phone charges normally as it always did.
[Magisk] raosahab:
Does it supported by all devices like Samsung Galaxy note 3 HA3G Exynos Running RR Rom 5.8.5.
[Magisk] jbliz:
Battery charge not enable

After execute su -c mcs -d, it tell me that my device is support

Then execute su -c mcs -e just hanging on waiting for charger...

Now I can't charge my phone, please help me ASAP

Edit:

My phone is charged now after open StartCharging_Test with RotEx
[Magisk] J4jks:
Same for me too

v16.6 is incompatible

Redmi note3 AEX N with magisk v16.6
[Magisk] mistermojorizin:
Installed MCS via recovery and mobile network disappeared (like can't even access the mobile networks menu in settings). Pixel 2 xl latest 8.1, magisk, and recovery. Anyone else experience anything like this? It comes back if I disable the MCS module
[Magisk] Didgeridoohan:
You've got it the wrong way around. The module is incompatible with Magisk v16.6+...
[Magisk] ghl456:
faced this problem: https://xdaforums.com/moto-x-play/help/phone-charging-t3375436/page3

Would this mcs app help me? the main idea, to mock battery status temp protection.
[Magisk] J4jks:
Yeah:silly:

Module is incompatible with magiak v16.6

Waiting for the fix
[Magisk] theooo:
Hello Guys,

Just installed this module and it says that my device is supported. (OP5T OOS 5.1.3 With Magisk 16.0 stable).

I used cs -e 80% and from OP it says my phone will charge to 80% and stops.

My question is this -e is only a one time command or once i use it my phone will directly charge as long it is below 80% and will disable charging again once it hits 80%?

Thank you.

Huge thanks also to OP for this great module and all the efforts in making this great module.
[Magisk] Rikorage:
I'm gonna try and DM him about the issue, in case he isn't aware of it, and hope for a response.
[Magisk] mistermojorizin:
Just to follow up, I got the mobile networks to show up by going into magisk/.core/img/system/mcs and changing xbin to "sbin". I I do the which mcs command, it responds: /system/bin/mcs

But if I do mcs -i, I get

(!) cs path not found

- Unsupported Magisk version or not running as root (su)

I'm on magisk 16.7 by the way. I feel like it's missing a small change to work.
[Magisk] RMarques:
Judging by what I've seen here, sadly, it's plain and simple not working with Magisk latest version.
[Magisk] mistermojorizin:
Any luck on a response from [MENTION=5228676]VR25[/MENTION]
[Magisk] hellcat50:
would like to know too :)
[Magisk] RMarques:
+1
[Magisk] nogaff:
Indeed, the mcs script exits out when it fails to find to the mount point, but do you happen to know how to determine the correct mount point now, for those of us that want to edit the script ourselves?

I mean, looking at this:

for MountPoint in $(grep $loop_device /proc/mounts | awk '{print $2}' | grep -v '/system'); do
...
done

the problem is just the fact that /proc/mounts no longer references the loop device so the grep returns nothing. Seems like it should be simple to fix if you know somewhere else to look for the mount point?

Personally, I've just replaced that loop with a hardcoded $MountPoint to get it working on my device...
[Magisk] Jaymin.0.1910:
Hello guys,

I was the one who developed the algorithms to find the Magisk mount point without hardcoding that (we were both collaborators at that time). But, after watching the current situation, I'd recommend remove all checks and simply hardcode the script to take /sbin/.core/img as the mount point.

Regards.
[Magisk] Rikorage:
Nope, still waiting.
[Magisk] ravish_919:
Love your mod, been using it since the release but it stopped working lately after updating the Magisk to 16.7 with this error

- Copying zip to temp directory

- Installing Magic_Charging_Switch_(mcs)-2018.3.6.zip

Archive: /data/user/0/com.topjohnwu.magisk/cache/install.zip

inflating: common/config/macrodroid

inflating: common/config/mcs

inflating: common/config/switches

inflating: common/config/tasker

inflating: common/service.sh

inflating: module.prop

(!) Magisk mount point not found

Failed!

! Installation failed

Would be great if u can update it to the current Magisk version

Thank u

Edit: gone through the recent posts, now I know what's happening, nvm
[Magisk] psychoela:
Can you fix this for us:D thanks
[Magisk] mistermojorizin:
You got it working with magisk 16.7? Would you be opposed to sharing the modified module?
[Magisk] Jaymin.0.1910:
I might try, currently all loops go to /sbin/.core/block/loop*, right ?? Then I'd recommend try the attached zip. I've just changed those algorithms to match newer loop devices, everything else is the same. This build is not signed. Come back, [MENTION=5228676]VR25[/MENTION].
[Magisk] hellcat50:
On OnePlus 3 it works perfectly!
[Magisk] stevvie:
Working again on my ZUK Z2plus, Discovery 7.1.2

Thanks