Here’s a little scipt I wrote, you might as well just click down-load …
I wanted to play a bit with my new device and see how changing some settings etc. affects battery life. As I am certainly not patient enough to go through a full charge cycle to measure an effect, I wrote this lil script. It can
dump info on battery and charger
print charge state (and diff) in intervals
For example, I wanted to see what happens if you disable 3 of 4 cores. (Spoiler: basically nothing)
On the Librem 5, the granularity of the charge level measurements seems to be 3mAh.
Thus when idle, that leads to a changed reading every 30…40s.
In other words, with a 10 second interval, the difference is either 0 or 3mAh.
In a minute, it’s either 3mAh or 6mAh.
Consequently, when measuring an idle device, choose the minute interval ./batteryjuice -w and wait 10 minutes. Every 10 minutes, an accumulated difference is printed.
not sure what all those numbers mean, if I leave the phone idle, I lose about 8% charge an hour, its much worse when actually using it as any phone is. Battery draining being idle is an issue, but minor nitpick for me, whats way worse is that charging it takes forever to get to 100%. Basically if one is to make this a daily driver, should really have a power source around at all times or a second battery.
The columns are:
Current time (24h format)
Remaining run-time untill battery is empty (according to battery chip)
Charge level in %
Battery temperature
Charge level in mAh
Difference to previous reading in mAh
What that gives you is precise numbers to compare instead of merely having the current percentage.
Well, I’ll have to disagree.
All batteries slow down when approaching 100%. It’s not about this particular device/battery. Other devices might force a somewhat quicker charge, but degrading the battery faster in doing so.
On the contrary, if idle consumption could drop from 5mAh to, say, 2mAh, that would be huge.
Not only would it last a whole day then, it would also not have to recharge as much if you plug it as often as now, thus your point on charging speed would matter less.
I’m not sure, but I think suspend will even reduce consumption while the screen is on. But that is precisely a thing that can be monitored with this script: how updates change these numbers
Power Delivery protocol slowdown the charger after 80% this is made for to preserve the batt.
As far as I know the Suspend Mode it only for screen off.
I am quite curious why the L5 it eating to much batt with all HKS off, Purism already implemented inactive mode to CPU.
If you actually monitor the charging current, you can see this in action. Starts off at around 1.6A (say, when the battery is at 20%). Charging current mostly declines throughout the charge. By the time the battery is getting close to 100% the charging current is tiny.
I’m sure @Caliga could modify the script to demonstrate that.
I think the bottom line is: If you don’t need to charge to 100% then only charge to 80%. You will be kinder to your battery and you will spend much less time charging.
Yeah, kinda forgot that, because with ssh Ctrl+C is sufficient.
Fixed
Also new:
(dis)charge rate
should work on Librem Laptops now, too
I didn’t immediately find where to get that value (I guess one in /proc/stat ?)
Anyway, like with the second request, I feel like this might be beyond the scope of this this tool.
It’s supposed to show the power draw in different scenarios, e.g. screen on/off, WiFi on/off, etc.
It’s not intended to point out what the scenario is.
As most of the power (in idle-to-moderate-usage scenarios) goes to the system, pointing at a process is also somewhat misleading.
There are better tools for finding offending processes, so I included them in the updated description.
For example, I assume that once we have a proper suspend, it might be (much more) interesting to see which processes wake up how often (see interrupts in powerstat)
no! I mean, yes there’s a slowdown but that has nothing to do with the USB Power Delivery protocol.
In the following output you can see a short pause where the battery reached ~55°C, at which point I also quickly unplugged it to place it on a cool stone surface.
But in general the charging current goes back linearly. And if my rusty electrics knowledge serves me well, that should be because of good old I = U/R, where battery internal resistance increases during charging.
Click to see: batteryjuice output during charging from 38-98%
Do you see that is slowdown after 72%? i guess it is because it getting hot mostly or PD Technologies. But why you never get 3000mA charge in? What charge do you use?
@dos why powesupply app does not work on Librem 5 it need a patch?
Last time I checked, powersupply was simply hardcoding PinePhone paths and drivers, so it couldn’t really work on any other device without modification.
I am currently researching Lithium batteries for a stealth camping van I am building. These batteries have a very different charging profile requirement than other chemistries, makes sense, right?
In any case, what I’m reading, especially the 80% point, is exactly the requirement after <80 charge rate.
There are some voices saying it is not a good idea to charge to 100%.
A device called a Battery Management System (BMS) is critical to charge Lithium prudently. Another hurtle PURISM takes on, these folks have no fear, me thinks.
TL;DR: Neither the battery, the charge circuit or the phone behaves like a resistance.
Regardless if internal resistance changes during charging or not, let’s hope you’re seeing something different - because if the internal resistance was what determines the charge current at full charge, then this would also be the (maximum) current available to the phone when discharging. Additionally, that maximum current would be delivered at a voltage close to 0, which would not be enough for the phone to operate.
The big change is battery voltage going up, so if you charge from a fixed voltage through a fixed resistance that will cause charging current to go down linearly: I = (Ucharge-Ubatt)/R (edit to add formula)
This fixed resistance would be the internal resistance (small) in series with a current-limiting resistance. (Think lead-acid batteries and older chargers.)
But this is not how charging the phone works. The current and the charging voltage applied to the battery terminals are determined by the (programmable) charge controller IC, using battery voltage and temperature as inputs. And then there’s USB-C Power Delivery, with different modes available to the phone.
PCB traces, the USB cable, and the internal resistance of the battery are resistive components, i.e. components that follow Ohm’s Law. The battery, the charge circuit, and the phone are not, and I think it’s more confusing than helpful to view them as resistors.
If anyone wants to know more about how battery charging works on the Librem 5, you can find that information in the charging controller’s datasheets: https://www.ti.com/product/BQ25895
If anyone wants to see battery charging in operation, I got me a USB multimeter, and that shows the voltage and current and power … relating to the USB. However, for the current e.g., that is showing the entire current being drawn by the Librem 5 (battery charging + operation) and hence depends on the state of the Librem 5 (screen on/off, power saving, HKS, …) and the numbers will not equal what is being reported by the charging hardware.