Skip to content

GPIO wakeup from light sleep #10767

Answered by jeffmer
jeffmer asked this question in ESP32
Feb 16, 2023 · 8 comments · 3 replies
Discussion options

You must be logged in to vote

The problem with GPIO wakeup is that it only applies to LOW and HIGH LEVEL interrupt triggers and these cause problems with ESP32 micropython in that you get continuous interrupts which do not give the ISR a chance to run and cancel the interrupt. To overcome this, I have implemented a solution which disables interrupts on a Pin immediately the LEVEL interrupt occurs. This leads to the light sleep solution example below:

from machine import Pin,lightsleep,SLEEP
from time import sleep_ms

def isr(p):
    print("Interrupt ",p)

pa = Pin(32, Pin.IN)
pb = Pin(34, Pin.IN)                                                                                                                            …

Replies: 8 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@jeffmer
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by jeffmer
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@karfas
Comment options

Comment options

You must be logged in to vote
1 reply
@jeffmer
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
ESP32
Labels
None yet
6 participants