我有一台 ThinkPad T420s,想延长电池的使用寿命(而不是最大限度地延长笔记本电脑使用电池的时间)
我已经tp-smapi-dkms
安装sysfsutils
并运行:
$ 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
因此应该有start_charge_thresh
并且stop_charge_thresh
可用,我可以使用以下命令设置电池何时停止充电:
$ 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
但是设置何时开始充电失败:
$ 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
这怎么可能?我没时间了。当我插入适配器时它仍然没有充电!
答案1
请采取以下步骤,并记住在执行任何操作之前备份您的配置:
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
重新启动您的设备并检查!
答案2
问题是,T420 和其他一些 ThinkPadstart_charge_thresh
不知何故损坏了/残缺了(https://github.com/evgeni/tp_smapi/issues/3)。
我通过使用模块解决了这个tpacpi-bat
问题tp_smapi
:https://github.com/teleshoes/tpacpi-bat