Comments (5)
Have you been able to actually verify the ability of one of your devices to change the charging rate according to control file changes?
If yes, please provide more detailed information!
This could be very interesting for a future major version, but without actual experimental results I don't expect devices out there to actually support software-defined charging rates.
Greez!
from batterychargelimit.
The S4 i9505 (jfltexx) has kernel support for this:
/sys/devices/platform/sec-battery/power_supply/battery/siop_level
is a writable file which can be used to set the battery charge rate as a percentage of the normal rate, this is limited to a lower bound of the USB charging rate (about 0.5 amps).
I've verified this with a power supply which has a built-in meter - I could control the charge current between 1.2A and 0.5A by echoing integers to siop_level
The i9505 jfltexx (i9505) also has the ability to stop charging in software:
# Cease charge:
echo 1 > /sys/devices/platform/sec-battery/power_supply/battery/test_mode
# Resume charge (and leave "test mode"):
echo 2 > /sys/devices/platform/sec-battery/power_supply/battery/test_mode
The above may also be true for the Galaxy S3 which uses the same charge control chip (or at least the kernel could be patched to use the S4 code I suppose if-not).
More generally, for other devices, I suppose it would be possible to limit battery temperature (e.g. only charge when temp within user-defined limits).
For devices which don't have an equiv of siop_level
, you could do a basic PWM (e.g. charge for 1 second, off for 3 seconds for 25% duty), which would also AFAIK be easier on the battery than just flat-out charging...
from batterychargelimit.
Nice, I own an I9505 jfltexx running on Lineage 14.1 that I use for experiments.
Thanks for your help!
I will try to reproduce this and do some experiments, as soon as my time allows it
As this is a completely new thing, please don't expect this feature to become available quickly, it will take its time...
Regarding the temperature idea: How do we handle the case that the phone is too warm (maybe it slipped under my pillow while I was sleeping), but I want to have my phone charged on the next day no matter what? 😉
Regarding your PWM idea: This came to my mind as well. And in theory, it's a nice idea. However, in practice things like the reaction time of the device are so unreliable that we would need to do something like "1 minute charging - 3 minutes idle" for a reliable 25% duty. Changing the state within seconds might result in unpredictable outcome.
In this case, however, I don't see any real benefit for the battery. The "real" PWM idea is to use signals with very high frequency. I think that any reliable frequency is too low to improve battery life. Therefore I abandoned this idea.
from batterychargelimit.
/sys/class/power_supply/battery/voltage_max
is the voltage limit file for Pixel 2 XL (and I believe other Google/Pixel devices). Interestingly this has the contents format '4400000' as opposed to some other devices simply having '4200'.
The current battery voltage can be read from /sys/class/power_supply/battery/voltage_now
Setting this limit has the benefit of battery/status automatically detecting/setting "Full" charge state (even if percentage isn't 100) and automatically toggling charge_disable to 1 - confirmed to run my device off USB power when the specified voltage threshold is reached.
from batterychargelimit.
Hi,
I need help to understand what I have to do to block charging at 80% on a samsung tab 4
this is the kernel link
Thank you all in advance.
Stefano
from batterychargelimit.
Related Issues (20)
- Pixel 6 rooted do not stop automatic HOT 2
- Realme 6 Pro battery control file
- Realme GT 5G not working HOT 1
- Not working oneplus 8pro since update to Android 12 HOT 1
- feature request: close app notification when charger is disconnected. HOT 1
- not working on poco f3 HOT 1
- Feature Request: Disable Charge Limit temporary HOT 1
- 8
- Control file for Pixel 5a 5G
- Support for FiiO M11
- Charging connection and disconnection detection HOT 1
- it works on Samsung S20 Android 13 HOT 1
- Does not work with kernel SU ? HOT 1
- Support for Xiaomi 13 (fuxi)
- Support for Poco X5 Pro 5G (redwood) HOT 1
- Error not working on redmi note 11 MIUI 14 android 13 API33
- Support for Xiaomi 12 (Cupid) HOT 1
- Supporto for Armor X9 Pro HOT 1
- Not working on Galaxy S10 5G LOS 20 Android 13
- Please support MIPad 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from batterychargelimit.