How to refresh the battery fuel meter?

Lights my screen up and makes a couple of clicking noises. (I was ssh’ing it.) The meter readings didn’t change, though.

Yes, a couple of clicking noises. The same sound you hear when you plug the charger. But I confirm: not changes on battery level.

Do you think that sound comes from the speakers? My PP makes a sound on plugging in the charger, too. It comes from the speakers to indicate charging or the plugin of the cable. Other than the speakers I would expect noises to be caused by mechanical parts. And there are basically no mechanical parts in these phones, despite HKSs.

Yes, it comes from the speakers. That is something inherited from GNOME, and if you use GNOME on a laptop you should hear the same noise when you plug in the charger :smiley:

That noise is expected, it indicates a charger was connected/disconnected. And when you restart: upower you get that noise as well.

6 Likes

Funny…I don’t think I’ve ever heard the clicking sound when I plugged the phone in. (I usually turn it off first, but not always.)

Correction: today after charging the battery until the red LED went out, the battery level was 52%. After restarting power manager it became 99%. I’ll do more testing.

4 Likes

Did you check before restart that /sys/class/…/capacity was matching to that 52%? I.e. was it upowerd just getting value out of blue or its restart actually nudged pmic driver to re-read the gauge?

No I didn’t, but I’ll check shortly.

I’ve noticed that it gives a better estimate after a reboot

That’s an effect of several wrong-doings in the battery gauge kernel driver, refreshing the gauge won’t help there (part of the problem is that it gets reset after each boot after all).

However! A kernel update that finally makes it behave as intended has just entered amber-phone-staging and should migrate to production repos in a week :slight_smile:

To answer the stated question (even if it doesn’t answer the actual problem): the gauge calibration data should get reset after taking the battery off.

7 Likes

While this is nowhere near a kernel issue, I would really like to see the battery percentage on the lock screen - so I don’t even need to unlock in order to see where charging is up to / whether charging is needed. I understand that there’s no point doing that until the percentages that are displayed where they are displayed are consistent and accurate.

4 Likes

Excellent. I’m glad to hear that!
Poor battery life together with bad level estimate is causing me many unexpected shutdowns. I believe they are not that healthy.

1 Like

/sys/class/…/capacity shows full battery 99%

Me too. I’ve already had one where I came back to find the phone shut down (don’t know whether it involuntarily died or voluntarily shut down due to low power).

1 Like

That is I question I carry around in my head for some days.

  1. Does the L5 ccurrently shutdown intentionally when energy gets low?
  2. Do we have to expect hard power offs because the L5 currently doesn’t know itself how much energy is left?
  3. How is the targeted behavior?

For comparison. My Laptop does beep sounds when energy gets low. After a couple of beeps I think it goes into some power saving state IIRC, instead of shutting down. My android shows a dialog when 10% energy is left. By 5% percent or so it shows another dialog, telling Mr its going to shut down. It does not shutdown immediately but after another while. After charging and power all apps are in the same status they where before. Probably all process data was saved in storage meanwhile.

You can estimate the level of charge using the voltage. A Li-Ion battery is empty at 3.6V and fully charged at 4.2V. From the quoted values you can see that the battery is in fact almost empty and not at 59% charge level.

1 Like

No, it dies 'cause it run out of gas.
But the problem will be solved in few days, based on this:

To clarify - it does turn off automatically on low battery; the issue is that without the kernel fixes it may not realize that the battery is low before it’s too late to act.

3 Likes

So running a simple script like the following you’d get the true battery level …

#!/bin/bash
volt1=$(upower -d | grep -m 1 voltage)
volt2="${volt1//voltage:}"
volt3="${volt2//V}"
awk “BEGIN {print ($volt3-3.6)/0.6*100}”

Nope, this just workarounds one issue (upowerd not taking changed charge_full value into account), but there are several more. You really need a fixed kernel to get proper value (at which point you’ll likely not even notice the charge_full bug anymore).

Ah wait, it uses voltages! :smiley: Then yeah, it’s kinda real, but not really accurate under load.

The fixed kernel should migrate tomorrow: https://master.pureos.net/migrations/excuse/cae9e9d1-5e41-4b0a-bfa4-3bb4f2eb707d

2 Likes

That’s what I’ve noticed. I’ve had both - sometimes there is an orderly shutdown and sometimes it has just died. It is not only the kernel that leaves it before it’s too late to act, the user also. :slight_smile:

Keenly awaiting that update …