frederik-h/acer-wmi-battery
关于
A linux kernel driver for the Acer WMI battery health control interface
系统与基础设施实测星标增长
- 24小时
- +1
- 7天
- +1
- 15天
- +3
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文acer-wmi-battery
Description
This repository contains an experimental Linux kernel driver for the battery health control WMI interface of Acer laptops. It can be used to control two battery-related features of Acer laptops that Acer provides through the Acer Care Center on Windows: a health mode that limits the battery charge to 80% with the goal of preserving your battery's capacity and a battery calibration mode which puts your battery through a controlled charge-discharge cycle to provide more accurate battery capacity estimates. It can also be used to read the battery temperature.
The driver has been developed on an Acer Swift 3 (SF314-34) laptop. Users have reported that it also works on other Acer laptops. A list of those models can be found here. Any feedback on how it works on Acer laptops not found on this list is appreciated.
Building
Make sure that you have the kernel headers for your kernel installed
and type make in the cloned project directory. In more detail,
on a Debian or Ubuntu system, you can build by:
sudo apt install build-essential linux-headers-$(uname -r) git
git clone https://github.com/frederik-h/acer-wmi-battery.git
cd acer-wmi-battery
make
Using
Loading the module without any parameters does not change any health or calibration mode settings of your system:
sudo insmod acer-wmi-battery.ko
Health mode
The charge limit can then be enabled as follows:
echo 1 | sudo tee /sys/bus/wmi/drivers/acer-wmi-battery/health_mode
Alternatively, you can enable it at module initialization time:
sudo insmod acer-wmi-battery.ko enable_health_mode=1
Calibration mode
Before attempting the battery calibration, connect your laptop to a power supply. The calibration mode can be started as follows:
echo 1 | sudo tee /sys/bus/wmi/drivers/acer-wmi-battery/calibration_mode
The calibration disables health mode and charges to 100%. Then it discharges and recharges the battery once. This can take a long time and for accurate capacity estimates the laptop should not be used during this process. After the discharge-charge cycle the calibration mode should be manually disabled since the WMI event that indicates the completion of the calibration is not yet handled by the module:
echo 0 | sudo tee /sys/bus/wmi/drivers/acer-wmi-battery/calibration_mode
Battery Temperature
The temperature of the battery in millidegree Celsius can be read as follows:
cat /sys/bus/wmi/drivers/acer-wmi-battery/temperature
Related work
There exists another driver with similar functionality of which I have not been aware when starting the work on this driver. See this issue for discussion.
探索相关项目
加载中…