Search This thread

eried1

Senior Member
May 27, 2016
434
68
Stockholm
So it seems I finally got the module working.

TO ALL NEWCOMERS: Start by find a good switch; that is to say, run the test in a terminal, look at the output and configure accordingly.
 
  • Like
Reactions: Lada333

Uluru25

Senior Member
Nov 27, 2016
400
154
Samsung Galaxy S7
Samsung Galaxy A6
So it seems I finally got the module working.

TO ALL NEWCOMERS: Start by find a good switch; that is to say, run the test in a terminal, look at the output and configure accordingly.
When you write "find a good switch": I only saw working and not working switches. Some of them stating: "idleMode=true".
Thus, how to find among the working ones a good (or even the best switch)?
 

rei20

Member
Sep 5, 2021
22
5
Hi, got evertything going good on my oneplus3T lineage 18.1, magisk,no gapps phone. The project I'm doing is making my car smart and I'm using this phone as the heart of the system. I am stuck at one final thing to get everything working as I want. To make phone boot on power connected. Is there a way to do this using AccA? Or any other ideas? Thanks
Can you share your setrings? I'm having trouble getting it to work on my 3T, also LOS 18.1
 

Lada333

Senior Member
Feb 7, 2016
1,453
490
22
Budapest
OnePlus 3T
Google Pixel 6a
When you write "find a good switch": I only saw working and not working switches. Some of them stating: "idleMode=true".
Thus, how to find among the working ones a good (or even the best switch)?
A "good switch" is definitely one that works :D
If a switch is reported not working/doesn't have a tick emoji coming up, it cannot be used for setting custom values.

idleMode=true only means whether or not you can have native battery idle mode (pbim) enabled. Some devices/kernels don't support this feature anyway, so no worries if all switches say idleMode=false.

Other than that, you can run
Code:
acc --test
2 or 3 times to make sure there are no false positives.

From this point on, it's all up for you to experiment with the working switches to find out which ones grant you access to all features you'd like to use.
 

Uluru25

Senior Member
Nov 27, 2016
400
154
Samsung Galaxy S7
Samsung Galaxy A6
A "good switch" is definitely one that works :D
If a switch is reported not working/doesn't have a tick emoji coming up, it cannot be used for setting custom values.

idleMode=true only means whether or not you can have native battery idle mode (pbim) enabled. Some devices/kernels don't support this feature anyway, so no worries if all switches say idleMode=false.

Other than that, you can run
Code:
acc --test
2 or 3 times to make sure there are no false positives.

From this point on, it's all up for you to experiment with the working switches to find out which ones grant you access to all features you'd like to use.
Thx, that's what I do. I hoped there might be a smarter way (than trial&error) to find the best one. 😁
 

AnonVendetta

Senior Member
Apr 29, 2016
1,484
531
What command does acc run when it disables charging? I've noticed that I can leave the device plugged in, yet acc can and does switch off charging when battery % gets to a certain level. I'm figuring it must be using some command to do that. And now I have a use for it (or want to test, at least) in another scenario.

I can use a dumpsys command to simulate disabling charging, and android will think it's not charging. But it doesnt really stop charging.
 

Lada333

Senior Member
Feb 7, 2016
1,453
490
22
Budapest
OnePlus 3T
Google Pixel 6a
What command does acc run when it disables charging? I've noticed that I can leave the device plugged in, yet acc can and does switch off charging when battery % gets to a certain level. I'm figuring it must be using some command to do that. And now I have a use for it (or want to test, at least) in another scenario.

I can use a dumpsys command to simulate disabling charging, and android will think it's not charging. But it doesnt really stop charging.

Can't you call acc -d with this other app or whatever that you're trying to use?
 

AnonVendetta

Senior Member
Apr 29, 2016
1,484
531
Can't you call acc -d with this other app or whatever that you're trying to use?
It's this:

So you see now, a battery case for my phone. It features pass through charging to the phone. The goal here is to switch off charging for the phone's internal battery, while allowing the battery case to charge (which has a separate battery of its' own).
 

AnonVendetta

Senior Member
Apr 29, 2016
1,484
531
It seems that acc has a disable command. However, this also stops the daemon. Is there a way to just disable charging, while leaving the daemon running?

I still feel that knowing the actual command acc uses would be useful. I'm sure it just change some value in /sys/*, but I'm not sure which one. I thought it would be something like charging_now (in /sys), since the value in that file changes to 0 when unplugged, and 1 when plugged in. However, trying to echo 0 into that file just results in a permission denied, even while running the terminal app with root.
 

Lada333

Senior Member
Feb 7, 2016
1,453
490
22
Budapest
OnePlus 3T
Google Pixel 6a
It seems that acc has a disable command. However, this also stops the daemon. Is there a way to just disable charging, while leaving the daemon running?
acc -d stops both the charging and the daemon, but then you can re-enable charging (and the daemon, I assume) with acc -e.


