Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes in /etc/tlp.conf don't affect tlp-stat -b on a Lenovo W530 with Xubuntu 20.04.3 #598

Closed
melolontha-melolontha opened this issue Nov 18, 2021 · 7 comments

Comments

@melolontha-melolontha
Copy link

[x] I've read and accepted the Bug Reporting Howto
[x] I've attached all required tlp-stat outputs via Gist (see below)

I use a Lenovo Thinkpad W530 with Xubuntu Ubuntu 20.04.3 LTS currently using a kernel 5.4.0-90-generic x86_64.

Charging thresholds 75% / 90% have worked on this laptop before. Now I checked it again with sudo tlp-stat -b and I was surprised that they are reported as 0% / 100%.

Therefore I checked /etc/tlp.conf and I found out that the lines for the charge threshold were commented out (i.e. they started with a #). Also the values there were 75% / 80% rather than 75% / 90% which I had set before and of course it was different from what is effectively reported.

Therefore I removed the # in front of the two lines for BAT0 first, changed the upper threshold to 90% and then I executed sudo tlp start and checked sudo tlp-stat -b again. But the charge thresholds did not change!

I also tried a reboot, but I see no difference. It looks like tlp does not really obey to what is in /etc/tlp.conf.

To be on the safe side, I also removed the # sign in front of the two lines for BAT1 and adjusted the thresholds for BAT1 in the same way, even though I don't have an Ultrabay battery. Of course I executed sudo tlp start again and checked the result of sudo tlp-stat -b. But the reported charge thresholds did not change, even after a reboot (with the running AC adapter connected and also running on battery only)!

Expected behavior

I expect the changes of /etc/tlp.conf to be reflected in sudo tlp-stat -b after sudo tlp start has been executed.

To Reproduce

The unexpected behavior is reproducible on my laptop. It does not depend on running on battery or AC adapter

See attached file with listing of /etc/tlp.conf and tlp-bat
2021-11-18_Files-for-tlp-issue.txt
commands

Additional context

Add any other context about the problem here.

@linrunner
Copy link
Owner

linrunner commented Nov 18, 2021

Hi,

parameter lines with comments are ignored:

 START_CHARGE_THRESH_BAT0=75          # war am 2021-11-17 auskommentiert
 STOP_CHARGE_THRESH_BAT0=90           # dito, von 80 auf 90 erhöht.

Refer to Settings

Comments after parameters are not allowed, the whole line will be silently ignored:
EXAMPLE="dont use like this" # Parameter in front is ignored!

ps. standard behaviour since 1.3

@melolontha-melolontha
Copy link
Author

linrunner,
thank you very much for your advice.
Indeed, now it works as expected.
It was my fault not to read this part of settings.
However, one might consider to stop parsing a line from the config file with a # sign (including it) rather than discard it altogether.
Then one might annotate changes in the config file in the same manner as in bash scripts, something very well known to everyone.

@linrunner
Copy link
Owner

Good news: I modified the parser to handle trailing comments.

linrunner added a commit that referenced this issue Jun 10, 2022
@linrunner linrunner added this to the 1.6 Release milestone Jun 10, 2022
@linrunner
Copy link
Owner

linrunner commented Jul 22, 2023

Hi @ALL : TLP 1.6 Beta 1 is out and contains the fix for this issue -> #700

@melolontha-melolontha
Copy link
Author

How can I verify the version which I have? I uninstalled the previous one and installed (hopefully!) the beta one, but trying comments in active lines of /etc/tlp.conf did not work. When I set them to separate lines instead, the lines were honoured.

@melolontha-melolontha
Copy link
Author

melolontha-melolontha commented Jul 24, 2023

If sudo tlp-stat does the test: I get

[sudo] Passwort für v: 
--- TLP 1.3.1 --------------------------------------------
...

What should I get after

sudo apt-get remove tlp
sudo add-apt-repository --remove ppa:linrunner/tlp
sudo add-apt-repository ppa:linrunner/tlp-beta
sudo apt install tlp tlp-rdw

This is, what I did.

@linrunner
Copy link
Owner

linrunner commented Jul 24, 2023

Following the instructions precisely is important. The download page does not tell to uninstall anything or to remove the regular PPA. But that's not your real problem.

After the step for adding the Beta PPA you have overlooked the

sudo apt update

As soon as you make up for that, all you need is a

sudo apt install tlp tlp-rdw

Good luck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants