Advanced Charging Controller (acc)

ghbuur

Senior Member
May 24, 2013
715
763
0
Those facing issues -- your devices/systems are incompatible.

Please run the attached script as follows:

After that, upload here the file /sdcard/cs_debug.zip.
thx. i tried that but it didn't work properly (something about unzip error) . but at least it created a file. does it help?
 

Attachments

VR25

Senior Member
Apr 20, 2013
1,753
4,370
153
thx. i tried that but it didn't work properly (something about unzip error) . but at least it created a file. does it help?
Yes, it contains what I need. -- Thanks


Update: @ghbuur, your device is set up way too differently from the standard/stock Android. I need more information to determine whether this module can really work with it.

Please, run the new debugging script (attached) as per the following instructions set:

su
source /path/to/script

1. While charging (USB)
2. While charging (charger)
3. While unplugged (not charging)

3 Zip files will be generated in /data/_cs_debug (one on each run). Upload these here.


Update 2: @ghbuur, I found out where the incompatibility relies on. Forget the info above if you've not done so already. I have to make a few significant changes to the module. This will take a while.
 

Attachments

Last edited:
  • Like
Reactions: ghbuur

VR25

Senior Member
Apr 20, 2013
1,753
4,370
153
Working good for me, no issues


Edit: I found this app that does the same but automatically

Battery Charge Limit (Stops charging at a desired level) - https://f-droid.org/app/com.slash.batterychargelimit
Sent from my XT1681 using Tapatalk
I've tried it. It's awesome -- though with a few limitations. You can't enable/disable charging on demand & you have less control over the whole thing.
One particular feature that interested me quite a lot is the ability to start charging again when battery level drops below a set percentage. I'll add that to the module!
 

Taracair

Senior Member
Sep 10, 2011
414
87
0
Permission denied.
Any workaround?

Would be great to use this app
Using lg g3, LOS based rom, custom kernel.
Tried to move cs file to bin and xbin but it was already there

Edit
Got it working, had to set 777 permissions for the cs file.

What set of commands should be used for the combination:
Charge to 100%, then stop charging for the next 8 hours.
cs 100 && cs -d 8h?

Well I got sth like this
Code:
 d855:/ $ cs 99 && cs -d 8h

/system/bin/cs[14]: can't create /data/.cs_sON: Permission denied
/system/bin/cs[163]: can't create /sys/class/power_supply/battery/charging_enabled: Permission denied
rm: /data/.cs_sON: Permission denied
/system/bin/cs[193]: can't create /magisk/cs/.history: Permission denied
/system/bin/cs[193]: can't create /magisk/cs/.history: Permission denied

/system/bin/cs[196]: can't create /sys/class/power_supply/battery/charging_enabled: Permission denied
Desired charge % reached!
S/OFF --> Sat Sep 30 07:13:19 CEST 2017
- Press RETURN to re-enable charging & exit.
cd system
/system/bin/cs[201]: can't create /sys/class/power_supply/battery/charging_enabled: Permission denied

/system/bin/cs[14]: can't create /data/.cs_sON: Permission denied
/system/bin/cs[160]: can't create /sys/class/power_supply/battery/charging_enabled: Permission denied
Charging disabled for 8h.
S/OFF --> Sat Sep 30 07:13:48 CEST 2017
Any ideas?
 
Last edited:

VR25

Senior Member
Apr 20, 2013
1,753
4,370
153
@Taracair, the syntax is correct, but you don't seem to be running as root.

EDIT: @Taracair, actually, "cs 100 && cs -d 8h" won't work as expected. The scrip has a bug -- it'll stop charging at 100%, but then it'll wait for user input to re-enable charging & exit. Only afterwards, the shell will run the next command. I'll fix that & add features.
 
Last edited:
  • Like
Reactions: Taracair

Taracair

Senior Member
Sep 10, 2011
414
87
0
@Taracair, the syntax is correct, but you don't seem to be running as root.
Got it working after second attempt.
Code:
Charging to 99%...
S/ON --> Sat Sep 30 09:01:09 CEST 2017

CHARGING_ENABLED=1
CHARGING_TYPE=Fast
TECHNOLOGY=Li-poly
VOLTAGE_MAX_DESIGN=4350000
VOLTAGE_MIN_DESIGN=4350000
VOLTAGE=4346000
LEVEL=99%
CURRENT=-400
CHARGING_FULL_DESIGN=3000
TEMP=245
PSEUDO_BATT=0
EXT_PWR=14
SAFETY_TIMER=1
VALID_BATT_ID=1
USB_CURRENT_MAX_MODE=0
STORE_DEMO_ENABLED=0

Desired charge % reached!
S/OFF --> Sat Sep 30 10:15:23 CEST 2017
- Press RETURN to re-enable charging & exit.
 
  • Like
Reactions: VR25

jimbob_sf

Senior Member
Jul 16, 2010
435
110
0
San Rafael, CA
I've read and now see I have to find a rradme... Can you simply put in the module description in MM and op that you need to use terminal? Forcing us to bounce from MM, to xda, to search the thread, to find the readme...
 

Taracair

Senior Member
Sep 10, 2011
414
87
0
@Taracair, the syntax is correct, but you don't seem to be running as root.