I still feel that knowing the actual command acc uses would be useful. I'm sure it just change some value in /sys/*, but I'm not sure which one.
Can't you use some logging app to see what happens when the daemon stops the charging? I don't know what acc might be doing in the background, for all I know, you can't simply disable/enable charging without using acc (because it's not as simple as changing a 1 to a 0 somewhere). Maybe look at the output of acc --test, and see what charging switches it finds and look for those somewhere within the system files?
 

AnonVendetta

Senior Member
Apr 29, 2016
1,484
531
acc -d stops both the charging and the daemon, but then you can re-enable charging (and the daemon, I assume) with acc -e.



Can't you use some logging app to see what happens when the daemon stops the charging? I don't know what acc might be doing in the background, for all I know, you can't simply disable/enable charging without using acc (because it's not as simple as changing a 1 to a 0 somewhere). Maybe look at the output of acc --test, and see what charging switches it finds and look for those somewhere within the system files?
Any suggestions for a logging app? I'm sure there are quite a few things that write to /sys/*, besides acc.

For now, it seems that disabling charging with acc is enough to achieve what I want. The phone's internal battery stops charging, but the battery case's battery continues charging. It does seem that charging the case alone isn't natively supported (without physically removing it and charging it separately), not without 3rd party software like acc.
 

Lada333

Senior Member
Feb 7, 2016
1,453
490
22
Budapest
OnePlus 3T
Google Pixel 6a

AnonVendetta

Senior Member
Apr 29, 2016
1,484
531
So the way it works is that you plug your "phone" in to the charger, then it first charges your phone to 100%, and only when it's full is when it starts charging the case? Interesting.



I've used this logging app before, however I don't know if it can do what you're looking for.
No, I mean that the battery case and the phone charge at the same time, when plugged in. I was looking for a way to let the case charge without removing it, but at the same time to not charge phone battery simultaneously, to reduce wear on it.

Just checked that app, don't think it's suitable. I'd need something that can monitor what accesses a specified directory, and logs all changes. I'm sure there's tools out there that can do that, even if they're command line only.
 

jonahmt21

Senior Member
Sep 17, 2012
215
42
Google Nexus 4
HTC Incredible S
how do you guys know that the battery is in idle mode. I have a watt meter and after the charging stops at 70%, the phone is still pulling about 1 to 3 watts, phone says connected but not charging, but the battery percentage doesnt go down until i unplug it. it seems like the phone is just topping up the battery. is this idle mode? (Pixel 7 Pro)
 

Lada333

Senior Member
Feb 7, 2016
1,453
490
22
Budapest
OnePlus 3T
Google Pixel 6a
it seems like the phone is just topping up the battery
So does it not stay at 70% then?

If the charging switch you're using supports idle mode, and the phone stops charging after whatever limit you set, and your battery doesn't drain while it's plugged in, then yes, it's safe to assume that you have a working battery idle configuration set.
 
  • Like
Reactions: jonahmt21

G5-User7080

Senior Member
May 31, 2018
119
29
Could someone please check if my configuration is correct?

Even after reading through the readme and the linked study on Li-ion batteries I can't say I really understand it.
3920mv is basically the "optimal" voltage for a battery to be at?
Then having it operate from f.e. 1000mv +/- this, e.g. 3820 - 4020 would be the best?

What about the charging voltage?
I think the charging voltage is always a bit higher than the voltage the battery sits at this capacity, so what should I limit that to?
Just slightly higher than 4020 or should I leave it unset?

This study however shows that charging from 25% to 75% gives the best result, well it didn't show any data for lets say 40% - 60%, etc.
I had my old phone always between 40 and 60 since I read somewhere thats where batteries are the most comfortable at, if I used it more on some day it would go down to say 30%, I'm not a heavy user.

Would it be better to charge it higher to say 70% and have it go down to 50 and sometimes 40?


Sorry for having so many questions, I'd be glad if someone could help me with those.

Some more details:
Pixel 6a
Not a heavy user, I expect to use about 20% to 30% per day, even if I need more, I can typically recharge it at home or with a powerbank.
I want it to pause charging at 30°C since this is considered "elevated temperature" according to the linked study.
Charging time isn't much of an issue, so I think limiting charging to 1A makes sense, but idk anything about charging voltage.

edit:
does anyone know a clean simple app that shows the current voltage and stuff?
so far im using battery charge limiter (disabled though) but it also shows this information.
I know theres an GUI app for acc, but there was something confusing about the acc getting updated independly from the GUI app and the GUI app bringing their own acc version or smth, I dont wanna mess with my acc setup, I just wanna see the voltage.
 

Attachments

  • acc-config.jpg
    acc-config.jpg
    96 KB · Views: 24
Last edited:

Lada333

