# uConsole: How Does Charging Work?

**URL:** <https://forum.clockworkpi.com/t/uconsole-how-does-charging-work/10990>\
**Category:** uConsole\
**Created:** [September 20, 2023, 3:10am UTC](https://forum.clockworkpi.com/t/uconsole-how-does-charging-work/10990 "2023-09-20T03:10:35Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![Dezorian](https://avatars.discourse-cdn.com/v4/letter/d/df788c/32.png) [@Dezorian](https://forum.clockworkpi.com/u/Dezorian)\
**Post date:** [October 1, 2023, 2:17pm UTC](https://forum.clockworkpi.com/t/uconsole-how-does-charging-work/10990/22 "2023-10-01T14:17:48Z")

</div>

This works for me BUT you need to make sure the three definitions are on a new line. So the file `/etc/udev/rules.d/99-devterm-charging.rules` should look like this. Then, after a reboot my amps went from 0,7A to almost 2A

```auto
KERNEL=="axp20x-battery",
ATTR{constant_charge_current_max}="2500000", 
ATTR{constant_charge_current}="2400000" 

```

---

<div class="post-metadata">

**Author:** ![Dezorian](https://avatars.discourse-cdn.com/v4/letter/d/df788c/32.png) [@Dezorian](https://forum.clockworkpi.com/u/Dezorian)\
**Post date:** [October 1, 2023, 5:03pm UTC](https://forum.clockworkpi.com/t/uconsole-how-does-charging-work/10990/23 "2023-10-01T17:03:20Z")

</div>

For me the change above also changed the offline charging behavior. So for charging faster both online and offline, you will need this udev change.

---

<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, 5:47am UTC](https://forum.clockworkpi.com/t/uconsole-how-does-charging-work/10990/24 "2023-10-03T05:47:49Z")

</div>

Individual rules in udev rules files **must** be on a single line or they’re not parsed and applied correctly. Whatever your udev rule is doing is not what you think it’s doing.

---

<div class="post-metadata">

**Author:** ![Dezorian](https://avatars.discourse-cdn.com/v4/letter/d/df788c/32.png) [@Dezorian](https://forum.clockworkpi.com/u/Dezorian)\
**Post date:** [October 3, 2023, 6:51am UTC](https://forum.clockworkpi.com/t/uconsole-how-does-charging-work/10990/25 "2023-10-03T06:51:30Z")

</div>

Yes, that is what I said…

---

<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, 6:55am UTC](https://forum.clockworkpi.com/t/uconsole-how-does-charging-work/10990/26 "2023-10-03T06:55:10Z")

</div>

Your rules file is nonsensical. That anything regarding the charging current changed is a coincidence.

---

<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:** [October 3, 2023, 3:55pm UTC](https://forum.clockworkpi.com/t/uconsole-how-does-charging-work/10990/27 "2023-10-03T15:55:08Z")

</div>

Yeah the ATTR lines in this rule would likely be ignored in this case and the change is probably from some default value being used. We can test this two ways

1. Use `udevadm` to check the udev rules that are applied to the device  
See [udev - ArchWiki](https://wiki.archlinux.org/title/udev) for usage examples

2. Comment out or remove the ATTR lines and see if performance changes. No change means the ATTR lines were not doing anything

---

<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:** [October 4, 2023, 2:42am UTC](https://forum.clockworkpi.com/t/uconsole-how-does-charging-work/10990/28 "2023-10-04T02:42:28Z")

</div>

hmm what I understand is that three rules are introduced:

1. Match the axp228 module, and do nothing
2. Anything with a `constant_charge_current_max`, set to 2500000
3. Anything with a `constant_charge_current`, set to 2400000

… which kinda works correctly in this case?

---

<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:** [October 4, 2023, 8:31pm UTC](https://forum.clockworkpi.com/t/uconsole-how-does-charging-work/10990/29 "2023-10-04T20:31:27Z")

</div>

Well since this is a place of learning, LETS FIND OUT WHAT WORKS!

---------Testing Methodology------------

- rebooted uConsole after each change
- measurement taken after reboot, uConsole power **ON**
- fresh uConsole image (official)
- in-line USB meter readings constantly change, 3 samples taken at about 10s intervals & averaged
- Starting battery charge level reported by uConsole: 72%

**NOTE** : all tests done with same Amazon Basics 5v 2a wall wart and USB A to C cable because I dont have a C to C in-line USB tester to try a higher power TypeC charger

---------------RESULTS-------------------  
Testing @supercom32’s version first

1. Default (no charging rules file)  
4.77v 3.968w 0.80a
2. Empty file (no rules)  
No Change 4.75v 4.101w 0.84a
3. Rule added `KERNEL=="axp20x-battery"`  
No Change 4.81v 4.012w 0.85a
4. Rule changed: `KERNEL=="axp20x-battery", ATTR{constant_charge_current_max}="2500000"`  
No Change 4.72v 3.877w 0.82a
5. Rule changed: `KERNEL=="axp20x-battery", ATTR{constant_charge_current_max}="2500000", ATTR{constant_charge_current}="2400000"`  
**4.69v 6.284w 1.33a**

* * *

Testing @Dezorian’s version

1. Default (no charging rules file)  
4.78v 4.120w 0.86a
2. Empty file (no rules)  
No Change 4.74v 4.087w 0.81a
3. Rule added `KERNEL=="axp20x-battery"`  
No Change 4.79v 4.133w 0.85a
4. Rule added on new line: `ATTR{constant_charge_current_max}="2500000"`  
No Change 4.82v 4.069w 0.84a
5. Rule added on new line: `ATTR{constant_charge_current}="2400000"`  
**4.72v 6.701w 1.41a**  
NOTE: This method was consistently slightly higher while charging on my uConsole than supercom32’s method.

* * *

Testing each rule by itself

1. Default (no charging rules file)  
4.79v 3.988w 0.79a
2. Empty file (no rules)  
No Change 4.80v 4.010w 0.82a
3. Rule added `KERNEL=="axp20x-battery"`  
No Change 4.91v 4.107w 0.87a
4. Removed last rule, added rule: `ATTR{constant_charge_current_max}="2500000"`  
No Change 4.92v 4.32w 0.90a
5. Removed last rule, added rule: `ATTR{constant_charge_current}="2400000"`  
No Change 4.87v 4.28w 0.84a
6. Looks like both ATTR are needed for this to work. Edited file like so: `ATTR{constant_charge_current_max}="2500000",`  
`ATTR{constant_charge_current}="2400000"`  
**4.71v 6.782w 1.45a**

* * *

Conclusion:  
Both ways work, and the uConsole takes longer to reboot than I would like. Will def just reload the udev rules for testing next time im playing with this myself, but wanted to make sure there was no interference in the testing im sharing here.

@SamusAranX you may be interested in these findings too 😃

---

<div class="post-metadata">

**Author:** ![supercom32](https://avatars.discourse-cdn.com/v4/letter/s/eb8c5e/32.png) [@supercom32](https://forum.clockworkpi.com/u/supercom32)\
**Post date:** [October 8, 2023, 2:42am UTC](https://forum.clockworkpi.com/t/uconsole-how-does-charging-work/10990/30 "2023-10-08T02:42:07Z")

</div>

Slightly off topic:

Just so that everyone can benefit, I just realised that while installing the black power button is ascetically pleasing, it’s really is a beginners trap! I had no idea that there were power and charging LEDs under the button (which is why they provide a clear button option). Since the manual didn’t mention anything about it, I assumed the white buttons was for the other uConsole color scheme.

So if you want to see your power status and charge status, you need to use the white button. Unfortunately, since it’s buried under the entire main-board assembly, you’ll need to take the unit completely apart to access it. So save yourself the trouble and just use it from the start if you want all your LED indicators to be visible.

---

<div class="post-metadata">

**Author:** ![hzykiss](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/hzykiss/32/6673_2.png) [@hzykiss](https://forum.clockworkpi.com/u/hzykiss)\
**Post date:** [October 8, 2023, 3:17am UTC](https://forum.clockworkpi.com/t/uconsole-how-does-charging-work/10990/31 "2023-10-08T03:17:44Z")

</div>

Is the modification valid only for the CM4 version? Is the modification applicable to the A06 version?

---

<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:** [October 9, 2023, 4:01pm UTC](https://forum.clockworkpi.com/t/uconsole-how-does-charging-work/10990/32 "2023-10-09T16:01:08Z")

</div>

Barry checked this rule change on the A06 and didn’t see any appreciable benefit. Here is a link to his post earlier in this thread:

> [@uConsole: How Does Charging Work?](https://forum.clockworkpi.com/t/uconsole-how-does-charging-work/10990/15):
>
> This udev rule doesn’t seem to change anything on the A06.

---

<div class="post-metadata">

**Author:** ![scyto](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/scyto/32/8200_2.png) [@scyto](https://forum.clockworkpi.com/u/scyto)\
**Post date:** [October 10, 2023, 11:01pm UTC](https://forum.clockworkpi.com/t/uconsole-how-does-charging-work/10990/33 "2023-10-10T23:01:00Z")

</div>

> [@USFrozen](#):
>
> `ATTR{constant_charge_current_max}="2500000",`  
> `ATTR{constant_charge_current}="2400000"`

Thanks this worked on my CM4  
(Assuming i can trust cat /sys/class/power\_supply/axp20x-battery/constant\_charge\_current)

hmm maybe this is better  
alex@uConsole:~ $ cat /sys/class/power\_supply/axp20x-battery/uevent  
POWER\_SUPPLY\_NAME=axp20x-battery  
POWER\_SUPPLY\_TYPE=Battery  
POWER\_SUPPLY\_PRESENT=1  
POWER\_SUPPLY\_ONLINE=1  
POWER\_SUPPLY\_STATUS=Charging  
POWER\_SUPPLY\_VOLTAGE\_NOW=4173000  
POWER\_SUPPLY\_CURRENT\_NOW=680000  
POWER\_SUPPLY\_CONSTANT\_CHARGE\_CURRENT=2400000  
POWER\_SUPPLY\_CONSTANT\_CHARGE\_CURRENT\_MAX=2400000  
POWER\_SUPPLY\_HEALTH=Good  
POWER\_SUPPLY\_VOLTAGE\_MAX\_DESIGN=4200000  
POWER\_SUPPLY\_VOLTAGE\_MIN\_DESIGN=3300000  
POWER\_SUPPLY\_CAPACITY=85  
POWER\_SUPPLY\_ENERGY\_FULL=8000000  
POWER\_SUPPLY\_ENERGY\_NOW=7500000

---

<div class="post-metadata">

**Author:** ![trisweb](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/trisweb/32/7069_2.png) [@trisweb](https://forum.clockworkpi.com/u/trisweb)\
**Post date:** [November 30, 2023, 3:19am UTC](https://forum.clockworkpi.com/t/uconsole-how-does-charging-work/10990/34 "2023-11-30T03:19:13Z")

</div>

If anyone is looking through this thread wondering how to just fix the charging current and speed up charging, here’s a canonical one-liner to make it happen:

Run:

`echo 'KERNEL=="axp20x-battery", ATTR{constant_charge_current_max}="2200000", ATTR{constant_charge_current}="2000000"' | sudo tee /etc/udev/rules.d/99-uconsole-charging.rules`

And reboot.

Note that I’ve chosen a slightly lower current to balance heat with speed. Tune as desired.

---

<div class="post-metadata">

**Author:** ![supercom32](https://avatars.discourse-cdn.com/v4/letter/s/eb8c5e/32.png) [@supercom32](https://forum.clockworkpi.com/u/supercom32)\
**Post date:** [December 2, 2023, 7:44pm UTC](https://forum.clockworkpi.com/t/uconsole-how-does-charging-work/10990/35 "2023-12-02T19:44:51Z")

</div>

Perhaps if someone has the ability, we can simply update the core OS image to have these settings set by default to something sane. This would basically eliminate this whole topic all together. 😃

---

<div class="post-metadata">

**Author:** ![JGUI\_Janusz\_Gerszber](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/jgui_janusz_gerszber/32/9668_2.png) [@JGUI\_Janusz\_Gerszber](https://forum.clockworkpi.com/u/JGUI_Janusz_Gerszber)\
**Post date:** [June 17, 2024, 9:16am UTC](https://forum.clockworkpi.com/t/uconsole-how-does-charging-work/10990/36 "2024-06-17T09:16:56Z")

</div>

trisweb \> It works. Now I see over 2.000mA in charging. But when battery got 100% it is not stopping to charge, still 2.000mA. Is it safe at all?!

---

<div class="post-metadata">

**Author:** ![trisweb](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/trisweb/32/7069_2.png) [@trisweb](https://forum.clockworkpi.com/u/trisweb)\
**Post date:** [June 17, 2024, 1:31pm UTC](https://forum.clockworkpi.com/t/uconsole-how-does-charging-work/10990/37 "2024-06-17T13:31:27Z")

</div>

Yes, most likely fine. The charging circuitry is embedded, so the logic for charging the battery correctly is baked in. It’s most likely just not fully complete with its cycle despite reading 100%. Most Lithium Ion chargers will switch to a constant-voltage mode to top up the battery to the right level, sometimes for a long time, before being completely finished.

---

<div class="post-metadata">

**Author:** ![Anmol\_Pandey](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/anmol_pandey/32/9279_2.png) [@Anmol\_Pandey](https://forum.clockworkpi.com/u/Anmol_Pandey)\
**Post date:** [June 26, 2024, 10:27am UTC](https://forum.clockworkpi.com/t/uconsole-how-does-charging-work/10990/38 "2024-06-26T10:27:26Z")

</div>

by the way i was just wondering, What if we increase the value to be more than 2500000 then will it increase the charging speed or will it explode in my hand.

And if we can increase it then till what value it will be safe

---

<div class="post-metadata">

**Author:** ![mikeschnier](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/mikeschnier/32/9697_2.png) [@mikeschnier](https://forum.clockworkpi.com/u/mikeschnier)\
**Post date:** [June 26, 2024, 11:56am UTC](https://forum.clockworkpi.com/t/uconsole-how-does-charging-work/10990/39 "2024-06-26T11:56:26Z")

</div>

I believe that 2.2 amps is the most current that the axp228 can actually supply. [AXP228\_PMU\_Power\_Product\_X-Powers](http://www.x-powers.com/en.php/Info/product_detail/article_id/31)

Your batteries should have a spec sheet which lists the maximum charge and discharge they are rated for.

---

<div class="post-metadata">

**Author:** ![alpixdotro](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/alpixdotro/32/11107_2.png) [@alpixdotro](https://forum.clockworkpi.com/u/alpixdotro)\
**Post date:** [March 17, 2025, 10:18pm UTC](https://forum.clockworkpi.com/t/uconsole-how-does-charging-work/10990/40 "2025-03-17T22:18:24Z")

</div>

Can anyone provide me a rollback to get back to factory defaults ?  
I did the solution provided by @trisweb , but I feel like the uConsole is kind of hot.

This is what I applied:  
echo ‘KERNEL==“axp20x-battery”, ATTR{constant\_charge\_current\_max}=“2200000”, ATTR{constant\_charge\_current}=“2000000”’ | sudo tee /etc/udev/rules.d/99-uconsole-charging.rules

---

<div class="post-metadata">

**Author:** ![trisweb](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/trisweb/32/7069_2.png) [@trisweb](https://forum.clockworkpi.com/u/trisweb)\
**Post date:** [March 17, 2025, 11:15pm UTC](https://forum.clockworkpi.com/t/uconsole-how-does-charging-work/10990/42 "2025-03-17T23:15:38Z")

</div>

You can reduce it down significantly by tweaking those numbers.

Try setting both to `1000000` for half rate, or `500000` for 1/4 - I believe it was originally around 500000.

Quick command:

```auto
echo 'KERNEL=="axp20x-battery", ATTR{constant_charge_current_max}="1000000", ATTR{constant_charge_current}="1000000"' | sudo tee /etc/udev/rules.d/99-uconsole-charging.rules

```

[Previous page](https://forum.clockworkpi.com/t/uconsole-how-does-charging-work/10990.md?page=1)

[Next page](https://forum.clockworkpi.com/t/uconsole-how-does-charging-work/10990.md?page=3)
