You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I still don't see the _wakeupPin being assigned for PaperS3 board. I tried using wake_on_ext0 with GPIO pin 48, but I'm getting ValueError: invalid pin error.
The change above fixes lightSleep(touch_wakeup). However, it's going to confuse developers if they use deepSleep(touch_wakeup=true) - which cannot work due to the touch panel not being wired to an IO Pin (pin 48 is too high to allow wake from deep sleep).
I'm not sure what's the best solution - is there some way to make deepSleep a compile time warning if called with the PaperS3 board with touch_wakeup true?
On ESP32-S3 SOC_PM_SUPPORT_EXT0_WAKEUP is 0, so it reaches the EXT1 branch and executes ESP_ERROR_CHECK(esp_sleep_enable_ext1_wakeup_io(1ULL << 48, ESP_EXT1_WAKEUP_ANY_LOW)).
GPIO48 is not an RTC IO on S3 (RTC IOs are GPIO0-21), so that returns ESP_ERR_INVALID_ARG and ESP_ERROR_CHECK aborts - deepSleep(us, true) panics on PaperS3 rather than sleeping. This is what @randomekek warned about above.
One more inconsistency in the same block: the EXT1 pin mask is built from _wakeupPin while the wait loop uses wpin, so the M5PaperMono override (wpin = GPIO_NUM_4) never reaches the mask.
I have a local patch that checks the pin with rtc_gpio_is_valid_gpio(), logs a warning instead of aborting, and uses wpin consistently; it builds cleanly for ESP32 and ESP32-S3. Let me know if a PR would be helpful.
Submitted as #290 (second commit): the wakeup pin is validated with rtc_gpio_is_valid_gpio() and a warning is logged instead of aborting, so deepSleep(us, true) no longer panics on PaperS3. Deep sleep wakeup by touch remains impossible on this board - GPIO48 is not an RTC IO - so light sleep stays the way to do it.
Thank you for your patience — release 0.2.20 is now out and reworks the sleep wakeup handling (#290, #291), which should cover this case. Could you update and report whether touch wakeup now works on your PaperS3?
Activity
felmue commentedon Nov 16, 2025
Hello @skrat
what exactly do you mean by 'wake on touch'? Wake up from a shutdown state? Or wake up from one of the ESP32 sleep modes (deep sleep / light sleep)?
AFAIK only wake on touch from ESP32 light sleep is possible. Please see explanation and example here.
Thanks
Felix
skrat commentedon Nov 16, 2025
You are right, I want to use capacitive touch screen to wake up from light sleep.
Related discussion here: https://github.com/orgs/micropython/discussions/14351
I still don't see the
_wakeupPinbeing assigned for PaperS3 board. I tried usingwake_on_ext0with GPIO pin 48, but I'm gettingValueError: invalid pinerror.felmue commentedon Nov 16, 2025
Hello @skrat
oh, I see, you are using Micropython. I am not well versed in Micropython so I cannot really help. Sorry.
Thanks
Felix
randomekek commentedon Jan 31, 2026
The change above fixes
lightSleep(touch_wakeup). However, it's going to confuse developers if they usedeepSleep(touch_wakeup=true)- which cannot work due to the touch panel not being wired to an IO Pin (pin 48 is too high to allow wake from deep sleep).I'm not sure what's the best solution - is there some way to make deepSleep a compile time warning if called with the PaperS3 board with touch_wakeup true?
ainyan03 commentedon Jul 30, 2026
Triage note (not a maintainer).
Light sleep was fixed by 24882b7 (v0.2.12): it sets
_wakeupPin = GPIO_NUM_48for PaperS3 and takes agpio_wakeup_enable()path for that board, with a comment stating that GPIO48 is not an RTC IO:https://github.com/m5stack/M5Unified/blob/2fe93c0/src/utility/Power_Class.cpp#L1347-L1352
deepSleep()however still takes the generic path:https://github.com/m5stack/M5Unified/blob/2fe93c0/src/utility/Power_Class.cpp#L1290-L1301
On ESP32-S3
SOC_PM_SUPPORT_EXT0_WAKEUPis 0, so it reaches the EXT1 branch and executesESP_ERROR_CHECK(esp_sleep_enable_ext1_wakeup_io(1ULL << 48, ESP_EXT1_WAKEUP_ANY_LOW)).GPIO48 is not an RTC IO on S3 (RTC IOs are GPIO0-21), so that returns
ESP_ERR_INVALID_ARGandESP_ERROR_CHECKaborts -deepSleep(us, true)panics on PaperS3 rather than sleeping. This is what @randomekek warned about above.One more inconsistency in the same block: the EXT1 pin mask is built from
_wakeupPinwhile the wait loop useswpin, so the M5PaperMono override (wpin = GPIO_NUM_4) never reaches the mask.I have a local patch that checks the pin with
rtc_gpio_is_valid_gpio(), logs a warning instead of aborting, and useswpinconsistently; it builds cleanly for ESP32 and ESP32-S3. Let me know if a PR would be helpful.ainyan03 commentedon Jul 30, 2026
Submitted as #290 (second commit): the wakeup pin is validated with
rtc_gpio_is_valid_gpio()and a warning is logged instead of aborting, sodeepSleep(us, true)no longer panics on PaperS3. Deep sleep wakeup by touch remains impossible on this board - GPIO48 is not an RTC IO - so light sleep stays the way to do it.Validate the deep sleep wakeup pin and warn when no wakeup source is …
ainyan03 commentedon Aug 17, 2026
Thank you for your patience — release 0.2.20 is now out and reworks the sleep wakeup handling (#290, #291), which should cover this case. Could you update and report whether touch wakeup now works on your PaperS3?