Senior Member
Feb 7, 2016
1,453
490
22
Budapest
OnePlus 3T
Google Pixel 6a
This study however shows that charging from 25% to 75% gives the best result, well it didn't show any data for lets say 40% - 60%, etc.
I had my old phone always between 40 and 60 since I read somewhere thats where batteries are the most comfortable at, if I used it more on some day it would go down to say 30%, I'm not a heavy user.
Generally, batteries are most comfortable at around 50% charge. 25/75 is basically the same as 40/60, which would be the same as 45/55. The idea is to keep the "halfway point" of your maximum and minimum charge level as close to 50% as possible. But, to be frank with you, as long as you don't regularly have the battery sit below ~15%, and don't let it sit above ~80% for long, you're not going to damage it.
What does the most damage to these kinds of batteries are high temperature and mini-cycles.

So basically, if a 30/70 configuration is enough for your phone to last a day, feel free to use that. If you need more, go for 25/75, or 20/80. Using ACC to keep your battery at a comfortable temperature while charging is what's most important.


Would it be better to charge it higher to say 70% and have it go down to 50 and sometimes 40?
It's not bad practice to drain your battery to 0% and then (preferably slowly) charge it up to 100% (and leave it on the charger for about half an hour after it says it reached 100%. Helps with the calibration. You can do this once a week, or once a month, up to you.
If you charge your device overnight, you might wanna look into "battery idle mode," and what it does and why it's beneficial. I also have a Pixel 6a, with my device/kernel, native battery idle isn't supported, luckily there are several ways to emulate it.


I want it to pause charging at 30°C since this is considered "elevated temperature" according to the linked study.
Charging time isn't much of an issue, so I think limiting charging to 1A makes sense, but idk anything about charging voltage.
I think 30 degrees is going to be a bit low, especially during summer/hot months :D 35/40 degrees is still good enough, but obviously, lower is always better.
I used to limit charging current to around 1A (unfortunately I cannot limit the current with my current setup for some reason so I use a dedicated "slow charger" (5V/1A). Best I could do was choose a charging switch that "limits" the current to 2A).
I think as long as you limit the current, there's no need to worry about charging voltage.


does anyone know a clean simple app that shows the current voltage and stuff?
You can use AccA or ACC Settings for monitoring. They won't interfere with your custom settings as long as you don't change any values in the app.
 
  • Like
Reactions: G5-User7080

G5-User7080

Senior Member
May 31, 2018
119
29
What does the most damage to these kinds of batteries are high temperature and mini-cycles.
Thank you for your answers!
What exactly does "mini-cycles" mean?
like having it resume charge at 50% and charge to 55%?
So it's better to let it discharge 20% or some and then charge it up again rather than keeping it at a relatively constant voltage?
Well, if I'm using it while its plugged in I suppose thats what Idle mode is for?

I'm having the switches on auto right now, I'm not exactly sure what they mean, like what does it mean to choose a switch that limits charging amps?
like one of these that says "current_max"? but isnt tha number there way too high?
 

Attachments

  • switches.jpg
    switches.jpg
    227.3 KB · Views: 21

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    generic chargers are unreliable reduce battery life or may expose manufacturer recommend only original charger

    ACCA in the shutdown configuration appears at a maximum of 20% does not appear 34% is it possible to insert 34% in the ACCA configurations?

    Does ACCA have the same behavior as stopping charging at start?
    Try editing the config.txt (in /data/adb/vr25/accu-data) directly via a root file manager as shown in the screenshot. My value is 5 so change it to 34.
    1
    ... there is a strong warning to never edit this file in windows:
    WARNINGS

    # Do not edit this in Windows Notepad, ever!
    # It replaces LF (Linux/Unix) with CRLF (Windows) line endings.

    # Nullifying values that should not be null causes unexpected behavior.
    # However, doing so with "--set var=" restores the default value of "var".
    # In other words, for regular users, "--set" is safer than modifying the config file directly.

    # Do not feel like you must configure everything!
    # Do not change what you don't understand.

    See here.

    Here you also find more background info to the module and some frontends.
  • 77
    Archive
    Find newer zips here.
    41
    Those who are worried about other projects of mine not being updated for a long time, possibly abandoned...
    Stop worrying.
    After the next stable ACC release, I'll focus more on the other Magisk modules (fbind, Migrator, Systemless GApps, etc.).
    The current ACC framework is the base of all the other projects - meaning, making it rock stable it priority #0.
    29
    A new stable release is up.
    It can be downloaded from Magisk Manager > Downloads as well.
    Refer to the readme for a full list of changes, features and recommendations.
    Now I'll be focusing more on the other projects (migrator, fbind, systemless GApps, daily job scheduler...).
    Until these reach satisfactory status, acc will only get occasional maintenance updates (bugfixes, optimizations, new charging control files...).

    Edit: the installer enforced by Magisk Manager is not playing nice with acc. Until I fix that, use the zip from GitHub (release link above).

    Edit 2: fixed.