fix: device sleep (part 1) - #3590
Merged
Merged
Conversation
thebentern
approved these changes
Apr 10, 2024
mverch67
marked this pull request as draft
April 11, 2024 06:25
mverch67
marked this pull request as ready for review
April 11, 2024 10:30
Collaborator
Author
|
Tested with tbeam, t3s3, heltec v3 and heltec wireless paper. Now all wake up from router mode. In case you still experience issues in sleep mode (e.g unresponsive, noise) you'll have to do a factory reset, there may be some wrong setting. |
Collaborator
Author
mverch67
marked this pull request as draft
April 11, 2024 12:01
mverch67
marked this pull request as ready for review
April 11, 2024 14:16
thebentern
reviewed
Apr 12, 2024
| #endif | ||
| #ifdef RF95_IRQ | ||
| gpio_wakeup_enable((gpio_num_t)RF95_IRQ, GPIO_INTR_HIGH_LEVEL); // RF95 interrupt, active high | ||
| #if defined(RF95_IRQ) && (RF95_IRQ != RADIOLIB_NC) |
Contributor
There was a problem hiding this comment.
Good call. Technically we have targets like the T-Beam that have RF95 macros for the SX1276 and also SX126X ones, so runtime discrimination probably heads off some potential issues there hopefully.
Collaborator
Author
There was a problem hiding this comment.
yes, I've tested that already. Working as expected.
jeek
pushed a commit
to jeek/Meshtastic-Exploiteers-Hacker-Pager
that referenced
this pull request
Jun 30, 2026
* fix sleep part 1 * always show wakeup reason in debug log * fix screen turn on issue * avoid unnecessary reboot when entering light sleep * set DIO1 based on radio type --------- Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes some issues introduced in #3251 (e.g. router/repeater/powersave wakeup issues) and does a few debug cosmetics:
The function enableLoraInterrupt() assumes that all LORA/DIO1/CS/RESET GPIOs are RTC GPIOs which is not true (e.g. only RTC GPIOs can be used for ext0).
As a result there are error messages in the log and all devices where the DIO1 pin is not an RTC GPIO will fail to wake up from sleep when a LoRa packet is received (one packet is received though, but processed on the next scheduled wakeup).
This PR replaces the RTC GPIO functions by generic functions which check for RTC GPIO internally and does a check for the validity of RTC GPIOs for DIO1.