You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi!
I have an older Redmi 3s with a fresh Lineageos 16 where $something is overwriting the control file. Some crude debug in the shell, while being connected to power: cat /sys/class/power_supply/battery/charging_enabled \ && echo 0 > /sys/class/power_supply/battery/charging_enabled \ && cat /sys/class/power_supply/battery/charging_enabled \ && sleep 1s \ && cat /sys/class/power_supply/battery/charging_enabled
produces
1
0
1
So even when the file is altered by BatteryChargeLimit once it reaches the limit this only lasts a second. My crude remedy: make the control file not writable: cat /sys/class/power_supply/battery/charging_enabled \ && echo 0 > /sys/class/power_supply/battery/charging_enabled \ && chmod -w /sys/class/power_supply/battery/charging_enabled \ && cat /sys/class/power_supply/battery/charging_enabled \ && sleep 3s \ && cat /sys/class/power_supply/battery/charging_enabled
1
0
0
Reversing this enables charging again.
I'm not confident playing with access rights on the control file is the way to go, but after the battery dies it should get reset in the worst case, being in /sys/. Maybe something like this could be added with even more warning dialogs to confirm?
The text was updated successfully, but these errors were encountered:
Hi!
I have an older Redmi 3s with a fresh Lineageos 16 where $something is overwriting the control file. Some crude debug in the shell, while being connected to power:
cat /sys/class/power_supply/battery/charging_enabled \ && echo 0 > /sys/class/power_supply/battery/charging_enabled \ && cat /sys/class/power_supply/battery/charging_enabled \ && sleep 1s \ && cat /sys/class/power_supply/battery/charging_enabled
produces
So even when the file is altered by BatteryChargeLimit once it reaches the limit this only lasts a second. My crude remedy: make the control file not writable:
cat /sys/class/power_supply/battery/charging_enabled \ && echo 0 > /sys/class/power_supply/battery/charging_enabled \ && chmod -w /sys/class/power_supply/battery/charging_enabled \ && cat /sys/class/power_supply/battery/charging_enabled \ && sleep 3s \ && cat /sys/class/power_supply/battery/charging_enabled
Reversing this enables charging again.
I'm not confident playing with access rights on the control file is the way to go, but after the battery dies it should get reset in the worst case, being in /sys/. Maybe something like this could be added with even more warning dialogs to confirm?
The text was updated successfully, but these errors were encountered: