Skip to content

ESP32 External Wake from Sleep Not Working

DodaTech Updated 2026-06-26 1 min read

In this tutorial, you'll learn about ESP32 External Wake from Sleep Not Working. We cover key concepts, practical examples, and best practices.

The Problem

ESP32 does not wake from deep or light sleep when an external GPIO signal is applied.

Quick Fix

Wrong

esp_sleep_enable_ext0_wakeup(GPIO_NUM_5, 1);  // GPIO 5 is not RTC
ESP_ERR_INVALID_ARG: GPIO is not an RTC GPIO. Device does not wake.
// RTC GPIOs: 0,2,4,12-15,25-27,32-39
esp_sleep_enable_ext0_wakeup(GPIO_NUM_33, 1);  // Wake on HIGH
// OR use ext1 for multiple pins:
uint64_t mask = (1ULL << GPIO_NUM_33) | (1ULL << GPIO_NUM_32);
esp_sleep_enable_ext1_wakeup(mask, ESP_EXT1_WAKEUP_ANY_HIGH);
ESP32 wakes from deep sleep when GPIO 33 goes HIGH.

Prevention

Only RTC-capable GPIOs work for wake from deep sleep. Ext0 wakes on one pin (level-sensitive). Ext1 wakes on any of multiple pins. Debounce wake signals externally. Check wake cause with esp_sleep_get_wakeup_cause().

DodaTech engineers apply these same patterns across Doda Browser, DodaZIP, and Durga Antivirus Pro for production IoT reliability.

FAQ

### Which GPIOs can wake the ESP32?

RTC GPIOs: 0, 2, 4, 12-15, 25-27, 32-39. Non-RTC GPIOs cannot wake from deep sleep but can wake from light sleep.

What is ext0 vs ext1 wake?

ext0: single pin, level-triggered (HIGH or LOW). ext1: multiple pins, any can trigger, stores wake pin number.

How do I detect which pin woke the device?

Use esp_sleep_get_ext1_wakeup_status() for ext1 wake. Returns a bitmask of pins that triggered wake.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro