Librem 14 Failed to charge SOLVED

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.

1 Like

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

(or any other number then 90, to your liking).

@Dwaff I tried that technique (echo >) with sudo but it wouldn’t work. That’s why I wrote it using nano.

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).

1 Like

Users could also do ‘sudo bash -c “echo 90 > /sys/…”’

2 Likes

Or, a bit more elegantly, echo 90 | sudo tee /sys/class/...

2 Likes

Seems everyone has fixes this, so just wanted to share instructions I received from Purism Support…

please install the librem-ec-acpi-dkms package:

sudo apt install librem-ec-acpi-dkms

Then restart and check what the charging thresholds values with the following commands:

cat /sys/class/power_supply/BAT0/charge_control_start_threshold

cat /sys/class/power_supply/BAT0/charge_control_end_threshold

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.

9 Likes

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.

1 Like

Hi Dean, I updated the coreboot and when I went to update threshold, I got permission denied in the terminal.

FYI - Newbie to linux.

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.

Make sure you follow the sudo tee ... hackery in the post above by @Bass20 : Librem 14 Failed to charge SOLVED

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?

1 Like

Hi Kieran, I have ran those commands and hopefully it works now.

Thank for your help.

1 Like

This is the only real hurdle I see to Linux adoption. Adding repos from other distros, and understanding all that this means is not easy.

Using the Pure OS repo on Mint might break your distro, or upgrade packages to be incompatible with Mint. However, I’m not sure you can add a repo and lock it only one file from that repo?

It would be great if Purism separated Coreboot into its own repo this way, you would have no problem updating it on whatever distro you used. (Perhaps Purism already does this, for this very reason. I don’t know.)

2 Likes

How can I check to see what my firmware version is?

On Librem 14 | PureBoot Boot Menu go to System Info i get PureBoot-Release-17.1

You can use sudo dmidecode: https://www.linuxnix.com/how-to-get-bios-firmware-and-installed-drivers-details/

3 Likes

Ah dang, I thought Coreboot was separated out into it’s own repo. Ah well! Would I be able to boot up a live USB of PureOS and update Coreboot that way?

You should have a kernel with this version: 5.10.0-7-amd64 at least

This is because the driver is not yet in the Debian repos. We are working on that.
You can get it from here: https://software.pureos.net/package/bin/byzantium/librem-ec-acpi-dkms

But again check your kernel version as well

1 Like

You can use this command t check your firmware version:

sudo dmidecode | grep -m1 "Version"