-
Notifications
You must be signed in to change notification settings - Fork 22
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
not working if the computer is put to sleep mode #3
Comments
Thank you for bringing up the issue. I will have a look into it. Just to make sure that I understand,
|
|
Do you get any message after running |
no |
Can you run the following command, |
~/Binaries/bat1$ test -f /sys/class/power_supply/BAT?/charge_control_end_threshold && echo "TRUE" |
Sorry about that, just edited the comment to run a different command. Can you run this command |
test -f /etc/systemd/system/bat.service && echo "TRUE" |
Please check if the file has any contents by running, If it does, then run |
This is what I am getting after running first command: [Service] [Install] ~ and after running "systemctl enable bat.service" nothing happens. I tried using SUDO also. |
Nothing happens as in there is no output after running the command or the battery threshold is still not persisting between restarts? Can you run the following and send me the output? I might have to get Ubuntu installed to try to work this one out.
And just to make sure, you are running the latest version from the releases page right? |
Yes I am running the latest release. The following is the output: sjv@dh1729: Mar 08 15:25:59 dh1729 systemd[1]: Starting Set the battery charging threshold.> Mar 08 15:25:59 dh1729 systemd[1]: Starting Set the battery charging threshold... |
Can you check if this fix works? |
Not working. Do I need to restart the computer and test it again? |
I think so. Judging by your output, everything should be working. The threshold level seems to be set to 91 and it should persist between restarts and sleep/suspend but not hibernation. The only problem seems to have been with the call to set the threshold level which on Ubuntu didn't work because the root user appears to be locked by default but that should not be a problem with this version. As a last resort, run If that worked then, run |
Okay, I will post it in few hours. |
sjv@dh1729: so after resuming from suspend, it is not working. |
Okay. That narrows it down. Without doing anything else, when you shut it down and boot again, is it still set to 60? |
Yes, it shows that it is set to 60. |
Let me know if this fixes the problem with the threshold not persisting after sleep/suspend. But first run |
Didn't work. |
Seems to be an issue with systemd. Can you check which version is installed on your system by running |
systemctl --version |
Curious. I’ll have to get a distribution of Ubuntu to understand exactly what is going on but it could take a while. |
Hi, I am using ubuntu20.4+kernel 5.10+systemd 245 (245.4-4ubuntu3.6). In may case bat-h, bat-c, bat-s works as it should Can You help? |
Difficult to say right now. But I will look into this and post here as soon as I manage to get a distribution of Ubuntu. |
I have the same problem. Looking at your previous suggestions i have run the following:
Ubuntu 21.04 |
Cheers. I have had exams so I haven't had the time to work on a fix yet but I should be able to download Ubuntu and get to working on it in the comings weeks. |
Here is a proposed fix. Let me know if it works. For everyone else, if you could show me the output of the following command, test -f /sys/class/power_supply/BAT?/charge_control_end_threshold && echo "TRUE" Ubuntu 20.04 does not seem to expose the charging threshold variable. At least when running it in a VM. But if you get an output value of |
Hi, I tried the new bat file and it's the same as before. If i close the lid of the laptop and open it the laptop starts charging.
Oh and when i reboot it stops at 60. The only time it stops is when the lid is closed or when i leave for too long. To try the new bat file I deleted using Ubuntu 20.04 LTS |
Suspend stores the machine's state in RAM and keeps it in low power mode whereas hibernate saves the machine's state in swap space and completely turns it off. Hibernate is notoriously difficult to get right on Linux and might even be disabled on Ubuntu by default but with some additional configuration you could enable it. Anyway, try the following and let me know if it fixes the problem. Just remember to run the |
It works great. |
Thank you for feedback! Can you post the output of the following command so that I can finalise a release? systemctl status bat-sleep.service |
Output (When the charging is stopped at 60%): ● bat-sleep.service - Persist the battery charging threshold after hibernation |
Thank you. |
Fix an issue (#3) on some distributions, most notably Ubuntu, where the charging threshold would not persist after the system went into suspend. This also updates the documentation and refactors the code to handle errors more effectively.
Fix an issue (#3) on some distributions, most notably Ubuntu, where the charging threshold would not persist after the system went into suspend. This also updates the documentation and refactors the code to handle errors effectively.
Fix an issue (#3) on some distributions, most notably Ubuntu, where the charging threshold would not persist after the system went into suspend. This also updates the documentation and refactors the code to handle errors better.
bat 0.7 OS: Manjaro Linux [x86_64] PS. |
If the laptop is put to suspend, then this feature doesn't work. Also, the persist function doesn't work.
And for example if I use the following command : ./bat --threshold 60, I get asked for root password, but I always get authentication failure. So, I need to use SUDO with it.
This program only works temporarily( During the session). If subjected to suspend or restart, then it fails.
I am using asus tuf a17 FA-706IH
operating system: ubuntu 20.04
kernel: 5.8.0-44-generic
The text was updated successfully, but these errors were encountered: