On 2018-06-17 12:36, Carlos E. R. wrote:
Hi,
I got a small and light Lenovo laptop for travelling. Looking at the native Windows, one of the manufacturer options is to limit the battery charge to 55..60% while the charger is plugged, because this will increase the battery life.
I will install Linux as soon as I end updating the Windows part, so I ask: do we have a tool in Linux to limit the battery charge?
The battery is not removable without opening the entire thing up, so that's not an option.
I googled, found some hits:
<https://askubuntu.com/questions/34452/how-can-i-limit-battery-charging-to-80-capacity>
<https://www.reddit.com/r/linux4noobs/comments/5yf6jp/limiting_battery_charge_in_linux/>
It seems that "tlp" is available on OSS :-)
And it was already installed, with different values. Not enabled: Legolas:~ # systemctl status tlp.service ● tlp.service - TLP system startup/shutdown Loaded: loaded (/usr/lib/systemd/system/tlp.service; disabled; vendor preset: disabled) Active: inactive (dead) Docs: http://linrunner.de/tlp Legolas:~ # Yet, the battery is charging only to 60%, so it must be the firmware which is controlling it. So I do not really need this service running, just a way to activate or disable feature without activating all of it (tlp does much more). FAQ here: https://linrunner.de/en/tlp/docs/tlp-faq.html I'm not sure Lenovo is supported, looking at that FAQ. Maybe yes: +++--------------- (Source: Lenovo Forums) Default TLP settings (only if you uncomment the relevant lines) are slightly more protective regarding lifespan, with 75%/80% start/stop charge thresholds. Please consider that the start threshold is the critical constraint for runtime, because it defines the lowest charge level that can occur while plugged. Also, don't forget that TLP provides a command (tlp fullcharge) to fully charge the battery, when you need to temporarily maximize runtime (for example in case of a trip). ---------------++- Ah: +++--------------- Do charge thresholds work even when Linux/TLP is not running? Yes. The charging process is not controlled by software, but by hardware. TLP just writes the thresholds to the hardware registers (via tp-smapi or tpacpi-bat). Once stored in the hardware the charge thresholds stay effective permanently. See below for removal. ---------------++- Legolas:~ # locate tpacpi-bat /usr/share/tlp/tpacpi-bat Legolas:~ # But test calls to it fail. Legolas:~ # /usr/share/tlp/tpacpi-bat -g ST 1 modprobe: FATAL: Module acpi_call not found in directory /lib/modules/4.12.14-lp150.12.4-default Could not find /proc/acpi/call. Is module acpi_call loaded? Legolas:~ # -- Cheers / Saludos, Carlos E. R. (from 42.3 x86_64 "Malachite" at Telcontar)