Deepsleep with 2 reed switch

Colateral
Posts: 1
Joined: Thu Jul 19, 2018 8:05 pm

Deepsleep with 2 reed switch

Postby Colateral » Thu Jul 19, 2018 8:27 pm

Hello,

I have 2 reed switch (or buttons) on 34 and 35 (connected with pull pin-> 10k/3.3V ->GND)

using esp_sleep_enable_ext0_wakeup(34,LOW) is working fine -> wake up the board
using esp_sleep_enable_ext0_wakeup(35,LOW) is working fine -> wake up the board

but when I want or 34 or 35 to wake the board
esp_sleep_enable_ext1_wakeup(GPIO_SEL_34 | GPIO_SEL_35, ESP_EXT1_WAKEUP_ALL_LOW)

doesn't work.

I can not use ESP_EXT1_WAKEUP_ANY_HIGH because the board is entering and immediately exit from in deep sleep.

The External wakeup (ext1) documentation says:
RTC controller contains logic to trigger wakeup using multiple RTC GPIOs. One of the two logic functions can be used to trigger wakeup:
wake up if any of the selected pins is low

How I can have interrupt on 2 pins for LOW event?

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Deepsleep with 2 reed switch

Postby WiFive » Fri Jul 20, 2018 1:30 am

ESP_EXT1_WAKEUP_ALL_LOW: wake up when all selected GPIOs are low
ESP_EXT1_WAKEUP_ANY_HIGH: wake up when any of the selected GPIOs is high
You could try

Code: Select all

esp_sleep_enable_ext0_wakeup(34,LOW);
esp_sleep_enable_ext1_wakeup(GPIO_SEL_35, ESP_EXT1_WAKEUP_ALL_LOW);

Who is online

Users browsing this forum: Sazzad07 and 114 guests