Skip to content

Fix ESP32 light sleep: prefer ext1 wakeup, remove RTC clock switching#7

Open
weebl2000 wants to merge 10 commits intoIoTThinks:MCdev-PowerSaving-for-all-esp32-repeaters-202602from
weebl2000:MCdev-PowerSaving-for-all-esp32-repeaters-202602-fixes
Open

Fix ESP32 light sleep: prefer ext1 wakeup, remove RTC clock switching#7
weebl2000 wants to merge 10 commits intoIoTThinks:MCdev-PowerSaving-for-all-esp32-repeaters-202602from
weebl2000:MCdev-PowerSaving-for-all-esp32-repeaters-202602-fixes

Conversation

@weebl2000
Copy link
Copy Markdown

  • Use esp_sleep_enable_ext1_wakeup() on ESP32/S2/S3 instead of gpio_wakeup_enable() which overwrites RadioLib's POSEDGE ISR on DIO1, causing missed packets after wake ("deaf" device)
  • Fall back to gpio_wakeup_enable() on C3/C6 (no ext1), with hasPendingRadioIRQ() flag so RadioLib still reads buffered packets
  • Remove rtc_clk_slow_src_set() that desynced FreeRTOS tick counting
  • Add IRQ pin validation before configuring wake sources

I hope this fixes the reset issues.

IoTThinks and others added 10 commits February 13, 2026 23:05
- Use esp_sleep_enable_ext1_wakeup() on ESP32/S2/S3 instead of
  gpio_wakeup_enable() which overwrites RadioLib's POSEDGE ISR on DIO1,
  causing missed packets after wake ("deaf" device)
- Fall back to gpio_wakeup_enable() on C3/C6 (no ext1), with
  hasPendingRadioIRQ() flag so RadioLib still reads buffered packets
- Remove rtc_clk_slow_src_set() that desynced FreeRTOS tick counting
- Add IRQ pin validation before configuring wake sources
@weebl2000 weebl2000 force-pushed the MCdev-PowerSaving-for-all-esp32-repeaters-202602-fixes branch from 2b663e4 to ef6422b Compare March 14, 2026 14:08
IoTThinks pushed a commit that referenced this pull request Mar 27, 2026
@IoTThinks IoTThinks force-pushed the MCdev-PowerSaving-for-all-esp32-repeaters-202602 branch from 002878e to b45d567 Compare March 28, 2026 04:30
@IoTThinks IoTThinks force-pushed the MCdev-PowerSaving-for-all-esp32-repeaters-202602 branch from 30e37c5 to c88813a Compare April 8, 2026 14:47
@IoTThinks
Copy link
Copy Markdown
Owner

RTC wakeup does not work for all esp32 boards as not all boards use RTC-supported DIO1.
For example, Xiao S3, T-Beam...

Thanks for your effort.

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.

2 participants