Librem 14 - Falling battery max charge percent

Yeah I’m running Gentoo.
I assume this is the appropriate repo?

1 Like

Actually since it’s the firmware and I don’t want to brick my system. I could boot up PureOS off a flash drive in a live environment and just install it that way right?

1 Like

The DKMS driver does not flash anything.
The repo you referred to is the firmware itself, this is not needed (yet). You want this kernel driver:

This will give you access to the battery charger start/end thresholds which, I guess, are set wrong on your machine.

Cheers
nicole

4 Likes

Looks like it was set to 53 and 100. I set the start threshold to 80 and it looks like the charge percent just ticked up to 57% so I think it’s working now

Thank you!

1 Like

I’m having this exact issue!
I have attempted to install the package and; repeatedly get an error saying the file type is unsupported.
If I downloaded the directory provided here https://source.puri.sm/nicole.faerber/librem-ec-acpi-dkms

What would be the commands to install the package?

I have been using:
sudo apt install librem-ec-acpi-dkms

but this hasn’t worked.

cheers,
alex

1 Like

If you download from https://source.puri.sm/nicole.faerber/librem-ec-acpi-dkms , then you’ll need to run make in the folder from a terminal to build the kernel module, assuming you have the necessary tools to build it, and then use insmod to install the module.

If you’re unfamiliar with building stuff from source then your best bet it is to install from apt. What happened when you tried to install it from apt? Did it get the kernel module but nothing changed? You might need to reboot or use modprobe to load up the module after apt installs it.

1 Like

I’m unfamiliar with building from source!
I actually just fixed the issue. I must have been inputting the wrong commands to update because this time it worked and I can see the thresholds

Thanks!
cheers,
alex

1 Like

If you want to try it, you need to install git, gcc and make.

First, go in some folder you want to use for building. Run git clone https://source.puri.sm/nicole.faerber/librem-ec-acpi-dkms.git then go into the folder librem-ec-acpi-dkms. After that, run make (to make things faster, I recommend using make -j 12). If it doesn’t work due to privileges, run sudo make -j 12.

1 Like

@nicole.faerber it would be nice to have these drivers and tools installed on some build of PureOS live image. That way you could tell people boot that and run such and such commands.

I had the same bug and it was not easy to install on Qubes or available build of PureOS live (right version of kernel headers was not available at the moment)

2 Likes

@Honza This. I was asking to do the same with the Coreboot updates, but Purism doesn’t appreciate this idea for some reason.

1 Like

Im having the same issue, im running pureOS 10 & ive run

it updated but the battery still isnt fully charging.

1 Like

I am having a related issue. Since first boot, the L14 has not been able to charge beyond 67%.

I installed librem-ec-acpi-dkms.

I had to use chmod to get write permissions for editing /sys/class/power_supply/BAT0/charge_control_start_threshold
&
/sys/class/power_supply/BAT0/charge_control_end_threshold

I changed these values to 40 and 95 as suggested here.
They had been set to 0 & 100 by default.

Regardless, the laptop still doesn’t charge beyond 67%.

Also, it fails to detect or draw power from a USB-C charger in the right hand side USB-C port. Only the laptop barrel charger is supplying power.

1 Like

yeah, and I explained pretty thoroughly why in the linked thread.

1 Like

did you not read the paragraph above where those values are listed?

If the battery percentage falls below the start threshold and then a new charge is started, charging will stop when the battery reaches the end threshold percentage.

so, by setting the start % to 40%, you’re telling it not to start charging until the battery chage drops below 40%. It’s working exactly as expected based on those settings.

90/100 would be sane defaults IMO.

2 Likes

Just an FYI, mine is now doing the same after I updated 2 and 4 days ago. Before that it would charge to 100%. I will look into this thread more closely for the solution, but it seems obvious something changed in the updates over the last few days.

1 Like

Ah that has cleared that up, I was confused as the number 67% seemed to bear no relation to either of the presets of those thresholds.

I now have it charging to 95%

Any ideas on the USB-C not being detected for charging?

1 Like

Could someone please help me. I tried building nicoles driver. However I get an error:
make -C “lib/modules/5.10.0-7amd64/build” M="" modules
make[1]: *** /lib/modules/5.1.0.0-7-amd64/build: file or directory not found. Quit.
make: *** [Makefile:5: all] error 2

The above is translated from my mothertongue.

What do I need to do? I have installed make, gcc and build-essentials.
I have just received my Librem14 and updated it with “apt update” “apt upgrade”

1 Like

The power source needs to be supplying 19V or it won’t work.

1 Like

From the error message it sounds like /lib/modules/5.1.0.0-7-amd64/build doesn’t exist. You should be able to run make as a regular user without any additional arguments from the directory with the Makefile. This will produce a librem_ec_acpi.ko file in the same directory. You can use insmod to load it right away. Or move it to /lib/modules/5.1.0.0-7-amd64/kernel/drivers to have it auto loaded by the kernel. Replace 5.1.0.0-7-amd64 with the proper kernel version. To check what you’re currently running use the command:
uname -r

1 Like

Thanks for the answer. Unfortunately it did not help me.
The error is the same and no .ko file in my librem-ec-acpi-dkms directory.
I tried installing PureOs10 devel from the homepage and fully updated it. This didn’t help either.
How can I get this /lib/modules/5.1.0.0-7-amd64/build working?

uname -r gives me: 5.10.0 - 7 - amd64

Searching the WWW helped. Solution:
sudo apt install linux-headers-5.10.0-7-amd64

For anyone else just change it accordingly to your kernel version. sudo apt search linux-headers may help.

Just wanted to let readers and purism know I had the same firmware bug as [L14 Battery] Constant discharge + Charge in Qubes.
My librem was not charging at all after the battery drained the first time.
I hope Purism finds a way to easily fix the firmware for users.
There seem to be a issue with the battery charging in general (see other forum posts).

1 Like