# Battery status icon not working

**URL:** <https://forum.clockworkpi.com/t/battery-status-icon-not-working/11108>\
**Category:** uConsole\
**Tags:** battery\
**Created:** [September 29, 2023, 3:44pm UTC](https://forum.clockworkpi.com/t/battery-status-icon-not-working/11108 "2023-09-29T15:44:29Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![SamusAranX](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/samusaranx/32/3981_2.png) [@SamusAranX](https://forum.clockworkpi.com/u/SamusAranX)\
**Post date:** [September 29, 2023, 3:44pm UTC](https://forum.clockworkpi.com/t/battery-status-icon-not-working/11108/1 "2023-09-29T15:44:29Z")

</div>

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:

```txt
  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?

---

<div class="post-metadata">

**Author:** ![USFrozen](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/usfrozen/32/7065_2.png) [@USFrozen](https://forum.clockworkpi.com/u/USFrozen)\
**Post date:** [September 29, 2023, 4:36pm UTC](https://forum.clockworkpi.com/t/battery-status-icon-not-working/11108/2 "2023-09-29T16:36:21Z")

</div>

> [@SamusAranX](#):
>
> How do I get this device to charge at a more reasonable rate?

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)

> [@uConsole: How Does Charging Work?](https://forum.clockworkpi.com/t/uconsole-how-does-charging-work/10990/9):
>
> Friendly update so others can benifit: If you edit or create /etc/udev/rules.d/99-devterm-charging.rules, you can use KERNEL=="axp20x-battery", ATTR{constant\_charge\_current\_max}="2500000", ATTR{constant\_charge\_current}="2400000" to change the charging current level permanently.

---

<div class="post-metadata">

**Author:** ![SamusAranX](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/samusaranx/32/3981_2.png) [@SamusAranX](https://forum.clockworkpi.com/u/SamusAranX)\
**Post date:** [October 1, 2023, 12:22am UTC](https://forum.clockworkpi.com/t/battery-status-icon-not-working/11108/3 "2023-10-01T00:22:31Z")

</div>

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](https://forum.clockworkpi.com/t/extremely-slow-battery-charging/9978)  
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 **micro** amperes 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](https://lkml.kernel.org/lkml/20170511134221.5569-1-quentin.schulz@free-electrons.com/T/) 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](https://canada1.discourse-cdn.com/flex029/uploads/clockworkpi/original/2X/d/df05a6aa72d4c6cf010355c110045418c0f19084.png)

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.

---

<div class="post-metadata">

**Author:** ![SamusAranX](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/samusaranx/32/3981_2.png) [@SamusAranX](https://forum.clockworkpi.com/u/SamusAranX)\
**Post date:** [October 2, 2023, 3:09am UTC](https://forum.clockworkpi.com/t/battery-status-icon-not-working/11108/4 "2023-10-02T03:09:23Z")

</div>

> - 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](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.

---

<div class="post-metadata">

**Author:** ![SamusAranX](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/samusaranx/32/3981_2.png) [@SamusAranX](https://forum.clockworkpi.com/u/SamusAranX)\
**Post date:** [October 3, 2023, 7:34am UTC](https://forum.clockworkpi.com/t/battery-status-icon-not-working/11108/5 "2023-10-03T07:34:23Z")

</div>

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.

 ![IMG_9454](https://canada1.discourse-cdn.com/flex029/uploads/clockworkpi/original/2X/4/475a15ac10ae2ef6e93eb81c6cc438cc58cb8a0d.jpeg)

---

<div class="post-metadata">

**Author:** ![Illydone](https://avatars.discourse-cdn.com/v4/letter/i/838e76/32.png) [@Illydone](https://forum.clockworkpi.com/u/Illydone)\
**Post date:** [December 1, 2023, 9:26am UTC](https://forum.clockworkpi.com/t/battery-status-icon-not-working/11108/6 "2023-12-01T09:26:50Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![DeRock25](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/derock25/32/7976_2.png) [@DeRock25](https://forum.clockworkpi.com/u/DeRock25)\
**Post date:** [February 25, 2024, 2:44am UTC](https://forum.clockworkpi.com/t/battery-status-icon-not-working/11108/7 "2024-02-25T02:44:35Z")

</div>

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

Also

The AXP228 has a patch…

> [@Axp228: properly report energy/power readings](https://forum.clockworkpi.com/t/axp228-properly-report-energy-power-readings/9318):
>
> The AC adapter now shows up in power management apps Instead of reporting 8Wh total energy, it now reads customizable battery full energy from devicetree. … which allows better remaining time estimation Device current energy logic is also updated. Reports current power rate, no more upowerd warnings about “battery discharging at -0.000000W” Exposes sysfs node `/sys/class/power\_supply/axp20x-battery/calibrate Write 1 to the file to initiate battery full capacity calibration Read from the f…

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

---

<div class="post-metadata">

**Author:** ![Simon\_Moon](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/simon_moon/32/7475_2.png) [@Simon\_Moon](https://forum.clockworkpi.com/u/Simon_Moon)\
**Post date:** [May 7, 2024, 1:22pm UTC](https://forum.clockworkpi.com/t/battery-status-icon-not-working/11108/8 "2024-05-07T13:22:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![aloksandal](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/aloksandal/32/8035_2.png) [@aloksandal](https://forum.clockworkpi.com/u/aloksandal)\
**Post date:** [May 9, 2024, 2:34pm UTC](https://forum.clockworkpi.com/t/battery-status-icon-not-working/11108/9 "2024-05-09T14:34:11Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![SamusAranX](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/samusaranx/32/3981_2.png) [@SamusAranX](https://forum.clockworkpi.com/u/SamusAranX)\
**Post date:** [May 9, 2024, 3:01pm UTC](https://forum.clockworkpi.com/t/battery-status-icon-not-working/11108/10 "2024-05-09T15:01:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ivanDPC](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/ivandpc/32/10198_2.png) [@ivanDPC](https://forum.clockworkpi.com/u/ivanDPC)\
**Post date:** [December 27, 2024, 11:52pm UTC](https://forum.clockworkpi.com/t/battery-status-icon-not-working/11108/11 "2024-12-27T23:52:19Z")

</div>

> [@SamusAranX](#):
>
> upower -i /org/freedesktop/UPower/devices/DisplayDevice

Hello!

Excuse me, i’m new with the Uconsole and i have te same problem with the battery indicator.

How you run this “u power-i”? Where can i find it? It’s an app??

Thanks a lot!
