← index #15260Issue #16839
Related · high · value 4.623
QUERY · ISSUE

esp32.wake_on_ext0 not workingon esp32s2

openby kjm1102opened 2024-06-12updated 2024-09-01
bugdocs

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

CANDIDATE · ISSUE

Bug: Deep Sleep Wake-up Issue on ESP32-C3

openby stefan21-techopened 2025-03-01updated 2025-05-22
bugport-esp32

Port, board and/or hardware

ESP32 PORT, ESP32-C3 Super Mini

MicroPython version

Micropython 1.24.1

Reproduction

Title: Bug: Deep Sleep Wake-up Issue on ESP32-C3

Description:
I am experiencing an issue with the deep sleep wake-up functionality on the ESP32-C3 using MicroPython. The device does not wake up as expected when a GPIO pin changes from low to high.

Steps to Reproduce:

  1. Flash the latest version of MicroPython on an ESP32-C3.
  2. Use the following code to enter deep sleep and wake up on a GPIO pin change:
    import machine
    import esp32
    import time
    
    WAKEUP_GPIO_PIN = 0
    LED_GPIO_PIN = 8
    
    pin = machine.Pin(WAKEUP_GPIO_PIN, machine.Pin.IN, machine.Pin.PULL_UP)
    esp32.wake_on_ext0(pin=pin, level=esp32.WAKEUP_ANY_HIGH)
    
    wake_reason = machine.wake_reason()
    
    if wake_reason == machine.WAKEUP_EXT0:
        print("Woke up from deep sleep")
        machine.Pin(LED_GPIO_PIN, machine.Pin.OUT).value(1)
        time.sleep(1)
        machine.Pin(LED_GPIO_PIN, machine.Pin.OUT).value(0)
    else:
        print("Entering deep sleep")
        time.sleep(2)
        machine.deepsleep()
    
    

Expected behaviour

Wake up with change on GPIO0.

Observed behaviour

Does not wake up.

Additional Information

No, I've provided everything above.

Code of Conduct

Yes, I agree

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