linrunner / TLP

TLP - Optimize Linux Laptop Battery Life
https://linrunner.de/tlp
GNU General Public License v2.0
2.51k stars 129 forks source link

`START_CHARGE_THRESH_BAT0` value is not taking effect #715

Closed MaZED-UP closed 7 months ago

MaZED-UP commented 7 months ago

Laptop: Thinkpad E14 Gen4 w/ Intel i5 12th Gen CPU & Nvidia MX550 (disabled).

I have set these values as shown:

 532   │ # Battery charge level below which charging will begin.
 533   │ START_CHARGE_THRESH_BAT0=75
 534   │ # Battery charge level above which charging will stop.
 535   │ STOP_CHARGE_THRESH_BAT0=85

But when I list the values using sudo tlp-stat -b I find that START_CHARGE_THRESH_BAT0 is set to 0:

--- TLP 1.6.1 --------------------------------------------

+++ Battery Care
Plugin: thinkpad
Supported features: charge thresholds, recalibration
Driver usage:
* natacpi (thinkpad_acpi) = active (charge thresholds, recalibration)
Parameter value ranges:
* START_CHARGE_THRESH_BAT0/1:  0(off)..96(default)..99
* STOP_CHARGE_THRESH_BAT0/1:   1..100(default)
...
/sys/class/power_supply/BAT0/charge_control_start_threshold =      0 [%]
/sys/class/power_supply/BAT0/charge_control_end_threshold   =     85 [%]
/sys/class/power_supply/BAT0/charge_behaviour               = [auto] inhibit-charge force-discharge

Charge                                                      =   84.5 [%]
Capacity                                                    =  101.3 [%]

The battery percentage is always at 85% when the laptop is charging and not discharging until it reaches 75% as expected. Even when I run sudo tlp setcharge 75 85 nothing changes in the battery report.

linrunner commented 7 months ago

Hi.

The battery percentage is always at 85% when the laptop is charging and not discharging until it reaches 75% as expected.

I suspect you are subject to the misunderstanding described in the FAQ.

If not: a diagnosis is not possible with arbitrarily abbreviated outputs. Your issue will not be processed without complete tlp-stat outputs for AC as required by the template. .

Provide them via https://gist.github.com/ please.


MaZED-UP commented 7 months ago

I see. I'm sorry for the misunderstanding. However, is the persistent 0 value of START_CHARGE_THRESH_BAT0 considered a bug? Should I provide the full report in that case?

linrunner commented 7 months ago

Imho it's a known quirk in Lenovos EC firmware for some series. See FAQ.

MaZED-UP commented 7 months ago

I guess this confirms it. This message appeared after an attempt to recalibrate the battery.

Currently discharging battery BAT0:
voltage            =  10801 [mV]
remaining capacity =    870 [mWh]
remaining percent  =      1 [%]
remaining time     =     10 [min]
power              =   4925 [mW]
state              = Discharging
force-discharge    = 1
Press Ctrl+C to cancel.
Error: battery BAT0 was not discharged completely i.e. terminated by the firmware -- check your hardware (battery, charger).
Battery recalibration aborted.

~ took 1h11m31s
󰂄 2% ❯

Here is the full report: https://gist.github.com/MaZED-UP/a76df500c4f92041476a1beb6ec0a00e

linrunner commented 7 months ago

https://linrunner.de/tlp/faq/battery.html#tlp-recalibrate-terminates-with-an-error-message

MaZED-UP commented 7 months ago

Oh my god. I feel embarrassed. 😅 Anyway, thank you for your time and help.

MaZED-UP commented 7 months ago

Sometimes a "Phoenix Technologies" logo appears when booting up.
I hope this info can help. https://www.phoenix.com/wp-content/uploads/Phoenix-Black-and-Red-RGB-scaled.jpg

MaZED-UP commented 3 months ago

Hi! I hope this is related. auto-cpufreq has added a feature to control battery threshold. Setting the start_threshold value does indeed take effect.

[battery]
enable_thresholds = true
start_threshold = 70
stop_threshold = 75

However, tlp-stat -b displays no change with the same values above.

/sys/class/power_supply/BAT0/charge_control_start_threshold =      0 [%]
/sys/class/power_supply/BAT0/charge_control_end_threshold   =     75 [%]