yashsingh1/xdaforums huggingface dataset:
[Magisk] darkbasic4:
The default config works very well on my Pocophone F1 with the PixelExperience ROM.

---------- Post added at 11:09 AM ---------- Previous post was at 11:00 AM ----------

Would you be interested into further exploring it? My laptop's battery is at 65% of the rated capacity after just 2 years because of how bad the battery management is. That damn thing keeps the battery under charging voltage for the whole time, unlike my previous Samsung laptop which did run on AC-only once it reached 100%: then you could see it slowly going down to 95% and then it re-started charging once again. Far from being optimal, but still way better than my Dell.
[Magisk] kevsestrella:
Done, though the file only had 2 lines in it...

Edit: ok, I just backread, I'll reinstall

Edit: done, uploaded usable ppwer supply logs
[Magisk] VR25:
That's a pain. I'm also sorry for my own laptops' batteries.

Yes, I'll be exploring this further. Although I understand many kernel things and the kernel as a whole, I'm no kernel dev (yet). My progress in kernel development is slow - mostly due to my fairly unreliable internet connection. The good thing is that since I'm also into electricity/electronics, I'm targeting hardware too - "smarter" power adapters.

Unfortunately, the file is useless, then.

You may not have waited long enough (~1.5 minutes) after the last installation, before rebooting. The installer even reminds you of this. You can reflash the module now just to regenerate that file.

Edit

...And I was late. :p
[Magisk] kevsestrella:
I reuploaded usable logs now. Thanks for your great work ?.
[Magisk] nogaff:
On my Pixel 2 I seem to have an issue with the acc -D command reporting that accd is not running when it actually is.

The file /dev/acc/running does exist with valid pid inside, and acc is definitely controlling charging.

I've been doing some testing and the issue seems to be down to the -q switch on the grep command in this code:

if [ -f $lockFile ] && ps | grep -q $(sed -n 1p $lockFile); then

If I remove the -q switch then suddenly it all works fine, but that obviously results in unwanted output from the grep command to the terminal.

Any idea what's going on here?

Edit: I tested this out further by doing the following:

if [ -f $lockFile ] && ps | grep -q $(sed -n 1p $lockFile); then
echo "(i) accd is running"
else
echo "(i) accd is not running"
ps | grep -q $(sed -n 1p $lockFile)
echo "Testing"
fi

The script never gets to the "Testing" part and instead exits with code 141. I subsequently found this which may be relevant: https://stackoverflow.com/questions/19120263/why-exit-code-141-with-grep-q

Edit 2: This seems to work:

if [ -f $lockFile ] && ps | grep $(sed -n 1p $lockFile) > /dev/null 2>&1; then

I guess the start, stop and restart cases would need the same adjustment.
[Magisk] jvguti:
acdd line 35 do not works

Samsung Galaxy S3 I9300, Resurection Remix Nougat 7.1.

accd Line 35 gives error.

# make sure the number of running accd processes is at most one

