Thinkpad 在 Linux 下修改电池充电阈值,Thinkpad 在 Linux 下的电池充电问题

原文地址:https://blog.csdn.net/dadoneo/article/details/6035661
look this for more info: http://www.thinkwiki.org/wiki/Tp_smapi
安装tp-smapi:
# aptitude install tp-smapi-dkms
# modprobe tp_smapi
更改充电阈值:
设置开始充电阈值,如从“60%”开始充电:
# echo 60 > /sys/devices/platform/smapi/BAT0/start_charge_thresh
设置停止充电阈值,如到“100%”停止充电:
# echo 100 > /sys/devices/platform/smapi/BAT0/stop_charge_thresh
查看充电阈值:
# cat /sys/devices/platform/smapi/BAT0/*_charge_thresh
其他:
To prevent charging for 17 minutes (regardless of thresholds):
# echo 17 > /sys/devices/platform/smapi/BAT0/inhibit_charge_minutes
To cancel charging preventation:
# echo 0 > /sys/devices/platform/smapi/BAT0/inhibit_charge_minutes
To force battery discharging (even if connected to AC):
# echo 1 > /sys/devices/platform/smapi/BAT0/force_discharge
To cancel forced discharge:
# echo 0 > /sys/devices/platform/smapi/BAT0/force_discharge
让设置在启动时生效(只用同一块电池):
It is not necessary to create your own init.d script or modify /etc/rc.local - you just need the package sysfsutils:
# apt-get install sysfsutils
# sudo gedit /etc/sysfs.conf
把下面的放在文件 /etc/sysfs.conf后面:
# cat >> /etc/sysfs.conf << EOF
# For a LiIon battery in a Thinkpad
devices/platform/smapi/BAT0/start_charge_thresh = 50
devices/platform/smapi/BAT0/stop_charge_thresh = 80
EOF
The init script supplied by sysfsutils will load these settings on each boot.
其他电池状态信息:
To view extended battery status such as charging state, voltage, current, capacity, cycle count and model information:
# cat /sys/devices/platform/smapi/BAT0/installed
# cat /sys/devices/platform/smapi/BAT0/state # idle/charging/discharging
# cat /sys/devices/platform/smapi/BAT0/cycle_count
# cat /sys/devices/platform/smapi/BAT0/current_now # instantaneous current
# cat /sys/devices/platform/smapi/BAT0/current_avg # last minute average
# cat /sys/devices/platform/smapi/BAT0/power_now # instantaneous power
# cat /sys/devices/platform/smapi/BAT0/power_avg # last minute average
# cat /sys/devices/platform/smapi/BAT0/last_full_capacity
# cat /sys/devices/platform/smapi/BAT0/remaining_percent
# cat /sys/devices/platform/smapi/BAT0/remaining_running_time
# cat /sys/devices/platform/smapi/BAT0/remaining_charging_time
# cat /sys/devices/platform/smapi/BAT0/remaining_capacity
# cat /sys/devices/platform/smapi/BAT0/design_capacity
# cat /sys/devices/platform/smapi/BAT0/voltage
# cat /sys/devices/platform/smapi/BAT0/design_voltage
# cat /sys/devices/platform/smapi/BAT0/manufacturer
# cat /sys/devices/platform/smapi/BAT0/model
# cat /sys/devices/platform/smapi/BAT0/barcoding
# cat /sys/devices/platform/smapi/BAT0/chemistry
# cat /sys/devices/platform/smapi/BAT0/serial
# cat /sys/devices/platform/smapi/BAT0/manufacture_date
# cat /sys/devices/platform/smapi/BAT0/first_use_date
# cat /sys/devices/platform/smapi/BAT0/temperature # in milli-Celsius
# cat /sys/devices/platform/smapi/ac_connected
The raw status data is also available, including some fields not listed above (in case you can figure them out):
# cat /sys/devices/platform/smapi/BAT0/dump

Linux下 Thinkpad 笔记本电池管理软件。 电池充电控制   设置开始与停止充电的阀值(百分比) # echo 40 > /sys/devices/platform/smapi/BAT0/start_charge_thresh # echo 70 > /sys/devices/platform/smapi/BAT0/stop_charge_thresh # cat /sys/devices/platform/smapi/BAT0/*_charge_thresh (表示低于40%时开始充电,高于70%就停止) 设置禁止充电时间 17分内防止充电到BAT0(首选电池): # echo 17 > /sys/devices/platform/smapi/BAT0/inhibit_charge_minutes Hint:  用于控制给那个电池充电当使用多个电池 Ultrabay battery. 取消禁止充电: # echo 0 > /sys/devices/platform/smapi/BAT0/inhibit_charge_minutes 强制禁止充电(即使接AC): # echo 1 > /sys/devices/platform/smapi/BAT0/force_discharge Hint: 用于控制给那个电池充电当使用多个电池 Ultrabay battery.  取消强制禁止充电: # echo 0 > /sys/devices/platform/smapi/BAT0/force_discharge 显示电池状态信息   显示额外的电池状态,比如充电情况、电压、电流、容量、充电次数和型号信息: # cat /sys/devices/platform/smapi/BAT0/installed # cat /sys/devices/platform/smapi/BAT0/state '状态:idle/charging/discharging # cat /sys/devices/platform/smapi/BAT0/cycle_count # cat /sys/devices/platform/smapi/BAT0/current_now # instantaneous current # cat /sys/devices/platform/smapi/BAT0/current_avg # last minute average # cat /sys/devices/platform/smapi/BAT0/power_now   # instantaneous power # cat /sys/devices/platform/smapi/BAT0/power_avg   # last minute average # cat /sys/devices/platform/smapi/BAT0/last_full_capacity # cat /sys/devices/platform/smapi/BAT0/remaining_percent # cat /sys/devices/platform/smapi/BAT0/remaining_running_time # cat /sys/devices/platform/smapi/BAT0/remaining_charging_time # cat /sys/devices/platform/smapi/BAT0/remaining_capacity # cat /sys/devices/platform/smapi/BAT0/design_capacity # cat /sys/devices/platform/smapi/BAT0/voltage # cat /sys/devices/platform/smapi/BAT0/design_voltage # cat /sys/devices/platform/smapi/BAT0/manufacturer # cat /sys/devices/platform/smapi/BAT0/model # cat /sys/devices/platform/smapi/BAT0/barcoding # cat /sys/devices/platform/smapi/BAT0/chemistry # cat /sys/devices/platform/smapi/BAT0/serial # cat /sys/devices/platform/smapi/BAT0/manufacture_date # cat /sys/devices/platform/smapi/BAT0/first_use_date # cat /sys/devices/platform/smapi/BAT0/temperature # in milli-Celsius # cat /sys/devices/platform/smapi/ac_connected
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值