You can use an external interrupt to wake up the ESP32 from deep sleep. There are two types of external wake-ups in the ESP32.
- ext0: This is used when a single GPIO pin is being accessed.
- ext1: This is used when several GPIO pins are being accessed e.g. through different push buttons.
Only Real-time clock or RTC input-output pins can be used as a wake up source and you need to make sure that during deep sleep the RTC peripherals are powered ON. So, you can only use the RTC GPIOs to trigger the ext0, ext1 external wake-up.