Search This thread

eried1

Senior Member
May 27, 2016
638
124
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
652
343
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
35
6
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,570
536
23
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
652
343
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,716
626
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,570
536
23
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,716
626
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,716
626
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,570
536
23
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,716
626
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,570
536
23
Budapest
OnePlus 3T
Google Pixel 6a

AnonVendetta

Senior Member
Apr 29, 2016
1,716
626
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,570
536
23
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
183
53
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: 35
Last edited:

Lada333

Senior Member
Feb 7, 2016
1,570
536
23
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
183
53
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: 29

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    Macro to write some values like batt. temperature, charging current, charging voltage, batt. percentage, selected acc-config parameters, etc. to a. txt file during charging

    This post is an update to a previous post here, providing a MacroDroid macro to monitor during charging some related parameters over the time depending on the respective acc settings.

    If you want to use the macro, download it, rename it to .macro and import it. It will start automatically when the charger is plugged.

    First, read the explanations already given here.

    Then, see the long comment at the very end of the macro, trying to explain the used variables and which / how to modify.

    Since I haven't logged all changes I made since the last release, the following summary might be too long / too short, sorry:

    - different output directory can be defined in the variable

    - output directory is created if not already present

    - macro checks if charging follows the config or follows an acc -f command

    - even for a charging following an acc -f xx -s yy command the defined values (like target capacity xx or additional limits defined in the yy term) are reported

    - variables to be reported can be (dis-)activated in the array variable

    - loop to repeat reading of charging voltage if reading was not successful

    - configurable warning if charging was started but macro has detected that acc daemon is not running


    - configurable auto-activation of acc daemon if if charging was started but macro has detected that acc daemon is not running

    😉
    1
    Hello,

    I woud like to use acc to bypass battery, so that the phone runs off the charger instead of the battery, to conserve it's life esperance.
    I do stuff that makes my battery runs very hot, I thought with this method since it bypass the charger I could not only reduce the temperature, but also reducing the number of cycle.
    I have a motorola 40 edge pro phone, which do posses that "bypass battery" functionnality. It's called "Battery optimisation" under motorola stock rom, and basically, it learns your phone charging pattern, so that when you plug in at night, it charges only up to 80%, and use the charger to run the phone (I could tell because it's constantly 0mAH in accubattery). Then, when you're supposed to wake up, it charges till 100%. Thefore the functionnality is indeed present, but do not allow much user control.

    Anyway, I'm trying to reproduce that through acc. At first, even the basic core functionality didn't work for me, I had to switch to switch 1. Now it's fine, but I still can't get battery idle (the 0mAH ) to work.
    I tried emulated "idle mode", but I feel it's not very satisfactory? I set acc 65 64, and what it does it that it simply charge to 65, discharge to 64, and continusly. Considering my usage (let's say gaming), does that makes any difference from just running on battery to 30% and then charging to 60%? Basically a lot of small cycle vs a bigger one (but not as big as 100 0), the impact on the battery should be quite similar? Also, when running high CPU usage process, the battery does get hot. But then, even with small cycles, I'm still charging it therefore increasing temperature?

    Would like your opinion on that please, also if you have any idea how to make idle battery work (since my phone does support the functionnality), I would also be very happy to hear your feedbacks.

    Thank you !
    1
    O. K.
    I would have recommended you
    1) deinstall all front-ends
    2) update in the terminal via acc -u -f dev
    3) try if it works
    🤠
    1
    Thanks for the link. Just installed, still can't get true idle mode to work :/ only one switch with has battery idle=true, I selected that one but then I still get the continuous discharge and not 0mah.
    1
    ACC- Front-End // Your help is appreciated!

    I have made (for fun) a MacroDroid* based front-end for ACC and consider to make it available for others who are interested.
    Before doing so, I would need two or three guys for testing to get feedback how the front-end works on other devices than mine.

    You should:
    - have already some experience with configuring ACC via the terminal
    - have no issues with your actual ACC configuration
    - have installed the MacroDroid app (or are willing to do so which requires to grant root access** to it) - Pro-version is not needed

    edit:
    * take note that Jamie, the developer of MacroDroid, is also an XDA member having an own thread for MacroDroid
    **if granting root access is a concern for you: root is needed since MacroDroid has to pass acc commands to the shell as ACC does (which also requires root as you know 😁); however internet access of MacroDroid can be prohibited with a firewall (e. g. AFWall+) and is nevertheless working fine.

    If this fits and if you want to help me, please send me a private message.

    Features of the Front-End:

    - read / modify most acc variables (30+)
    - directly see the default values
    - get dev's help text for the acc variables
    - backup / restore your config
    - return to default config
    - background / manual acc update checks
    - direct upgrade / rollback of acc builds
    - start / stop the daemon (idle mode)
    - enhanced one-time charging (acc -f)
    - add / modify /delete time profiles
    - test / set all or selected charg. switches
    - (de-)activate selected charg. switches
    - get static / dynamic (dis-)charging info
    - show full / filtered config info
    - create full / short acc logs
    - execute pasted terminal commands
    - write outputs / results into files
    - define directories for output writings

    🤠
  • 280
    Repository
    Source Code and Documentation
    Releases

    Front-ends (outdated -- no longer supported)
    ACC App (AccA)
    ACC Settings
    79
    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.