frederik-h / acer-wmi-battery

A linux kernel driver for the Acer WMI battery health control interface
GNU General Public License v2.0
113 stars 15 forks source link

Not working on Aspire 5 A515-45 and a Swift 1 SF113-31 #9

Closed frederik-h closed 1 year ago

frederik-h commented 1 year ago

@mnlipp has reported the following issue:

I tried this on an Aspire 5 A515-45 and a Swift 1 SF113-31.

echo 1 > /sys/bus/wmi/drivers/acer-wmi-battery/health_mode does not give an error, but cat /sys/bus/wmi/drivers/acer-wmi-battery/health_mode returns 0 (before and after the echo).

So I suppose it doesn't work. But as this device has never seen Windows, therefore I cannot tell if the hardware is supposed to support > this (cannot check using "Acer Care Center").

@mnlipp: Could you please take a look at the dmesg output? There should be a line from the module which lists the available modes. Does it include the health mode?

mnlipp commented 1 year ago

On the Swift 1 SF113-31 it says

acer_wmi_battery: Unknown buffer length 4
acer_wmi_battery: available modes: health mode, calibration mode

On the Aspire 5 A515-45 things are a bit different. It says (no error/warning regarding buffer length):

[  252.470232] acer_wmi_battery: available modes: health mode, calibration mode

But executing echo 1 > /sys/bus/wmi/drivers/acer-wmi-battery/health_mode results in acer_wmi: Unknown function number - 8 - 1

Surprisingly, tlp already seems to have some way to set health_mode for the Aspire 5, although nothing in tlp-stat indicates this. (I hadn't tlp installed yet when I wrote initially about my observations yesterday.) If I enable tlp and then load your module, I get

acer_wmi_battery: available modes: health mode, calibration mode
acer_wmi_battery: active modes: health mode

And cat /sys/bus/wmi/drivers/acer-wmi-battery/health_mode returns 1. (So this is consistent.)

Executing echo 0 > /sys/bus/wmi/drivers/acer-wmi-battery/health_mode however also results in acer_wmi: Unknown function number - 8 - 1. So the "writing part" doesn't seem to work.

mnlipp commented 1 year ago

After booting the Aspire 5 A515-45 a few more times it seems that "active health mode" has been a coincidence. I couldn't reproduce this any more.

Logarithmus commented 1 year ago

I have A515-45-R9FY and it doesn't work with echo, but does work by setting a kernel module option in /etc/modprobe.d/acer_wmi_battery.conf (create the file):

options acer_wmi_battery enable_health_mode=1

and

sudo modprobe -r acer_wmi_battery
sudo modprobe acer_wmi_battery

and then (to make module autoload on boot)

sudo echo "acer_wmi_battery" >> /etc/modules-load.d/load.conf
Logarithmus commented 1 year ago

@frederik-h although I have another problem: currently I have 95% battery charge, unplugged. When I plug the cable, it jumps to 100%. When I unplug, it becomes right again. Is this expected behaviour?

frederik-h commented 1 year ago

@frederik-h although I have another problem: currently I have 95% battery charge, unplugged. When I plug the cable, it jumps to 100%. When I unplug, it becomes right again. Is this expected behaviour?

That's not the behavior that I see on my laptop. However I can imagine that the different Acer models can behave differently in this regard.