← index #11787PR #17518
Likely Duplicate · high · value 9.625
QUERY · ISSUE

ESP32-C3 wakeup from deepsleep not happening through GPIO1

openby pbdaranopened 2023-06-15updated 2024-09-02
bugport-esp32

GPIO1 of ESP32-C3 is a RTC GPIO and should be able to wakeup the device from deepsleep mode.
But it seems, in micropython, the GPIO1 is not defined as wakeup.
I want to wake my device using GPIO1. Please help with this.

CANDIDATE · PULL REQUEST

esp32: Add esp32.wake_on_gpio.

mergedby meirarmonopened 2025-06-17updated 2025-12-06
port-esp32

Summary

Some boards support waking up from deepsleep via GPIO pins (for instance ESP32C3, ESP32C6), but this is not currently supported by MicroPython. This commit adds support for waking with GPIO in a similar interface to waking with ext0, ext1, touch and ulp. This commit adds documentation for this new function as well.

This is a long standing request, with a lot of chatter online. Over the years there have been several attempts to add this (https://github.com/micropython/micropython/pull/15498, https://github.com/micropython/micropython/pull/13333 and https://github.com/micropython/micropython/pull/9583), but with no success. I also explain below why my approach is better (it is based on the existing PRs, so thanks to @m-cas, @puppet13th and @ondiiik).

Testing

Tested ESP32_GENERIC_C3with:

import machine
import esp32
esp32.wake_on_gpio((machine.Pin(5),machine.Pin(2)), esp32.WAKEUP_ANY_HIGH)
machine.deepsleep()

and checked that the relevant pins wake up from deepsleep.

Trade-offs and Alternatives

The existing PRs mentioned above modify wake_on_ex1, testing if the port is specifically ESP32C3. My solution adds a wake_on_gpio which is a similar interface, and tests for the SOC capabilities.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied