Fixed hibernate / poweroff for BLE companions and repeaters to stay at uA#2895
Conversation
…-202607 Io t thinks m cdev fixed poweroff to u a 202607 meshcore-dev#2895
|
Yes, this was definitely necessary ... it's a lot cleaner now |
Merge pull request meshcore-dev#2895 from IoTThinks/MCdev-Fixed-poweroff-to-uA-20…
|
I think I might have been a little too fast to merge this ... Seems all the boards are not refactored yet ... Since _display-turnOff() and radio_driver.powerOff() have been moved away of UITask(), now on those boards that have not been refactored, display and radio will not be turned off :( I think I'll add them back, to give time for all the boards to be updated |
By right, in this PR, _board->turnOff() will turn off display, radio, MCU and GPS. BTW, it is no harm to have _display-turnOff() and radio_driver.powerOff() besides _board->turnOff() in BLE companions. |
|
Did not see that for techo it was at the start (was seeking it at
bottom, where it should be)
So maybe all the boards are covered ...
Nevertheless I think for now it's better to have display and lora shut
down from ui_task
…On Mon Jul 6, 2026 at 10:31 AM AST, IoTThinks wrote:
IoTThinks left a comment (meshcore-dev/MeshCore#2895)
> Since _display-turnOff() and radio_driver.powerOff() have been moved away of UITask(), now on those boards that have not been refactored, display and radio will not be turned off :(
By right, in this PR, _board->turnOff() will turn off display, radio, MCU and GPS.
Which boards are missing?
|
|
Yah, it is fine. |
Upstream dev: b40968a..fec88e1 (9 commits) - a92046b Put powerOff and enterDeepSleep to ESP32Board - 73b7367 Put powerOff to NRF52Board - 7d7de88 board->powerOff() is sufficient to power off radio, display, GPS and components - eec75ea Cleanup Poweroff for NRF52 boards - 6b205da Added missing driver/rtc_io.h - 35f654c Fixed hibernate/powerOff for ESP32 boards to stay at uA - 9e66a2e Merge pull request meshcore-dev#2895 (poweroff fixes) - 3ee2f77 restore display and radio poweroff in ui - fec88e1 fix tenstar c3 repeater build Integration work: - Squash merge of all MQTT additions from origin/main - Resolved CommonCLI.cpp conflict: kept origin/main version (no new upstream fields) - Removed firmware binaries from webflasher/ - Added missing gitignore patterns for webflasher/, .build-test/, *.bin All MQTT additions preserved.
|
@IoTThinks @fdlamotte I noticed that |
|
@Quency-D Due to a bug in this (my) PR, T-echo of @fdlamotte can only sleep at 1mA instead of 1uA, so he added back radio_driver.powerOff() to UITask.cpp. |
|
Thanks for the clarification. That makes sense as a temporary workaround for the T-Echo. Once #2906 is merged into dev, I’ll retest the Heltec RC32. If the duplicated radio_driver.powerOff() call is removed, I expect the shutdown current to return to the lower level I measured before. So for now, keeping it temporarily is fine. |
|
#2906 is now merged other variants than t-echo needs to get the same fix (shutdown global peripherals before variant ones) I'll do this in the morning ... |
|
@Quency-D @IoTThinks @entr0p1 I wonder if we could unify the shutdown procedures (with and without power management)
|
|
For me, as long as the default methods can shutdown MCU, LoRa, OLED and GPS at parent boards, then it is fine for me. There will be less work at the child boards for new variants to power off properly (mainly LEDs, Buzzers...) which consume little powers even when forgetting to off them. |
|
now removed duplicate call to display and radio poweroff in #2976 |
I've already been doing this but looks like I've been beaten to the punch :) The new power management code isnt gated; its on all nRF52840 now, just disabled unless the user turns it on. Shutdown path is unified. There is a central powerOff() in nRF52Board that redirects to the new functions to maintain compatibility for UITask and CommonCLI's calls to it. The flow is:
I've already cleaned up all the different iterations of powerOff overrides, initiateShutdown, variant_shutdown and its all in one tidy place. Much of the stuff duplicated across boards has also been centralised as well. Every board tested so far is reading nanoamps in off state. |
|
@entr0p1 nice ! as you've wrote the powermgmt stuff for nrf52 you're the best choice for getting it all sorted out do you have a PR so I can review and merge it ? |
|
@fdlamotte I do have a PR, but I've marked it back to a draft so I can run the board shutdown tests and rebase onto the latest dev commits: #2088 Funnily enough the recent merged commits have gotten some things over the line that I wanted to do in the PR, but avoided since it was already a pretty big commit :) I just need to retrofit it all together now. @IoTThinks has been especially integral to all things power management (and the testing) so I'll ensure none of that gets lost in translation to the final version. The latest build is being tested by some folks in the thread, and the boards I've ordered to test the shutdown and recovery have mostly arrived so I'll be working through the bench tests this weekend. Edit: The draft commit is far from what it is now by the way, so probably worth saving your energy til I push the updated one. |
Hi all,
This is another big PR to fix hibernate / poweroff for BLE companions and repeaters to stay at uA. E.g: Heltec v4 is at 13uA (not mA).
When hibernating / powerOff, the device with 3000 mAh should last months or even years.
Current situations in hibernating / poweroff:
The proposed PR:
I have tested with common boards in our lab.
However, you are welcome to test the PR for your boards.
Have a great day.