My Librem 14 was failing to charge with PureOS. I switched out the power cord that goes into the provided transformer with a spare Australian cord I had laying around. The transformer says it supports 50Hz and 240v supply so that shouldn’t be a problem.
The solution was; sudo apt install librem-ec-acpi-dkms cat /sys/class/power_supply/BAT0/charge_control_start_threshold
outputs 0. This is the problem as the laptop will only start charging when it is completely dead. echo 90 | sudo tee /sys/class/power_supply/BAT0/charge_control_start_threshold 90 can be any value between 0 and 100. Your laptop should start to charge!
Edit: if cat does not output a number or you get an error (no such file or directory, or permission denied) check the directory and file exists. If not, update CoreBoot.
All the battery settings are found in /sys/class/power_supply/BAT0/
Once you install librem-ec-acpi-dkms you may need to reboot your laptop.
If you don’t have charge_control_start_threshold or charge_control_end_threshold in the /sys/class/power_supply/BAT0 directory, you need to update CoreBoot.
Did you use the terminal to edit it? It’s root-level, so it has to be prefaced with sudo (i.e. “superuser do”).
sudo nano followed by the file path /sys/class/…and so on.
sudo raises the privilege, nano is the name of the text editor (unless you have a different text editor installed, in which case you use the name of that one instead).
What is your firmware version?
I am on 17.1 PureBoot and on Qubes and I can not see /sys/class/…/charge_control_start_threshold.
I also cannot see it on PureOS-10 live version.
Nicoles solution is actually a driver and not a firmware update. That is why I wonder that updating the firmware helped.
On my PureOS harddrive install I also had to install Nicoles Driver before I could get the files.
First of all the dot before charge_control_… must be left out.
Second you will probably have to do sudo chmod 666 on the file and then sudo vi the file.
That’s the vim antifeature - the .swp file in the same directory in which is the file being edited. Not all directories are writable, but files in them might. And this is the case with /sys filesystem.
Try updating the file this way, as root: echo 90 > /sys/class/power_supply/BAT0/charge_control_start_threshold
sudo su then echo 90 >sys/... would work. sudo echo 90 >sys/... is not working, because first shell tries to open /sys/… (as regular user) and only then would execute the sudo. Since regular users can’t write to files in /sys, the shell get’s permission denied error, and does not even try to execute the sudo.
Any output redirections (the bits with a > sign) are not part of the command, but instruction for the shell, where output should go. So unless the shell itself runs as root, output redirections will not be able to write to restricted locations where only root can write.
sudo nano is admittedly simpler than sudo su; echo; exit (one command vs three).
If the value for /sys/class/power_supply/BAT0/charge_control_end_threshold is 0
Then run:
echo ‘40’ | sudo tee -a /sys/class/power_supply/BAT0/charge_control_start_threshold
echo ‘95’ | sudo tee -a /sys/class/power_supply/BAT0/charge_control_end_threshold
All seems to be working fine for me now. I will be curious if he next software update overwrites any of these changes. I’m new to all this, so not sure how it is handled.
Also I have noticed that first you have to update charge_control_end_threshold i.e. 95 only then you will be able to set charge_control_start_threshold 90.
Hi Dean, I don’t have the threshold files in my file directory to change. I updated my PureBoot, but when I tried to update Coreboot I got a warning saying that I would lose all of my Pureboot settings. If I choose to update Coreboot, does this mean I lose the functionality of the Librem Key, or can I still be using PureBoot after that? Updating only PureBoot has not given me the missing file.
I’m on Linux Mint 20.1 Cinnamon, I’m attempting to run sudo apt install librem-ec-acpi-dkms but I’m getting Unable to locate package librem-ec-acpi-dkms. Can someone point me to where I can add the librem-ec-acpi-dkms repository to my machine to be able to download it?