2

I have a ThinkPad T420s and would like to expand the battery service life (not maximize time the laptop can run off a battery)

I have tp-smapi-dkms and sysfsutils installed, and when I run:

$ ll /sys/devices/platform/smapi/BAT0
total 0
drwxr-xr-x 2 root root    0 Sep 12 08:00 ./
drwxr-xr-x 5 root root    0 Sep 12 07:59 ../
-rw-r--r-- 1 root root 4096 Sep 12 08:15 barcoding
-rw-r--r-- 1 root root 4096 Sep 12 08:26 charging_max_current
-rw-r--r-- 1 root root 4096 Sep 12 08:26 charging_max_voltage

...

-rw-r--r-- 1 root root 4096 Sep 12 08:15 power_avg
-rw-r--r-- 1 root root 4096 Sep 12 08:15 power_now
-rw-r--r-- 1 root root 4096 Sep 12 08:15 remaining_capacity
-rw-r--r-- 1 root root 4096 Sep 12 08:15 remaining_charging_time
-rw-r--r-- 1 root root 4096 Sep 12 08:15 remaining_percent
-rw-r--r-- 1 root root 4096 Sep 12 08:26 remaining_percent_error
-rw-r--r-- 1 root root 4096 Sep 12 08:15 remaining_running_time
-rw-r--r-- 1 root root 4096 Sep 12 08:26 remaining_running_time_now
-rw-r--r-- 1 root root 4096 Sep 12 08:15 serial
-rw-r--r-- 1 root root 4096 Sep 12 08:17 start_charge_thresh
-rw-r--r-- 1 root root 4096 Sep 12 08:15 state
-rw-r--r-- 1 root root 4096 Sep 12 08:00 stop_charge_thresh
-rw-r--r-- 1 root root 4096 Sep 12 08:15 temperature
-rw-r--r-- 1 root root 4096 Sep 12 08:15 voltage

So there should be start_charge_thresh and stop_charge_thresh available, I can set when the battery stops charging with:

$ echo 80 | sudo tee /sys/devices/platform/smapi/BAT0/stop_charge_thresh
80
$ echo 80 | sudo tee /sys/devices/platform/smapi/BAT0/stop_charge_thresh
80

But setting when it should start charging fails:

$ echo 40 | sudo tee /sys/devices/platform/smapi/BAT0/start_charge_thresh 
40
$ cat /sys/devices/platform/smapi/BAT0/start_charge_thresh 
cat: /sys/devices/platform/smapi/BAT0/start_charge_thresh: No such device or address

How is this possible? I am running out of time.. when I plug in the adapter it still isn't charging!

4

please take the following steps and remember backup your configuration before you do anything:

sudo modprobe tp_smapi
lsmod | grep smapi
sudo echo "tp_smapi" >> /etc/modules
sudo echo "devices/platform/smapi/BAT0/start_charge_thresh = 40" >> /etc/sysfs.conf
sudo echo "devices/platform/smapi/BAT0/stop_charge_thresh = 80" >> /etc/sysfs.conf
sudo service sysfsutils start

reboot your device and check it out!

2
  • I know it's been a long time, but could you elaborate your answer a little? I have the same problem as the OP, but I don't understand at all what these changes are supposed to do. Thanks. – bgusach Apr 16 '16 at 16:58
  • This won't work, obviously. Doesn't matter if you set it from console or in some config file when the threshold doesn't work at all… See my answer :) – helb May 10 '17 at 8:20
1

The thing is, T420 and some other Thinkpads have the start_charge_thresh broken/crippled somehow (https://github.com/evgeni/tp_smapi/issues/3).

I solved it by using tpacpi-bat instead of the tp_smapi module: https://github.com/teleshoes/tpacpi-bat

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.