Added PowerSaving for all ESP32-based repeaters#1687
Added PowerSaving for all ESP32-based repeaters#1687IoTThinks wants to merge 9 commits intomeshcore-dev:devfrom
Conversation
|
Still need to fix for those TBeam boards. |
|
@towerviewcams Here you go. This PR should be for ESP32-based repeaters only.
Testing steps for ESP32-based repeaters
Please help to test. |
|
For Heltec v4, when doing "start ota", the current may jump to ...750mA then down to 124mA. It should be ok for battery. |
|
+1 testing atm |
|
V4 testing on two boards results: *fresh flash 1.13 firmware, powersaving delay is 22 seconds, then drops to 11.6mA sleep. I have also verified that the receiver sensitivity remains normal with my lab test companion set to -9 power and the V4 has rssi of my test signals at -117 setup in a RF cage (normal RX level for V4 in my test cage). Also checked to make sure GC1109 has power on VCC pin full time-yes. So the LNA is always on. Now running live on the mesh here in Oregon USA. repeating packets normally working good. Next for Rak! **Update |
|
There is a chance that rtc_gpio_hold_dis will release this pin P_LORA_PA_EN to its default state which is off. May want to put the rtc_gpio_hold_dis function after setting the pin. There could be an extremely short blip on waking up after deep sleep that may not really show too much during testing but is not ideal. pinMode(P_LORA_PA_EN, OUTPUT); The esp32 docs are not super clear on this rtc_gpio_hold_dis function and may be missing some detail that the gpio_hold_dis function had Discussion about it here. |
|
@beachmiles This is required in deepsleep as I understand. rtc_gpio_hold_dis This PowerSaving uses light sleep. |
|
Initial testing on this firmware is very good with VERY low power usage during sleep (6.7mA at 5.095V / 34.2 mW) and its extremely quick in going back to sleep after handling traffic. The bright white LED is still flashing during communication which it ideally wouldn't be doing while in powersave. Otherwise you'd have to put the check in each of the onBeforeTransmit functions in all of the variants cpp files. Save a little bit of juice and reducing this small current spike during TX could help keep the PA voltage a bit more steady giving slightly better TX performance? |
|
@beachmiles can you remove the led on code and measure the power difference? If it's small then chasing this down might not be worth it; if it's significant then this is important |
I remove the current limit resister on all my boards. Might be a small amount but why have a light show in a sealed box that no one can see. Buy areas like Oregon is now the benefit is a bit more then slow areas. |
Will try to see if I can compile it with it off and do some testing. I am not only concerned about saving a tiny bit of power but also ensuring there is no VCC / 3.3V voltage drop with the bright LED on why transmitting as that same rail is used by the PA chip which could degrade its TX signal strength. |
|
@towerviewcams @beachmiles Likely very minimum power saved if turn off led after TX.
It makes sense.
Let me see if the code can access powersaving_flag. |
|
Excuse my continued editing of this post. My original findings were bad as I was disabling the PA as well as the LED so was seeing way better power savings with the PA off. I couldn't easily access the powersaving_flag inside RadioLibWrappers.cpp so I just commented out the LED turning on in HeltecV4Board.cpp and built and flashed to my v4. With the LED on during TX I am seeing ~3.5W spikes that drops the voltage from my 5V usb power supply from 5.09V all the way down to 4.78V. Edit 3. @mikecarper Having the LED turned off lowers this TX peak to 3.35W and the 5.09V voltage dropping to 4.83V. Im guessing the onboard 3.3V regulator is handling this voltage drop without its 3.3V output dropping too far, but Im fairly sure its 3.3V output is not going to be steady during these short blasts of the LED which could slightly decrease the PA signal strength. Maybe this powersaving flag could be a uint8 instead of a bool so you could set different levels of powersaving for folks that want LEDs flashing and still have decent powersaving. I def love LEDs when I am debugging/troubleshooting but not when its sealed inside a box powered by a battery. This is the build I finally got working with only 1 line commented out that turns on the LED on the heltec v4 variant. |
|
The savings here are significant. Great find @beachmiles. With powersaving on, led off makes a lot of sense; I don't think we need to make a setting here. If you want blinking lights just turn powersaving off. |
|
I am willing to off the led in powersaving on. BTW, if this is bad not because of power consumption but because of the voltage drop during TX. |
|
@Theo-Marshall Thanks a lot for your testing. |
|
@mikecarper @beachmiles Confirmed having lower voltage drop via USB cable when LED is on. Measured by realtime usb monitor. So I suggest we or any friends here propose a way to turn off LED for all boards in all modes instead of just in powersaving mode. Many boards have this features. RAK4631 does not have it. |
|
@IoTThinks Hi, my apologies on a little confused. Some places say seeed esp32s3 + WIO works, some say it works with a pin hack. Some say its not working. Any chance I can get an update or eta (no hack). |
|
@basiccode12 This new PR requires no pin hack / change for Xiao Wio S3 combo. You may try the bin here. https://github.com/IoTThinks/EasySkyMesh/releases/tag/PowerSaving13 Please note Xiao S3 (non Wio) + Wio Sx1262 is different. |
Thanks!, 66mA for 2 mins then to 9mA on a 30 pin connector type. Went straight back to sleep after repeat. |
|
@basiccode12 All esp32 repeaters will wakeup every 30 minutes to check if to send adverts. Last version, periodically adverts were sent correctly. This version sleep after a few cycles after wakeup. Let me monitor the adverts. |
|
@basiccode12 So your board is Xiao Wio S3. Does it show battery percentage? |
|
@IoTThinks I have 4 repeaters running on PS14.1......Two are 4.2 boards and two are 4.3 boards. I can confirm that all of these had reset issues prior and now, DO NOT have any reset issues. running for days. Very nice |
|
Mine is running for over a day now, and no restarts so far. V4.2. upd: two days in, all good despite being deep-frozen - I'm simulating winter for an outside setup. Had to reset it due to temp sensor getting stuck at 0° С. |
|
@towerviewcams @terminalvelocity23 I haven't changed anything for PowerSaving code. :) I guess some "reset" bug in MC 1.14 has been fixed or there is some "reset" bug in dev branch. |
|
I just upgrade my tree node today to a V4.2 and firmware 14.1. I'll let you
know if I see a reboot on it or not (only 2h in so far).
…On Wed, Apr 1, 2026 at 7:53 PM IoTThinks ***@***.***> wrote:
*IoTThinks* left a comment (meshcore-dev/MeshCore#1687)
<#1687?email_source=notifications&email_token=ASMB24KVCWGYV6PHHNL6H334TXI3VA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIMJXGQZDQNRSGM2KM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJNLQOJPWG33NNVSW45C7N5YGK3S7MNWGSY3L#issuecomment-4174286234>
@towerviewcams <https://github.com/towerviewcams> @terminalvelocity23
<https://github.com/terminalvelocity23> I haven't changed anything for
PowerSaving code. :)
Let's monitor the reset issue for a while.
I guess some "reset" bug in MC 1.14 has been fixed or there is some
"reset" bug in dev branch.
Good to have the "powerlog" CLI, just in case.
—
Reply to this email directly, view it on GitHub
<#1687?email_source=notifications&email_token=ASMB24KVCWGYV6PHHNL6H334TXI3VA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIMJXGQZDQNRSGM2KM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJNLQOJPWG33NNVSW45C7N5YGK3S7MNWGSY3L#issuecomment-4174286234>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASMB24NZFZU2BN4RS3UMCBL4TXI3VAVCNFSM6AAAAACVBSMOL2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DCNZUGI4DMMRTGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
@IoTThinks I'll try to build it off main with your patches and mine, too. |
|
@terminalvelocity23 Go ahead. |
|
@IoTThinks I was running the main branch + your diff and after a little more then 24 hours it was reset. Fortunately I now got the Powerlog 😅 Last reset reason: Interrupt watchdog reset Hope this can help ;) |
|
@fizzyfuzzle Great. Please help to try this firmware to see if there is any reset in the same position. |
|
@IoTThinks I flashed your new firmware let's see if it works 👌 |
|
@IoTThinks It just restarted again but now with a different powerlog: Last reset reason: Panic / exception reset |
|
Mine restarted too, with a "Panic / exception reset". Built it from main with that diff above applied + PR #1954 and some run-once additions by myself. |
|
@fizzyfuzzle @terminalvelocity23 It is actually a progress for the rare case. |
|
@IoTThinks Sounds like boards are still restarting so I wont flash this. |
|
@IoTThinks Just in case you haven't seen this. I've never tried using the onboard jtag on the esp32-s3 but it evidently is decent and works with platform io. |
|
@beachmiles Yes, I know about these fatal errors. Sometimes it is harder to replicate than fix the rare to happen errors. BTW, I'm quite interested in how MeshCore network can survive against spammers. |
|
I have a V4.2 repeater running powersaving 14.1 Mar-29 build and it has reset twice in 3 days. So the behavior does seem to still be present. |
|
@AI7NC I'm doing the spam test against the fix now for Heltec v4.2. |
|
Yes I can confirm that despite the resets, the auto-adverts are still
working and the time is still correct.
…On Sun, Apr 5, 2026 at 12:57 AM IoTThinks ***@***.***> wrote:
*IoTThinks* left a comment (meshcore-dev/MeshCore#1687)
<#1687 (comment)>
@AI7NC <https://github.com/AI7NC> I'm doing the spam test against the fix
now for Heltec v4.2.
Meanwhile, the time is still correct and advert is still continue to run.
—
Reply to this email directly, view it on GitHub
<#1687 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASMB24PGBBIW5LMXN4CKRBL4UIGWPAVCNFSM6AAAAACVBSMOL2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DCOBYGQ4TAMRQGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Here's my config. set prv.key 'key' |
|
@terminalvelocity23 My new fix servived 60 K MeshCore requests. I will test another 60K requests tomorrow. Your CLI commands look "harmless" (no impact). |
|
@IoTThinks good, because my repeater has crashed again. Panic / exception reset. |
|
I have a esp32c6 repeater that's been rock solid with an uptime of 38 days currently. |
|
@terminalvelocity23 @fizzyfuzzle @AI7NC Please help to test this. I have tested it with 3 spammers (MeshCore companion usb). |
|
@IoTThinks flashing now. |
Is this for Heltec hardware V4.2 or hardware V4.3? |
14.1 has always covered both boards. I'm testing both at the house. so far so good at about 9 hours |
|
Ok, my home repeater is running 14.1 4/6 build |
|
@AI7NC The bin file PS14.1 is for both Heltec 4.2 and 4.3. On Heltec 4.2, set radio.fem.rxgain on/off will return not supported |


Hi friends,
This is the cleanup PR for this old PR #1353
The changes are below:
I have tested with RAK4631, Heltec v3, Heltec v4 and Heltec V4 with ESPNOW.
I will set this as Draft to see if I miss anything and let all of my repeaters to run for a while.
Thanks a lot and have a nice day.