Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sleep PD config for deep sleep with EXT1 and ANY_HIGH config #2921

Open
ijc opened this issue Oct 14, 2024 · 0 comments
Open

Sleep PD config for deep sleep with EXT1 and ANY_HIGH config #2921

ijc opened this issue Oct 14, 2024 · 0 comments

Comments

@ijc
Copy link

ijc commented Oct 14, 2024

Describe the problem you have/What new integration you would like

Using (at least) EXT1 based deep sleep with ESP_EXT1_WAKEUP_ANY_HIGH requires the use of an external pull down resistor or configuring the RTC to keep peripherals powered on by calling esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON) so that the configured internal pull down remains in place during sleep. Without this the system wakes back up immediately (presumably because the pins float).

I've come across multiple threads and issues about deep sleep not working which seem like they could be related to this. Eventually I came across https://community.home-assistant.io/t/deep-sleep-and-multiple-buttons/167214/19 which pointed me in the right direction.

This stuff is documented in the esp-idf docs but I think it might be worth mentioning explicitly in the esphome deep sleep docs since it's a bit non-obvious and seems like it might be tripping people up.

I think the docs would be the most valuable thing, but perhaps a native esphome YAML way of setting the sleep PD configuraiton would also be useful?

Please describe your use case for this integration and alternatives you've tried:

I've used this which works for me:

  on_boot:
    - priority: 900
      then:
        - lambda: esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON);    

The ESP docs also suggest adding:

rtc_gpio_pullup_dis(gpio_num);
rtc_gpio_pulldown_en(gpio_num);

but I haven't tried with that (and things appear to work without, but I've not tested extensively).

I think what I'm actually going to do long term is use an external pull down.

Additional context

N/A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant