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

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
jd3096
Posts: 13
Joined: Mon Jul 05, 2021 1:22 pm

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

Post by jd3096 » Sat Jul 24, 2021 3:23 pm

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?

robbietree
Posts: 1
Joined: Thu May 12, 2022 10:07 am

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

Post by robbietree » Mon Jun 13, 2022 6:26 am

hi jd3096,

do you get any luck to get it working?

SuGlider
Posts: 1
Joined: Fri Jul 15, 2022 12:04 am

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

Post by SuGlider » Fri Jul 15, 2022 12:10 am

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.

User avatar
osi
Posts: 1
Joined: Sat Jul 02, 2022 8:34 am

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

Post by osi » Tue Oct 11, 2022 11:04 pm

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.

Post Reply