Sunday, May 19, 2024
9
rated 0 times [  9] [ 0]  / answers: 1 / hits: 5403  / 2 Years ago, sun, october 2, 2022, 2:34:40

I have a thinkpad T490 on Ubuntu 18.04. I want to protect my battery (the tlp stuff with max charge 80 and start charge 75).



However, it looks like I have some problems:



~$ sudo tlp setcharge START_CHARGE 70
Error: ThinkPad battery features not available.


I think this is due to problems with tp-sampi and / or tpacpi-bat:



~$ sudo tlp stat
...
+++ ThinkPad Battery Features
tp-smapi = inactive (kernel module 'tp_smapi' load error)
tpacpi-bat = inactive (kernel module 'acpi_call' load error)



After googling, it seems that tp-smapi does not work on thinkpads from versions *30 and over and tpacpi-bat should be the solution to use instead. I cannot find more help about if / how I should set up tpacpi-bat. Any tips / instructions? :)


More From » power-management

 Answers
6

After a discussion with the package author and maintainer (many thanks to him for his patience with my n00bness), the solution was to update to the PPA version 1.2.2 (I guess newer may work as well):



sudo add-apt-repository ppa:linrunner/tlp
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install tp-smapi-dkms acpi-call-dkms tlp


After that things start to work:



~$ sudo tlp-stat
--- TLP 1.2.2 --------------------------------------------
...

+++ Battery Features: Charge Thresholds and Recalibrate
natacpi = active (data, thresholds)
tpacpi-bat = inactive (kernel module 'acpi_call' load error)
tp-smapi = inactive (ThinkPad not supported)
...


and the battery levels can be updated:



~$ sudo tlp setcharge 70 80
Setting temporary charge thresholds for BAT0:
start = 70 (no change)
stop = 80 (no change)


leading to:



~$ sudo tlp-stat
...
/sys/class/power_supply/BAT0/charge_start_threshold = 70 [%]
/sys/class/power_supply/BAT0/charge_stop_threshold = 80 [%]
...


Note that if you want the update to survive reboot, you need to update the configuration file at /etc/default/tlp by uncommenting / modifying the lines 355-356 (you will need to open as root and overwrite readonly protection, for example in vim you need :w! ):



350 # Battery charge thresholds (ThinkPad only, tp-smapi or acpi-call kernel module
351 # required). Charging starts when the remaining capacity falls below the
352 # START_CHARGE_THRESH value and stops when exceeding the STOP_CHARGE_THRESH value.
353 # Main / Internal battery (values in %)
354 # Default: <none>
355 START_CHARGE_THRESH_BAT0=70
356 STOP_CHARGE_THRESH_BAT0=80
357 # Ultrabay / Slice / Replaceable battery (values in %)
358 # Default: <none>
359 #START_CHARGE_THRESH_BAT1=75
360 #STOP_CHARGE_THRESH_BAT1=80


For more details:



https://linrunner.de/en/tlp/docs/tlp-configuration.html#chargethresholds


[#5036] Monday, October 3, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
uccase

Total Points: 473
Total Questions: 100
Total Answers: 110

Location: Anguilla
Member since Sun, Jan 29, 2023
1 Year ago
uccase questions
;