esp32.wake_on_ext0 not workingon esp32s2
Port, board and/or hardware
esp32 port, waveshare ESP32-S2-Pico
MicroPython version
MicroPython v1.23.0 on 2024-06-02; Generic ESP32S2 module with ESP32S2
Reproduction
import os,time,esp32
from machine import Pin,deepsleep
time.sleep(5)
pb=Pin(0, Pin.IN); esp32.wake_on_ext0(pb,0)
deepsleep(10*1000)
Expected behaviour
Loaded the file as main.py then reset the board. Expected s2 to either deepsleep for 10s or exit deepsleep when I press the button connected to gpio0.
Observed behaviour
The s2 exits deepsleep immediately after entering it. This can be verified with a usb ammeter in series with the usb powering the board. I did not include print commands because having a usb repl active often plays badly with deepsleep.
Additional Information
esp32.wake_on_ext0 works OK with deepsleep on an esp32 v1.23.0 so I figure the instant wakeup on the s2 is down to it being an s2.
Code of Conduct
Yes, I agree
ESP32-C6: WAKEUP_ALL_LOW causes GPIO pin to be stuck upon waking from deeepsleep
Port, board and/or hardware
ESP32_C6_GENERIC, Seeed Studio XIAO ESP32-C6
MicroPython version
MicroPython v1.25.0 on 2025-04-15; ESP32C6 module with ESP32C6
Reproduction
- Copy the code below into
main.pyon an ESP32-C6 board. - Reset the board.
from machine import Pin, deepsleep
from esp32 import wake_on_ext1, WAKEUP_ALL_LOW
from time import sleep_ms
BUTTON_PIN = 0 # must be RTC-capable pin.
LED_PIN = 15 # XIAO ESP32-C6 User LED pin, active LOW
sleep_ms(1000) # wait for button to be released
button = Pin(BUTTON_PIN, Pin.IN, Pin.PULL_UP)
led = Pin(LED_PIN, Pin.OUT, value=1) # active low
def blink_led(period_ms):
led.value(0) # turn on LED
sleep_ms(period_ms)
led.value(1) # turn off LED
blink_led(500)
if button.value() == 1:
wake_on_ext1([button], WAKEUP_ALL_LOW)
deepsleep()
else:
print("Button is pressed. Not going to sleep.")
while True:
sleep_ms(100)
blink_led(100)
Expected behaviour
Expected to long-blink the LED once after reset.
If pin GPIO 0 is briefly connected to GND you should get another single blink.
Observed behaviour
The LED long-blinks once, then again after 1 second, then flashes rapidly, indicating that pin 0 is stuck LOW.
Interrupting with mpremote repl you can examine the state of button:
>>> button.value()
0
>>>
Additional Information
If you use esp32.WAKEUP_ANY_HIGH (and Pin.PULL_DOWN) it works correctly.
Also, wake_on_ext0(button, WAKEUP_ALL_LOW) doesn't wake up on the GPIO going LOW.
Code of Conduct
Yes, I agree