Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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!

share|improve this question
add comment

1 Answer 1

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!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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