Battery status icon not working

I got my uConsole the other day and on first boot with inserted batteries, it got halfway through the boot process, then died.
I plugged it into a charger, tried again, and have been using it for an hour or so, but the battery icon in the top menu bar seems to be broken.

Hovering over it makes a tooltip appear but it just says “Charging: 0%”.
If I run upower -i /org/freedesktop/UPower/devices/DisplayDevice, I get output that confirms that something is happening at least:

  power supply:         yes
  updated:              Fri 29 Sep 2023 05:29:47 PM CEST (37 seconds ago)
  has history:          no
  has statistics:       no
  battery
    present:             yes
    state:               charging
    warning-level:       none
    energy:              0.24 Wh
    energy-full:         8 Wh
    energy-rate:         0.16 W
    percentage:          3%
    icon-name:          'battery-caution-charging-symbolic'

I’ve run this command a few times and the percentage value has been slowly increasing, so something is happening indeed.
My questions:

  • How do I get the battery icon to work?
  • How did it arrive at the energy-full value of 8 Wh? Does it need to calibrate itself first?
  • How do I get this device to charge at a more reasonable rate?
1 Like

supercom32 posted something in another thread to help fix the charge speed for CM4 uConsole owners. (Click the link to visit the thread, the formatting is broken in the preview)

Thanks for the link, I hadn’t seen that thread before!
In the meantime, I found another thread about the DevTerm that offers a similar solution: Extremely Slow Battery Charging
Its battery tech is similar enough to the uConsole’s that it should still be relevant.

The values for constant_charge_current and constant_charge_current_max in the message you linked seem to be too high for the batteries I have. The datasheet for my Panasonic NCR18650B batteries give a value of 1625 mA as the max charge current, so a value of 1625000 seems more appropriate. (the kernel driver expects these to be microamperes for some reason)
I don’t know if the kernel driver expects you to multiply this value by the number of batteries in use, but I’m gonna play it safe and go with no.

Earlier, I found this: [PATCH 0/4] set battery info on AXP20X and AXP22X from DT which appears to be a kernel list discussion about the code that outputs the couldn't set constant charge current from DT message that appears in dmesg output.
In it, you can also see how it defaults to a safe charging current of 300 mA. (which is probably why the uConsole charges so slowly)
image

Also, this bit:

(the default constant current charge will still be 1500mA from powering
up the board to the driver probing unless the bootloader takes care of
it beforehand)

seems to imply that if the OS isn’t running, it defaults to 1500 mA instead. I have no idea if this is true and can’t test it because I don’t own a power meter.

I’m gonna wait for my uConsole’s battery to finish charging the slow way before I fiddle with kernel parameters because I want to see if doing so helps with calibration.

2 Likes
  • How did it arrive at the energy-full value of 8 Wh? Does it need to calibrate itself first?

I found this bit in the CM4 kernel patch: https://github.com/clockworkpi/uConsole/blob/1924163912c207fbd8f2e29927a7798f70807ce5/Code/patch/cm4/20230630/0001-patch-cm4.patch#L9149
I guess it’s just there to serve as a reasonable default, but of course will be wildly inaccurate for most batteries.

A utility that asks for your batteries’ tech specs and sets all of these values based on those would be really useful here, I think.

Oh, and I’d love it if someone could explain how the OS arrives at the energy-rate value.
If it’s supposed to be the charging wattage, it’s obviously bunk, and off by a factor of about 10.

I have an Uconsole CM4 lite version with stock OS install (with the “official” SD card) and apt update/full-upgrade.

Like in the first post, icon on desktop doesn’t change much, and I first thought my battery wasn’t working at all.

So I made the patch in udev however the battery charge is still very slow: about 7 hours for complete charge and 18650 stay very cool during the process.

Is there a recommended charger (mine is a 60W PD USB C) or parameters to optimise this? What if uConsole is turned off?

if the uconsole is turned off, it relies on the charge AXP228 controller default which is 1500mA

Also

The AXP228 has a patch…

the patch is written fro the A06 though… maybe someday someone will be a hero and port it to the cm4

Hello Samus have you found an answer to the question how do you get the battery icon to work?
Unfortunately, the icon doesn’t work correctly for me either.

On a fresh SD card install the official CW image. It’s working for me now. The image came in the box had the issue. But after few lines of it was working as well. But in the new SD card no changes were required.

Oh I never found a solution, per se, it just started working at some point.