Skip to content

Fix Light-sleep for ESP32 - #3521

Merged
thebentern merged 6 commits into
meshtastic:masterfrom
todd-herbert:fix-lightsleep
Apr 2, 2024
Merged

Fix Light-sleep for ESP32#3521
thebentern merged 6 commits into
meshtastic:masterfrom
todd-herbert:fix-lightsleep

Conversation

@todd-herbert

Copy link
Copy Markdown
Contributor

Hopefully addresses #3512

Main culprit seems to have been the addition of enableLoRaInterrupt(), which is competing with the hardware button for use of the EXT0 wake source. Using GPIO wake for the button works around this issue.

Secondary issues with ISRs on wake, and PRESS event detection have also been addressed (kludged).

Tested with Heltec Wireless Paper, however this does currently require a hotfix for #3517 to first be applied. Will be separately address soon. Briefly tested with T-Echo. All seems to be running fine, at least at first glance.

I would expect this bug to affect all ESP32 devices(?). It would be good to have the fix independently tested, if anyone has the time / energy to spare.

@todd-herbert

Copy link
Copy Markdown
Contributor Author

Seems likely that #3517 also applies to all ESP32 devices, not just Heltec Wireless Paper.

@HarukiToreda

Copy link
Copy Markdown
Contributor

I can confirm that the program button on Heltec V3 now wakes the device from PowerSave mode as it used to. Thank you.
I plugged a multimeter to see when the different states happen:
When powered on device runs at 108mA
Screen goes off after 10min and runs at 104mA
After 11min it goes to PowerSave mode at 11mA
I tested the program button once on 11mA and it wakes up back to 108mA
I restested after 15, 20, 30min and it worked everytime.

I believe you fixed it.

@thebentern
thebentern merged commit f2ed0f7 into meshtastic:master Apr 2, 2024
@todd-herbert
todd-herbert deleted the fix-lightsleep branch April 3, 2024 14:18
jeek pushed a commit to jeek/Meshtastic-Exploiteers-Hacker-Pager that referenced this pull request Jun 30, 2026
* Change wakeup source from EXT0 to GPIO

* Avoid ISR issue on wake

* Detect press from wake reason, instead of digitalRead

* Missing #ifdef

Risky phone-typed commit

* Fix PowerFSM timed transition preventing light sleep
Addresses meshtastic#3517

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: PowerFSM timed transition preventing light sleep

3 participants