sh $modPath/system/*bin/acc --daemon stop 1>/dev/null

modifing:

sh /system/*bin/acc --daemon stop 1>/dev/null

Now works correct.

Magisk 18.1
[Magisk] VR25:
[MENTION=6328144]nogaff[/MENTION], I'll keep this in mind and refrain from piping multiple lines to grep -q.

Thanks

This i odd... ?

Canary Users

I don't want to test that right now. Can anyone tell me what all the new Magisk paths are?

I know that magisk.img is dead and new module paths are /data/adb/modules and modules_update. This is great! Now, how about /sbin/.magisk/? What's changed in there?
[Magisk] nogaff:
I'm using ianmacd's 18.2 build from 2019-02-16 and I don't see anything different to the stable 18.1 release as far as paths are concerned. The deprecated /sbin/.core is symlinked to /sbin/.magisk which currently looks like this:

walleye:/ # ls -Al /sbin/.magisk/
total 12
drwxr-xr-x 2 root root 40 2019-02-16 20:14 block
drwxr-xr-x 2 root root 6520 2019-02-16 20:14 busybox
---------- 1 root root 84 1970-12-02 08:59 config
drwxr-xr-x 14 root root 4096 2019-02-16 14:55 img
drwxr-xr-x 5 root root 100 2019-02-16 20:14 mirror

Anything else you want to know?
[Magisk] VR25:
Is that version image-less as well?

If yes,

- What's in /sbin/.magisk/img/?

- Could you upload your /proc/mounts?

Thanks
[Magisk] Unkn0wM3m3:
I'm really bad with terminal. Can anyone tell me the basics of this module. I want it to stop charging at 90% and start back if it drops below 75.
[Magisk] nogaff:
Yes, it is. It's basically just a canary build with a bit of internal testing done prior to release to avoid boot loops and that sort of thing.

/sbin/.magisk/img is bind mounted from /data/adb/modules so they are one and the same:

walleye:/ # ls -Al /sbin/.magisk/img/
total 96
drwxr-xr-x 2 root root 4096 2019-02-16 01:27 .core
drwxr-xr-x 3 root root 4096 2019-02-16 01:27 Sony-Music4Magisk
drwxr-xr-x 3 root root 4096 2019-02-16 20:14 ViPER4AndroidFX
drwxr-xr-x 3 root root 4096 2019-02-16 01:27 acc
drwxr-xr-x 3 root root 4096 2019-02-16 01:27 active_edge_system_mod
drwxr-xr-x 3 root root 4096 2019-02-16 01:27 adb-ndk
drwxr-xr-x 3 root root 4096 2019-02-16 01:27 busybox-ndk
drwxr-xr-x 3 root root 4096 2019-02-16 01:27 hosts
drwxr-xr-x 3 root root 4096 2019-02-16 14:53 iYTBP-Vanced-Magisk-Repo
drwxr-xr-x 2 root root 4096 2019-02-16 01:27 mm
drwxr-xr-x 3 root root 4096 2019-02-16 01:27 nano-ndk
drwxr-xr-x 3 root root 4096 2019-02-16 01:27 terminal_debloater

walleye:/ # ls -Al /data/adb/modules/
total 96
drwxr-xr-x 2 root root 4096 2019-02-16 01:27 .core
drwxr-xr-x 3 root root 4096 2019-02-16 01:27 Sony-Music4Magisk
drwxr-xr-x 3 root root 4096 2019-02-16 20:14 ViPER4AndroidFX
drwxr-xr-x 3 root root 4096 2019-02-16 01:27 acc
drwxr-xr-x 3 root root 4096 2019-02-16 01:27 active_edge_system_mod
drwxr-xr-x 3 root root 4096 2019-02-16 01:27 adb-ndk
drwxr-xr-x 3 root root 4096 2019-02-16 01:27 busybox-ndk
drwxr-xr-x 3 root root 4096 2019-02-16 01:27 hosts
drwxr-xr-x 3 root root 4096 2019-02-16 14:53 iYTBP-Vanced-Magisk-Repo
drwxr-xr-x 2 root root 4096 2019-02-16 01:27 mm
drwxr-xr-x 3 root root 4096 2019-02-16 01:27 nano-ndk
drwxr-xr-x 3 root root 4096 2019-02-16 01:27 terminal_debloater

I've attached my /proc/mounts.
[Magisk] Antoine164:
You can install the magisk module and use this app if you want.

https://github.com/MatteCarra/AccA/releases

Or juste open terminal and type

"su" to have root access then "acc 90 75"
[Magisk] nogaff:
In addition to [MENTION=4726169]Antoine164[/MENTION]'s suggestions, you could simply edit the config.txt file in the acc folder on your internal storage and change the "capacity=5,60,70-80" part to "capacity=5,60,75-90" (without the quotes).
[Magisk] ugvpkn:
Anyone successfully change charging voltage on the OnePlus 6t running OOS 9.0.12?

I added the onBoot ./battery/voltage_max:3920000 and disabled cooldown using capacity=5,101,70,80. The max voltage seems to be effective but then the battery charges all the way to 100% (onBoot exit is false) and using the phone battery discharges like crazy (losing like 20% in 30 mins) and the battery settings says that apps using battery abnormally.

Maybe with max voltage I need to exit on boot, I will try that. Thanks !!
[Magisk] Lanzer0:
how to fix this?
[Magisk] J4jks:
You have not installed acc magusk module?

Install it from magisk manager, reboot and the app works.
[Magisk] VR25:
deleted
[Magisk] VR25:
Your system is masking battery capacity (%). The voltage you set corresponds to way less than 80% capacity. Obviously, battery won't last long. onBootExit has nothing to do with this, and setting it to "true" won't help. Use 3920000 uV for navigation, gaming, desktop mode, sleep time. For regular usage, aim for 4100000-4150000 instead.

The upcoming version will make this extremely easy to manage.

The app is telling you that the core (acc magisk module) is not installed.
[Magisk] Doublewise:
Hi, is it possible with this module to delay shutdown base on defined voltage. I observed my phone shutdown (0%) on 3.5-3.6 V. I want to get more juice by delay shutdown until 3.2 V then it will calibrated itself on next cycle (?) I think 3.2 is still safe for the battery.
[Magisk] darkbasic4:
You should do the exact opposite!!!!

If you care for your battery you shouldn't discharge lower than 30%.
[Magisk] silmarx:
You think is still safe? What are your evidences or references to make that assumption?

And then why does the manufacturer enforces that limit by default, when it could provide more battery capacity without additional cost?
[Magisk] Doublewise:
https://batteryuniversity.com/learn/article/premature_voltage_cut_off

This is not for frequent practice, only to get higher usage capacity. Then to prolong battery life, use 25-90% cycle imo.
[Magisk] silmarx:
Right, but then there's a risk the battery dies if self discharge continues and it is not charged immediately. For me it seems a dangerous option. What effective capacity do you estimate you would get between 3.5 and 3.2V? Would it worth the risk and the damage/wear caused in the battery?
[Magisk] Doublewise:
Around 10% per 0.1 V.

Let me quote the link I gave you that answer your question :

"Most mobile phones, laptops and other portable devices turn off when the lithium-ion battery reaches 3.00V/cell on discharge. At this point the battery has about 5 percent capacity left. Manufacturers choose this voltage threshold to preserve some energy for housekeeping, as well as to reduce battery stress and allow for some self-discharge if the battery is not immediately recharged. This grace period in empty state can last several months until self-discharge lowers the voltage of Li-ion to about 2.50V/cell, at which point the protection circuit opens and most packs become unserviceable with a regular charger."

So 3.2v I think is OK.

I observed that during phone usage the voltage is fluctuate that causing batt percentage going down unnecessarily fast. After unuse few minutes, the voltage stabilize at higher voltage, but already at lower percentage. That why, I think lowering shutdown voltage can overcome this to get more usage capacity and the phone calibrated itself at that voltage range. Also to compensate lower capacity during shorter charge discharge cycle.

[MENTION=5228676]VR25[/MENTION] can this mod control current flow rather than on off charge? At high temperature or when almost reaching max capacity/volt the current is lower or slow charging.
[Magisk] VR25:
My Moto G4 Play is one of these. System shuts down when battery voltage <= 3 microvolts. At that point, battery capacity is considered 0% (even though it's not true) to prevent deeper discharge, "unserviceable" state (protection circuit open), and eventual cell death (with further discharge).

And that's a good reason not to lower the minimum battery voltage. You see, battery voltage fluctuates, ESPECIALLY under harsh temperature conditions. Battery management systems (BMS) are able to regulate both minimum and max battery voltages to prevent issues. If temperature is unbearable, it makes sense to increase the minimum battery voltage, and sometimes - limit the charging voltage. This protects the battery from dangerous voltage fluctuations.

Your device's manufacturer(s) know that very well. Hence, your minimum battery voltage is well above 3V.

Do you face overheating issues?

How old is your battery (yes, this is also relevant).

Rather than trying to lower the minimum voltage, just perform a full charge and discharge (until system shuts down). Your battery should be calibrated. If the result is not very positive, repeat the process.

Now, keep in mind that this is obviously a last resort. We all know why. So, before jumping into it, recall that many (if not most) batteries nowadays self-calibrate - with impedance tracking and other smart moves. This doesn't require full charge and discharge cycles. What it does require is normal charging/discharging. Normal here means no heavy use, no crazy temperatures for some time (say, at least two days).

Alternate Way to Calibrate

1) Swapp out or disconnect the battery.

2) Hold the power button for about 30 seconds.

3) Reconnect the battery.

If you still want to lower the minimum battery voltage, test whether your kernel allows writing to /sys/class/power_supply/battery/voltage_min_design or similar pseudo-file.

Well, lithium ion batteries have two main charging phases:

1) Constant Current (CC)

2) Constant Voltage (CV)

During phase 2, current starts to drop. When it drops all the way to 0 (or very close), battery is considered fully charged. You can't force more current into the battery. It takes only what it needs and when it needs.

Phase 1 will work with whatever current the battery or charging subsystem can handle. However, BMS will limit the input current under non-optimal temperature and voltage conditions.

The higher the charging current, the faster you get into phase 2. That's a basic fast charging concept.

You can use onBoot or onPlugged to set a custom current. My setting is onPlugged=./usb/current_max:2000000.
[Magisk] kenshin79:
I edited the line as above, and the error message no longer appears when I run accd or acc -D start.

But, accd starts apparently without error, then immediately stops again. Type acc -D and accd is not running again.

Any solution? Device is a nexus 5 with magisk 18.1

Thanks!
[Magisk] jvguti:
acdc not works

I'm not a developer but if you present your actual config.txt file and if you get any class of message when you start accd perhaps we could find your problem.
[Magisk] kenshin79:
Hi!

It seems to be working now, accd now running. Will post again if ever a problem occurs again.

Thanks!
[Magisk] h@l9000:
Could you please provide link of this app?
[Magisk] wilsonhlacerda:
https://github.com/MatteCarra/AccA/releases
[Magisk] svbarbosa:
Hi there! I just got a Mi Max 3 and plan to use it as my daily driver. Is acc working well for you?
[Magisk] cak3lies:
LG V20 user here. I've used this for a couple of months or so. I recently updated to the 2019.01.24 release (I believe I was on 2018.12.26 before), and behavior is different.

It seems whenever charging stops, my phone now indicates this state change. While this doesn't seem to be a big deal by the sounds of it, my phone is awoken and vibrates every time it stops charging to cool down or when it reaches the upper charging bound. So, it does get annoying.

Another difference seems to be in Endurance+ mode, where it used to stay at 41%, but now it dips to 40% and charges up to 41%. This one is not as big of a deal, and this actually seems to be closer to the intended behavior, so not an issue for me.

So my question is—is the first behavior change intentional? If it is, is there a way to change this behavior? I've tried all the charging switches and only one option charges, with the same behavior.

Also, if it's possible for the time being, if you can upload the 2018.12.26 version I can settle with that for now (it seems to be missing in the archive). EDIT: Never mind, I just realized Magisk keeps all downloads in the downloads folder, I got it. Anyways, thanks for your amazing work! I've wanted something like this for a while, and it's truly great.

(I'll add to the data acc-power_supply database with my entry when I have the time)
[Magisk] cloneman1:
is anyone making a Gui for this?

Having to mess with CLI doesn't make this worthwhile for a daily driver device
[Magisk] marsian0:
It woks fine so far.
[Magisk] VR25:
Everyone,

The Telegram discussions and support group is up: https://t.me/acc_magisk.

Unfortunately, not all systems allow users to disable charging notifications. I'm looking for ways to do that, universally.

Meanwhile, you can disable the coolDown engine (acc -s coolDown).

The previous behavior is better. Try enforcing a different charging control file (acc -s s).

https://github.com/MatteCarra/AccA/releases/
[Magisk] svbarbosa:
[MENTION=5228676]VR25[/MENTION], is there an easy way to figure out the switch control file that is in use by looking at the acc logs?

I turned verbose on and tried to find it, but it is over my capacity. :p

I am enclosing the logs. My device is a Xiaomi Mi Max 3.
[Magisk] VR25:
There's no default switch set. By default, acc cycles through available charging switches as needed. The first of the list (acc -s s) is usually the one currently in use (if it works).

The log suggest none of the available charging switches is working.

What's your config (acc -s)?
[Magisk] svbarbosa:
Thanks for the quick reply.

Here is the acc -s output:

capacity=5,101,75-80

coolDown=50/10

temp=400-450_90

verbose=true

resetUnplugged=false

loopDelay=10

maxLogSize=10

onBoot=

onBootExit=false
[Magisk] lucasjs33:
good morning, I do not dominate much of the subject, to see if someone can help me.

I only modified the following command "acc 100 90" because I like to get up and have it high on the battery.

Well, my problem is that between 90% and 100% I have small disconnections and I do not understand why, can someone help me solve it? It is very annoying that at night it starts to vibrate and turn on the screen ?
[Magisk] bruceas:
Sometimes i need to full charge to 100% before a long travel. How i can full charge without edit config file? Is there a trick?

Thanks
[Magisk] VR25:
Try enforcing a charging switch with acc -s s. If all fail to control charging, try acc -s switch ./bms/temp_cold 0 600 (or temp_hot 550 0).

If your system doesn't allow you to disable charging notifications, run acc -s coolDown.

Simply run acc -e or acc -D stop.

When you're done, run acc -D start or reboot the system.
[Magisk] PHiDi:
Install latest Acca from https://github.com/MatteCarra/AccA/releases/

and add the tile. Then you can disable the acc daemon quickly.

br PhiDi
[Magisk] VR25:
I wish we had more standardized stuff. No DRM crap, no charger inconsistencies, no s**t -- everything should work the same. But, hey -- money, right? It's all about the money.

Anyway, the upcoming version will give you the power to schedule (hour:min, daily) commands, profiles, and even scripts.

charge_disable 0 1 will have higher priority, then.

Generally, this is undeniably better than constantly charging and discharging.

It's not good for high capacity/voltage for extended periods of time. This is best suited for the endurance+ (40-41%) and endurance (59-60%) presets/profiles.

See whether loopDelay=5 helps.
[Magisk] Unspec:
Yup, Google finally introducing wireless charging in the Pixel lineup, and then immediately DRM's it. Infuriating.

When I left switch undefined/commented out, it seems to give input_suspend priority. It was doing the whole connect/disconnect thing when I first started using ACC, and until I forced switch to be charge_disable it wasn't doing bypass. So it seems to give priority to the first thing that works, and doesn't continue to test the other switches? Not sure.

Wait, is bypass not good for high capacity/voltage states? Or are you referring to constantly charging and discharging.

I'll test that as soon as I can. It appears that ACC is no longer respecting resume-pause anymore... Phone charges to 99% and then goes into bypass mode. I set it to 85-90 even, plugged the phone in at 92%, and it just went straight to 99% and only then entered bypass.
[Magisk] VR25:
That's right. Whichever works is used. Others are forgotten (until the currently working switch fails).

For high capacity/voltage states, discharging slightly is actually better than keeping the battery capacity/voltage high for too long. That may seem counter-intuitive, but it reduces battery stress.

:rolleyes:
[Magisk] runeupo:
would it be possible to implement reset of battery statistics after unplugging? because with citrus and miui9 the stats (screen on time etc.) are not resetted to zero when the charge is not up to 100 percent.

/edit: never mind, found the daily battery stats-xml-file in /data/system and reinstalled bbs ?
[Magisk] Tsaviouranzo:
Nice Module, is there a way to reset and do a clean cs command without auto restore coz I did, "su -c cs 80 20" & it maintains same despite many attempt of un/install and cant charge unless "su -c cs -d". Help M8 RR 5.8.5
[Magisk] umeshbluezzz:
Device unsupported error

How to use this module? Showing device unsupported error.
[Magisk] dyingbread:
OP stated that battery stats are erased automatically, but my battery stats history is still there after my phone charged to 80%. Is it bug?
[Magisk] Ridsever:
Hi, I tried everything (I think...) to make this module to work. Run "cs" command as root in Termux and Terminal Emulator, and by macro in MacroDroid.

My phone is Huawei P8 Light (ALE-L21) freshly rooted by Magisk and with unlocked bootloader, stock rom installed.

u0_a48@hwALE-H:/ $ su

root@hwALE-H:/ # cs -i

getprop: write: Broken pipe

getprop: write: Broken pipe

Battery Info

/system/xbin/cs[367]: cat: /sys/devices/platform/battery/power_supply/Battery/uevent: No such file or directory

root@hwALE-H:/ #
[Magisk] runeupo:
macrodroid didn't work for me as well,

What worked, in termux:

su #

cs 80

then I plugged in the charger and it started the charging and stopped at 89% (the next charge, in a few days... I will try cs 72)
[Magisk] deepu_:
Getting error same as above when I run

> cs -i or cs 90

Battery Info

/system/xbin/cs[367]: cat: /sys/devices/platform/battery/power_suppply/battery/uevent: No such file or directory
[Magisk] dyingbread:
Macrodroid is work fine for me. Make sure triggers and constraints are right.
[Magisk] runeupo:
as Linux-user I very much like termux ??
[Magisk] Tsaviouranzo:
Nice work though charging doesn't stop for me, htc one M8 RR 5.8.5. Here are the logs thanks.
[Magisk] Ridsever:
Your settings works perfect on my phone. Charging stops exactly when it should.
[Magisk] dyingbread:
It would be perfect if battery stats reset automatically after charged to 80%.
[Magisk] deepak549:
Excellent :good:
[Magisk] cybugz:
Is this compatible with exynos unit? Like note 4
[Magisk] dft601:
Is there a chance to say the smartphone with how much mA the charging should be. So I can charge with that speed that I nearly have the 80% when I wake up.

Most time when I get up my battery has already dropped to 65-60%.

Or do I have to use an old and slow charger in my bedroom?

Mike

Gesendet von meinem SM-G950F mit Tapatalk
[Magisk] Taracair:
The clue to your case is to get rid off battery drain cause.

Check out greenify and amplify threads at xda. 15-20% of drain during the night is very high.
[Magisk] dft601:
Yes I know. But it's not the device. I am running sleep as Android all night long.

So Today on Holiday I got up 90 minutes later than usual and start with 52%

Gesendet von meinem SM-G950F mit Tapatalk
[Magisk] Ridsever:
I think I have found what is wrong.

/sys/devices/platform/battery.0/power_suppply/Battery/uevent <-- this is path to the file "uevent" in my phone but I dont know how to correct it (rename "battery.0" to "battery" not working even with root permissions).
[Magisk] Taracair:
You should be able to get 80% with Macro or Tasker, because the Terminal will be waiting for you to press enter to re-enable charging.
[Magisk] ant090876:
On my device Uhans a101 this module don't working: error in terminal emulator "cs: Unsupported device". Why? :confused: cs -h and cs --help is working.
[Magisk] VR25:
**2019.2.27 (201902270)**

- Advanced and assisted charging voltage control. Refer to README.md or `acc --help` for details.

- Automatically unset nonworking charging switch (fallback to cycling through all).

- Daily Job Scheduler (djs) -- run `djs` or refer to its README.md to learn how to schedule commands, profiles, and even entire scripts. That's a standalone Magisk module.

- Enhanced debugging tools (e.g., `acc -x|--xtrace <other option(s)>`)

- Flexible framework and easy installer for app developers

- Log monitoring (`acc -L`)

- Major fixes and optimizations

- On demand charging control files tester

- Reset config with `acc -s r`.

- Self-upgrade (enabled by default, virtually no impact on mobile data - acc zips weigh way less than 100 kilobytes)

- Updated documentation -- added troubleshooting section and more.

- Updated links and default config.

- When persistent verbose is off, volatile verbose is generated (`/dev/acc/acc-daemon-*.log`).

- Workaround for Magisk service.sh bug (script not executed)