Page 1 of 1

Can't wakeup esp32c3 after deepsleep or light sleep by pin

Posted: Sat Jul 24, 2021 3:23 pm
by jd3096
Recently,I want to test sleep and wake up function on esp32c3,here is my code:

import machine,esp32
from machine import Pin
import time

wake1 = Pin(2, mode = Pin.IN)
#level parameter can be: esp32.WAKEUP_ANY_HIGH or esp32.WAKEUP_ALL_LOW
esp32.wake_on_ext0(pin = wake1, level = esp32.WAKEUP_ALL_LOW)

print('Im awake. Going to sleep in 2 seconds')
time.sleep(2)
print('Going to sleep now')
time.sleep_ms(100)
machine.lightsleep()


it works on esp32,but when i try to test in on esp32c3, it sleep and won't wake up by pin pushed.
How to wake up correclty on esp32c3?
what's the problem?

Re: Can't wakeup esp32c3 after deepsleep or light sleep by pin

Posted: Mon Jun 13, 2022 6:26 am
by robbietree
hi jd3096,

do you get any luck to get it working?

Re: Can't wakeup esp32c3 after deepsleep or light sleep by pin

Posted: Fri Jul 15, 2022 12:10 am
by SuGlider
check https://github.com/espressif/arduino-esp32/issues/6976
There are some necessary IDF functions to make it work with ESP32-C3.
It may be necessary to add them to the repository code.

Re: Can't wakeup esp32c3 after deepsleep or light sleep by pin

Posted: Tue Oct 11, 2022 11:04 pm
by osi
The problem is that ESP32-C3 uses slightly different espidf API (GPIO wake-up vs. EXT0/1 wake-up) so implementation for this feature is temporarly disabled for this chip. I already opened PR https://github.com/micropython/micropython/pull/9583 which fixing this issue.