Status of Suspend for Librem 5

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

Does anyone know if mobian implements this?

After trixie is released and mobian releases a a stable release based on it and updates it a few times, I want to give mobian on the Librem 5 a spin.

1 Like

I’ve asked ChatGPT for a full description of all files there, it’s here:

1 Like

…and of course some of its answers are useless or borderline misleading.

We don’t have to guess, there are high quality information sources available publicly:

The datasheet describes all the registers, and the driver is straightforward enough that you can just read it to find out what the reported values and units are.

10 Likes

I did a small experiment as well:

  • L5 running Mobian trixie
  • WWAN disabled by killswitch, other kill switches not engaged
  • charged to 100%, then unplugged charger and sent to suspend

Result: After 11.5 hrs, the battery reports a remaining capacity of 61%. This would roughly mean a battery drain of 3,4% in suspend which would be very high, given radios were disabled.

However, I noticed that immediately after waking the device up it was connected to wifi and had bluetooth enabled, stating that software was not up to date. Hence, I am not sure how deep it was actually sleeping. Also, when I had woken it up before it usually came back with a slightly disorted lock screen and needed more presses of the power button to wake up while this time it was awake instantly.

I guess I should redo the same experiment, but this time disabling as much as possible via kill switches.

1 Like

Interesting…

So looks like modem hks may drain battery even if modem do not have a sim but hks ON. 3,4% by hours on suspend will good if modem will ON.

I would like to have Risc-V on WLAN and WANN on Librem 5 mainline, this may a help a little on powersave and openness.

2 Likes

Next attempt with kill switches engaged:

  • charged to 99%
  • removed charger
  • sent to sleep

After 22.5hrs, the charge dropped to 28%. This is around 3.16% per hour, so almost the same stats as before. And this time the device woke up with the slightly disorted screen, so it seems to have been “sleeping”. Very sad results.

1 Like

what is engaged mean? like ON or OFF?

2 Likes

Even ON or OFF is not clear. Either DOWN / UP or chip(!) electrical ON / OFF.

3 Likes

Yes, “kill switch” is both great terminology and terrible terminology.

If we didn’t call it a “kill” switch and just called it a, you know, switch, I don’t think that anyone would then be confused about the meaning of “on” and the meaning of “off”.

PS Edit: The official documentation on this point: Privacy - Purism user documentation

2 Likes

The English language is terrible, thats why i stopped learning it. It seems that Spanish is more precise in everything.
It seems that Spanish is more Precise, Clear, and Fancy than English.

3 Likes

With engaged I meant that the kill switch was used to disconnect power so it was down (kill power? yes). And yes I agree that terminology is difficult here.

1 Like

engaged means power is enabled

2 Likes

engaged means power is enabled

No. You can’t tell without taking into account the context. If a killswitch - a switch that disables power - is engaged, it effectively means that power is disabled.

Anyways, can we please stay on topic and not waste our time on this pointless discussion?

2 Likes