# Battery level indicator?

**URL:** <https://forum.clockworkpi.com/t/battery-level-indicator/13059>\
**Category:** uConsole\
**Created:** [April 19, 2024, 5:45am UTC](https://forum.clockworkpi.com/t/battery-level-indicator/13059 "2024-04-19T05:45:34Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nick\_Stevens](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/nick_stevens/32/8839_2.png) [@Nick\_Stevens](https://forum.clockworkpi.com/u/Nick_Stevens)\
**Post date:** [April 19, 2024, 5:45am UTC](https://forum.clockworkpi.com/t/battery-level-indicator/13059/1 "2024-04-19T05:45:34Z")

</div>

Hello all, how accurate is your battery level indicator? In my case the battery shuts down with no warning (and the indicator taskbar says its at about 80%). Is that normal?  
Then, if I connect the unit to the charger, the charging stops after 20 minutes or so (as indicated by my USB charge indicator). It is quite certain that the two empty batteries are not charged to full within that time. (The unit is off while charging)  
The batteries themselves should be fine - tested them on a computerized battery charger - they both have about 3200mAh, measured by a full charge - discharge cycle.  
Any fix to make the display and the charging better? Thank you for any suggestions

---

<div class="post-metadata">

**Author:** ![Snoozer94](https://avatars.discourse-cdn.com/v4/letter/s/3ec8ea/32.png) [@Snoozer94](https://forum.clockworkpi.com/u/Snoozer94)\
**Post date:** [April 19, 2024, 12:23pm UTC](https://forum.clockworkpi.com/t/battery-level-indicator/13059/2 "2024-04-19T12:23:50Z")

</div>

So this is a fix someone figured out, it helped with both faster charging and battery life for me, might be some help to you

> [@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:** ![yatli](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/yatli/32/6253_2.png) [@yatli](https://forum.clockworkpi.com/u/yatli)\
**Post date:** [April 19, 2024, 12:31pm UTC](https://forum.clockworkpi.com/t/battery-level-indicator/13059/3 "2024-04-19T12:31:11Z")

</div>

You probably need to calibrate the battery gauge. I read through the axp228 manual and added this feature to my kernel for A06/CM4.

The manual did not state HOW to calibrate thought 😂  
So I guess just:

- charge it up to 100%
- activate the calibrate function
  - echo 1 | sudo tee /sys/class/power\_supply/axp20x-battery/calibrate

- let it drain to poweroff
- charge it up again.

---

<div class="post-metadata">

**Author:** ![Nick\_Stevens](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/nick_stevens/32/8839_2.png) [@Nick\_Stevens](https://forum.clockworkpi.com/u/Nick_Stevens)\
**Post date:** [April 19, 2024, 6:13pm UTC](https://forum.clockworkpi.com/t/battery-level-indicator/13059/4 "2024-04-19T18:13:18Z")

</div>

Thank you both. I will try your suggestions. Just one (naive) question. Charging should work with the unit off, is that not the case? When off, then the kernel has no influence on charging, has it?

---

<div class="post-metadata">

**Author:** ![Schmitty](https://avatars.discourse-cdn.com/v4/letter/s/e0b2c6/32.png) [@Schmitty](https://forum.clockworkpi.com/u/Schmitty)\
**Post date:** [April 19, 2024, 6:33pm UTC](https://forum.clockworkpi.com/t/battery-level-indicator/13059/5 "2024-04-19T18:33:17Z")

</div>

I get “permission denied” when attempting to run the command.

---

<div class="post-metadata">

**Author:** ![Snoozer94](https://avatars.discourse-cdn.com/v4/letter/s/3ec8ea/32.png) [@Snoozer94](https://forum.clockworkpi.com/u/Snoozer94)\
**Post date:** [April 19, 2024, 7:41pm UTC](https://forum.clockworkpi.com/t/battery-level-indicator/13059/6 "2024-04-19T19:41:49Z")

</div>

With what i did it charges, but it might charge without it i never really tested it

---

<div class="post-metadata">

**Author:** ![yatli](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/yatli/32/6253_2.png) [@yatli](https://forum.clockworkpi.com/u/yatli)\
**Post date:** [April 20, 2024, 9:19am UTC](https://forum.clockworkpi.com/t/battery-level-indicator/13059/7 "2024-04-20T09:19:30Z")

</div>

Yes. Completely power off, then plug in. The charger will use it’s default settings.

---

<div class="post-metadata">

**Author:** ![SandDanGlokta](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/sanddanglokta/32/6101_2.png) [@SandDanGlokta](https://forum.clockworkpi.com/u/SandDanGlokta)\
**Post date:** [May 6, 2024, 5:21pm UTC](https://forum.clockworkpi.com/t/battery-level-indicator/13059/8 "2024-05-06T17:21:03Z")

</div>

I tried the calibration command. Should it discharge until it shuts off (0% which equates to 80% without calibration) or until it triggers a shutdown via software (i.e. 5%)? I did the former and upon restart it still begins recharging at 80%…. It’s recharging now. After reaching 100% will the percentage correct itself?

Another possibility, maybe the system tray is reading the incorrect battery? Bat0 “doesn’t exist,” so it’s reading something else.

---

<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 16, 2024, 9:25pm UTC](https://forum.clockworkpi.com/t/battery-level-indicator/13059/9 "2024-05-16T21:25:19Z")

</div>

I get permission denied error on the default OS on CM4 console. Is there anyway to create the “calibrate” file? I’m having the same issue that after more or less 80% the uconolse shutdowns and only turns on when changer is plugged in.

---

<div class="post-metadata">

**Author:** ![Rex](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/rex/32/16852_2.png) [@Rex](https://forum.clockworkpi.com/u/Rex)\
**Post date:** [May 17, 2024, 3:53pm UTC](https://forum.clockworkpi.com/t/battery-level-indicator/13059/10 "2024-05-17T15:53:11Z")

</div>

The calibrate functions are not present in the default os and kernel. you’ll have to recompile the kernel with the updated drivers or a different os.

---

<div class="post-metadata">

**Author:** ![Kirou](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/kirou/32/8936_2.png) [@Kirou](https://forum.clockworkpi.com/u/Kirou)\
**Post date:** [May 17, 2024, 4:32pm UTC](https://forum.clockworkpi.com/t/battery-level-indicator/13059/11 "2024-05-17T16:32:22Z")

</div>

To “calibrate” the batteries, you can also charge them an entire night (uConsole powered off) then use your U until it shut down, and re-charge it an entire night. It work for me.  
Now, my U shutdown at ~5% remaining battery displayed.
