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?
Can't wakeup esp32c3 after deepsleep or light sleep by pin
-
- Posts: 1
- Joined: Thu May 12, 2022 10:07 am
Re: Can't wakeup esp32c3 after deepsleep or light sleep by pin
hi jd3096,
do you get any luck to get it working?
do you get any luck to get it working?
Re: Can't wakeup esp32c3 after deepsleep or light sleep by pin
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.
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
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.