No boot after low battery shutdowns

On a few occasions the phone battery has drained flat and consequently the phone has shut off. When I then attach the charger, the status LED comes on solid red but the phone does not power up, the phone is unresponsive to power key input (short or long press).

There is a bit of a dance required to bring it back to life, for which the novelty factor wore off after the third time.

I have since upped the battery percentage threshold at which UPower steps in and takes action to shut the phone down when the battery gets low on charge from 2 to 4%, I also upped the critical threshold from 3 to 6% otherwise there would have been a nonsensical threshold overlap.

Since adjusting the thresholds, I have let the phone battery drain flat and shutdown a few times now and after each time when I attach the charger the phone powers up without any further intervention. It seems, at least for me, that UPower’s 2% threshold is a little optimistic and the battery does not have enough juice to provide power long enough for a clean shutdown. This is with the cellular modem enabled, the wifi card enabled with bluetooth on and operational and wifi disabled in software, I’d consider the 2% threshold even more optimistic if WiFi were enabled and operational too.

UPower’s config file can be found at /etc/UPower/UPower.conf

The lines/parameters in question are…
PercentageCritical=3
PercentageAction=2

Which I changed to…
PercentageCritical=6
PercentageAction=4

And either reboot the phone or restart the UPower service (sudo service upower restart) for the changes to take effect.

or from the terminal…
sed -i -re 's/^(P.*Critical)=[0-9]/\1=6/' -e 's/^(P.*Action)=[0-9]/\1=4/' /etc/UPower/UPower.conf

sudo service upower restart

12 Likes

It happened to me also a few times that the battery drained completely and then after that it was difficult to get it started again. I was worried that it was dead forever but eventually it came to life again, I think after charging it for a really long time and then removing the battery and putting it back again, then it started. But I have a Birch device, maybe it behaves differently in some ways.

One thing I don’t understand about what you are writing is: why would it fail to start even if it failed to do a clean shutdown? I mean, even if the latest shutdown was abrupt for whatever reason, it should be able to start again when pressing the power button?

In any case, it would probably be good if someone created an issue about this at https://source.puri.sm/groups/Librem5/-/issues unless there already is one, I looked but could not find any.

2 Likes

Agreed that it should power up with no problem and certainly that would be my expectation, I have no idea why it wouldn’t. I may be incorrect in my thinking that it’s related to an unclean or interrupted shutdown, I’ve only really looked at the surface of the issue and am just guessing based on the fact that changing only the UPower action/shutdown threshold appears to avert the issue.

1 Like

Are you taking the battery out? For me the gauge goes to 0% pretty reliably and at 2% there’s more than enough juice to keep it in operation for some time - but I never take the battery out, so the battery gauge calibration doesn’t get reset.

In case this happens again, this should be the simplest way to revive it:

  • plug it in and allow it to charge for a few minutes
  • unplug
  • press and hold power button for around 16 seconds (or until green LED shines)
  • plug it back in once phosh starts

…and that’s it. The trick is to hold the power button while unplugged, but ensuring that it has enough juice in the battery for it to kick off (at which point you can plug it back in).

6 Likes

Thanks, it is possible that I never tried that when I had this problem, will try this next time. I was always assuming that having the cable connected could only help it start up.

Why does the cable need to be unplugged, what it is that happens when pressing the power button when the cable is plugged in?

1 Like

Long story short: having the power being provided via USB prevents the power button’s hard reset (the one after ~16 seconds) from functioning. It acts (almost) like cutting the battery out of the circuit, which doesn’t help when there’s external power applied.

4 Likes

I am yes, when I first encountered the issue, I…

  1. Disconnected the charger
  2. Removed the battery
  3. Reconnected the charger

At this point, the phone powered up, not wanting to pull power mid-boot, I let it fully boot then I choose the “Power Off” option from the power options and let it fully shutdown. Then I…

  1. Disconnected the charger
  2. Refitted the battery
  3. Reconnected the charger

And at that point the phone powered up again. Whether or not that full procedure was required or not, it worked for me the first time around and I stuck with it.

Thanks for this information, if I encounter the situation again I’ll give this a try. It is not an intuitive sequence to me and not something that would have occurred to me to try.

To be honest though, I’m going to stick with the threshold at 4% as it seems to avoid the situation entirely for me so far. 2% or 4% is really irrelevant to me as it’s not enough juice to do anything of any significance for any length of time.

I’m happy to accept the inconvenience of the phone shutting down a few minutes earlier so I gain the convenience of just simply attaching the charger and the phone coming back to life without any further intervention.

This also happens to me occasionally on PinePhone Mobian Phosh. I’ll have try your trick.

Way to go!

1 Like

It appears the upping of the threshold is a red herring.

A couple of days ago I deliberately let the battery drain flat over night and when I came to it in the morning it had shut off. Attaching the charger brought the status LED on solid red but the phone did not power up or respond to power key input, presenting the original issue.

Following the recommendation of @dos, I let the phone charge for a few minutes then disconnected the charger and gave a long press on power key, the phone powered up, I reattached the charger and let it fully boot. It might be worth noting that it seemed to be stuck in some sort of trickle charge state at this time as I later noticed it was taking a very long time to charge, disconnecting then reconnecting the charger seemed to right that issue.

After booting, I checked the battery status in the drop down panel from the notification area, it showed 0%, the logs indicated the last log entry was some 2 hours previous, it appeared that the battery had lost 4% charge in a powered off state in 2 hours?

Looking at the logs, there is nothing showing any attempt to shutdown, it looks like the phone had just kept going until entirely out of juice.

Messing around for the last few days, it appears that it is possible for the battery to drain flat without the phone noting any of the thresholds or taking any action, which I now suspect was my original situation.

I have observed the phone battery drain passed the 10% warning, 6% critical and 4% action states with no action been taken and no notification on the GUI or via the status LED.

I have also seen when there is a notification (GUI and/or status LED) that phone does shut down properly.

I caught it once, when the battery had drained to 0% with no notification and managed to get a charger on it just in time before shutting off, I checked systemctl status upower which came back with “active”.

I am not sure what conditions have to be satisfied to notifiy vs do nothing. The main difference I see is when the phone just goes and goes until the battery is dead, the phone has been sitting for a long time (several hours) doing nothing (screen off, no foreground applications running, only celluar modem on with mobile data enabled, WiFi/BT card enabled with HKS but both WiFi and BT disabled in software).

When is see notifications, I am either interacting with the phone at the time running applications and in the case of notifications via status LED the phone had been sat no more that 20 minutes with screen off but also had at least one foreground application running and streaming audio over bluetooth.

3 Likes