esphome / feature-requests

ESPHome Feature Request Tracker
https://esphome.io/
420 stars 26 forks source link

Please add support for pin wakeup of ESP32-C3 like in documentation #2588

Open Liionboy opened 9 months ago

Liionboy commented 9 months ago

Hello,

Recently i change a CBU with a ESP32-C3 and i try to implement Deep Sleep but only as pin can use 0, 1, 2, 3, 4, 5 support wakeup. But in Documentation write you can wake up on any Digital Pins:

Configuring IOs (Deep-sleep Only)[](https://docs.espressif.com/projects/esp-idf/en/latest/esp32c3/api-reference/system/sleep_modes.html#configuring-ios-deep-sleep-only)
Some ESP32-C3 IOs have internal pullups or pulldowns, which are enabled by default. If an external circuit drives this pin in Deep-sleep mode, current consumption may increase due to current flowing through these pullups and pulldowns.

In Deep-sleep mode:
digital GPIOs (GPIO6 ~ 21) are in a high impedance state.

RTC GPIOs (GPIO0 ~ 5) can be in the following states, depending on their hold function enabled or not:
if the hold function is not enabled, RTC GPIOs will be in a high impedance state.

if the hold function is enabled, RTC GPIOs will retain the pin state latched at that hold moment.

I want to wake up on a PIR sensor and that sensor is on GPIO6 and can't use for wake-up.

https://docs.espressif.com/projects/esp-idf/en/latest/esp32c3/api-reference/system/sleep_modes.html#configuring-ios-deep-sleep-only

As board in ESPHome o use this:

esp32:
  board: esp32-c3-devkitm-1
  framework:
    type: arduino

Thanks

BillyNate commented 7 months ago

According to the documentation in the link you provided:

  Any IO can be used as the external input to wake up the chip from Light-sleep.
  (…)
  Additionally, IOs that are powered by the VDD3P3_RTC power domain can be used to wake up the chip from Deep-sleep.

To my understanding this means only GPIO0 ~ 5 can be used to wake up from deep-sleep, though GPIO2 is a strapping pin (overview here).

Wouldn't it be possible to move the PIR sensor from GPIO6 to an RTC pin?