EDIT: @Taracair, actually, "cs 100 && cs -d 8h" won't work as expected. The scrip has a bug -- it'll stop charging at 100%, but then it'll wait for user input to re-enable charging & exit. Only afterwards, the shell will run the next command. I'll fix that & add features.
Well actually it's fine. It charges to demanded value and stops charging after that. That's what I wanted. The -d 8h isn't needed actually.

Edit
cs -d 6h && cs 100 works even batter. I wake up with fully charged phone which wasn't overcharged few times during the night. When it's charged it stops and that's the point.

Thank you for this great module.
 
Last edited:

frdc0410

Member
Oct 2, 2017
9
3
0
You use a terminal emulator for that. Instructions are on the README (from the OP or zip file). I always try to make everything as simple and user friendly as possible. Note that the terminal must be running (either in foreground or background) till the process is complete. I recommend Termux terminal emulator.

Interesting idea...
That's not currently one of the features, but I can implement it. Wait for the next version.

Sure. I can add that too.
I am very new to this. I tried using the termux terminal emulator but it says there "no command 'cs' found". I already successfully flashed this through magisk, but I'm not sure how to make this work :(
 

VR25

Senior Member
Apr 20, 2013
1,753
4,370
153
I've read and now see I have to find a rradme... Can you simply put in the module description in MM and op that you need to use terminal? Forcing us to bounce from MM, to xda, to search the thread, to find the readme...
Well, the OP is the README itself. Not sure how you missed the "terminal" part. It's not explicitly there, but there are commands... and you run those on terminal. Also, "cs --help" gives you all the help & usage tips you need. So...
Sorry if I missed something. Will work on a more user-friendly reference.

Didn't work for me .
Zenfone 2 / stock 6.0.1
The only thing standing between me and a new version is time. I've been quite busy these days. Will add support for more devices or possibly make the module universal.

I am very new to this. I tried using the termux terminal emulator but it says there "no command 'cs' found". I already successfully flashed this through magisk, but I'm not sure how to make this work :(
You may not be running the commands as root. That's the most obvious reason. Else, let me know.
 
Last edited:

Taracair

Senior Member
Sep 10, 2011
414
87
0
The command cs -d 6h && cs 100 doesn't work.
It doesn't finish the -d 6h at the required time, nothing happens after the 6h. So actually cs 100 is enough, because after charging to 100 it hangs up and doesn't charge after I wake up and press enter.
 

VR25

Senior Member
Apr 20, 2013
1,753
4,370
153
The command cs -d 6h && cs 100 doesn't work.
It doesn't finish the -d 6h at the required time, nothing happens after the 6h. So actually cs 100 is enough, because after charging to 100 it hangs up and doesn't charge after I wake up and press enter.
Alright, in the next version, cs will give you the option to start charging again after battery level drops to a set percentage. So, essetialy the user will have the ability to define a charging and recharging threshold (i.e., charge to 80%, pause. If battery level drops below 20%, resume charging). That's much better than "cs -d #% && cs #" IMO. Thanks for the report.
 
Last edited:
  • Like
Reactions: Taracair

zakyakr

Member
Sep 23, 2017
10
2
0
Any idea of this problem? Permission denied

land:/ $ cs -i

/system/xbin/cs[14]: can't create /data/.cs_sON: Permission denied
Battery Info
/system/xbin/cs[160]: cat: /sys/class/power_supply/battery/uevent: Permission denied


land:/ $

---------- Post added 04-10-2017 at 12:12 AM ---------- Previous post was 03-10-2017 at 11:52 PM ----------

Never mind I forgot to type 'su'
 

lioux

Senior Member
Feb 24, 2013
133
207
0
I'm using Magisk v14.2 on a Pixel XL stock Oreo with October security update. Unfortunately, this module is not being mounted by magisk.

I get no errors on either installation or after reboot. However,the cs binary isn't at /system/xbin

It's only available at /magisk/cs/system/xbin/cs

Let me know if there's anything I can do to help.

--------- beginning of main
I( 469: 469) Magisk v14.2(1420) daemon started
I( 469: 471) ** post-fs mode running
--------- beginning of system
I( 469: 623) ** post-fs-data mode running
I( 469: 623) * Mounting mirrors
I( 469: 623) bind_mount: /system_root/system -> /dev/magisk/mirror/system
I( 469: 623) mount: /dev/block/platform/soc/624000.ufshc/by-name/vendor_a -> /dev/magisk/mirror/vendor
I( 469: 623) bind_mount: /data/magisk -> /dev/magisk/mirror/bin
I( 469: 623) * Mounting /data/magisk.img
I( 469: 623) * Running post-fs-data.d scripts
I( 469: 623) * Running module post-fs-data scripts
I( 469: 623) magisk-foldermount: exec [post-fs-data.sh]
I( 469: 623) * Loading modules
I( 469: 623) busybox-ndk: constructing magic mount structure
I( 469: 623) cs: constructing magic mount structure
I( 469: 623) magisk-foldermount: loading [system.prop]
I( 469: 623) magisk-foldermount: constructing magic mount structure
 
Last edited:

RMarques

Senior Member
Jan 28, 2013
948
157
73
Ok then, latest version successfully flashed and mounted by Magisk, Termux installed and given SU rights.

I've tried the following inputs:

cs-c 80 2m
cs -c 80 2m

However, I'm getting the following errors:

See attached SS


...can anyone shed some wisdom over here?
 

Attachments