Status of Suspend for Librem 5

What these values 32 ./. 9 mean exactly? Is 32 what you expect or what you have had in the past?

1 Like

32 HRS it the time i expect on SuspendToRam on Librem 5, currently it is like 8 or 9 HRS with HKS ON, (my case), however 24 HRS on Suspend with all HKS ON, should be OK too.

As far i know the Librem 5 can get 32HRS on s2r.

1 Like

How do you measure the time in suspend when the device at the end runs out of power? Will it wakeup by its own at certain limit, let‘s say 2% ?

2 Likes

With a timed Stopwatch and waking up the device to see the battery percentage.

1 Like

Okay, but as far as I know Crimson is indeed broken enough that I can tell “it does not count yet”. On Byzantium I run much more hours with 4G on. As far as I know dos was also not speaking about all HKS off, but probably better to ask him.

Usually it is enough to measure 1-2 hours and extrapolate. In my previous calculations it was very precise to what I saw on low percentages. But there is also a tool to track battery data, which you could read when booting again I guess.

3 Likes

So I will run this script

#!/bin/sh

while true; do

    date
    upower -d
    sleep 10

done >> upower.log

and wakeup the phone every hour and later analyze the log.

2 Likes

Without any sophisticated analyzing, my L5 was in suspend from 14.57 to 17:59, from syslog:

Jun 23 14:57:35 pureos kernel: [40361.906592] PM: suspend entry (deep)
Jun 23 17:59:42 pureos kernel: [40361.936495] Filesystems sync: 0.029 seconds

i.e. 3 hours and the battery went down in this time from 100% to 53%. The only HKS in position on was cellular network.

The battery is from the beginning, maybe 3 years old. I will switch to a new one I own.

4 Likes

Thats a really bad result. : (

To be honest, i not sure what controller is consuming such a huge amount of power in sleep mode.
?

1 Like

I would like to know why my Librem 5 battery goes from 60% to flat after only a few days in a drawer after being powered completely off.

3 Likes

Is it powered off while charging? Because that does make a difference.

2 Likes

1. test yesterday with the daily used battery

Jun 23 14:57:35 pureos kernel: [40361.906592] PM: suspend entry (deep)
Jun 23 17:59:42 pureos kernel: [40361.936495] Filesystems sync: 0.029 seconds

i.e. 3 hours and the battery went down in this time from 100% to 53%, i.e. in 3 hours 47% drained. The only HKS in position on was cellular network.

2. test with a nearly fresh/unused battery:

Jun 24 10:52:55 pureos kernel: [ 8408.846770] PM: suspend entry (deep)
Jun 24 13:54:22 pureos kernel: [ 8408.874861] Filesystems sync: 0.028 seconds

i.e. 3 hours and the battery went down from 87% to 68%, i.e. in 3 hours 19% drained. Again, the only HKS in position on was cellular network. This means, 6,33% drain per hour or 15.79 hours in suspend mode.

3 Likes

Usually not. But power off should mean power is off. What are the steps to shut down so that it lasts more than a few days in a drawer?

1 Like

Yeah it should but… :roll_eyes:

AFAIU - When you turn the phone off while it is charging the charge controller stays on, and then proceeds to drain the battery.
So make sure to unplug it before powering off if you want the charge to stay full for a while

4 Likes

I do not know what is the best option to have a command run every ten minutes. Your while script will post it every 10 seconds and never let the system suspend/sleep.

If its no issue about your script. You can drop the while loop and run this script with cron every hour. I am not sure how well purism use the cron or kernel methods for sleep and wake up.

But if its well implemented it should wake up the system and check time as a very low level at low cost, because for that the Linux Kernel and Cron was designed in the first place.

Sleep itself is just kind of counting high level with high coast program/interface and do not match real time requirements.

I am not sure about the suspend mode - but with my daily use its a feeling that my not crimson phone will not use/enter the suspend mode via idle only if i push the “Suspend now” button in the L5 Mobile Settings Options.

1 Like

At last I gave suspend a test. Unfortunately my Liberty phone does not handle call after waking up. Caller confirms call is on-going, but no app pops up on my screen that will allow me to accept the call. Also phone does not produce sound

2 Likes

AFAIU, the shell running the while loop should be put in suspend like any other proc running on the L5.

2 Likes

Is there a way to measure the real capacity in mAh of a battery which says 100% ? Maybe a normal resistor and measuring the current and time to empty? The battery has three connectors, which must be used and how much Ohm the resistor should have best to simulate the discharge of a L5?
Thanks

3 Likes

There is a lot of information in /sys/class/power_supply/max170xx_battery/

capacity is an integer in % that matches the value displayed in various battery monitor tools (where they probably get it). That needs to be calibrated from time to time by letting it go as low as you are comfortable, followed by charging as high as you are comfortable, maybe several cycles of this. (Please do not shoot the messenger.)

charge_counter is an integer integration of the current (in unknown to me units) and possibly together with voltage_now and is the basis of the value in capacity. There are also various voltage, current, and temperature values.

1 Like
3 Likes

Worth adding that this is an OS feature, so if you’re not using PureOS you need to make sure the OS you’re using implements it.

Eventually it would be nice to have that moved into the kernel, but it’s not a very straightforward thing to do.

3 Likes