Hello,
Is it possible to Wake UP the ESP32 from a GPIO today ?
I've tried to simply use: gpio_wakeup_enable(gpio_num_t gpio_num, gpio_int_type_t intr_type) but it does not seem to work. When the ESP32 is in Deep Sleep, it's not possible to wake it up from the GPIO, only by the timer.
Am I missing anything there ?
I'm also wondering if it was possible to make the ESP32 sleep without any Wake Up timeout, but only with a Wake Up on the GPIO ?
Regarding the function: esp_deep_sleep(uint64_t time_in_us) it seems, I've no choice to choose a certain Sleeping time, right ?
Wake Up from GPIO
Re: Wake Up from GPIO
FYI, I'm working on other deep sleep wakeup modes now, so the following functions will be added soon-ish. These include two modes of GPIO wakeup.
Code: Select all
esp_err_t esp_deep_sleep_enable_timer_wakeup(uint64_t time_in_us);
esp_err_t esp_deep_sleep_enable_ulp_wakeup();
esp_err_t esp_deep_sleep_enable_ext0_wakeup(gpio_num_t gpio_num, int level);
esp_err_t esp_deep_sleep_enable_ext1_wakeup(uint64_t mask, esp_ext1_wakeup_mode_t mode);
esp_err_t esp_deep_sleep_pd_config(esp_deep_sleep_pd_domain_t domain,
esp_deep_sleep_pd_option_t option);
void esp_deep_sleep_start() __attribute__((noreturn));
Re: Wake Up from GPIO
You can also do this with the current version if you modify some source files. See this wiki for an example:
http://wiki.jackslab.org/ESP32_RTC_External_Wakeup
http://wiki.jackslab.org/ESP32_RTC_External_Wakeup
Re: Wake Up from GPIO
Ok, thanks for the informations !
About the deep sleep mode, when I call the function: esp_deep_sleep() the module should be in Deep Sleep and the consumption should be, as announced in the Datasheet, about 0.1 to 0.2 mA, right ? Or should I do some other setup by myself while going in sleep mode ?
Today, when I measure it, the consumption is more about 1 ma on the ESP32 while in Deep Sleep.
About the deep sleep mode, when I call the function: esp_deep_sleep() the module should be in Deep Sleep and the consumption should be, as announced in the Datasheet, about 0.1 to 0.2 mA, right ? Or should I do some other setup by myself while going in sleep mode ?
Today, when I measure it, the consumption is more about 1 ma on the ESP32 while in Deep Sleep.
Re: Wake Up from GPIO
Hello,
Since the update of the SDK, I'm able to set the ESP32 in Deep Sleep and wake it up with External Wake Up.
So my initial issue is solved.
I'm now wondering what the consumpion I can really expect from the ESP32 at this stage.
According to the Datasheet, I could reach a consumption of 2.5 µA in hibernate mode:
Light-sleep : 0.8 mA
Deep-sleep
The ULP co-processor is powered on : 0.15 mA
ULP sensor-monitored pattern : 25 µA @1% duty
RTC timer + RTC memory : 10 µA
Hibernation RTC timer only : 2.5 µA
But what's exactly the Hibernation ?
Does it correspond to the Power Down of each Power Domain ?
If so, it should be achieve by calling:
Should I consider the ULP co-processor is powered (0.15 mA) on and the RTC Memory (10 µA) which makes something like 0.16 mA ?
Can I already rely on the values given in the Datasheet or this part of the ESP32 is not totally developped yet ?
I've done some measurements by myself but it seems I cannot go below 0.2 mA.
So if you have any values already measured for comparison, it would be helpful.
Cheers,
Alexis
Since the update of the SDK, I'm able to set the ESP32 in Deep Sleep and wake it up with External Wake Up.
So my initial issue is solved.
I'm now wondering what the consumpion I can really expect from the ESP32 at this stage.
According to the Datasheet, I could reach a consumption of 2.5 µA in hibernate mode:
Light-sleep : 0.8 mA
Deep-sleep
The ULP co-processor is powered on : 0.15 mA
ULP sensor-monitored pattern : 25 µA @1% duty
RTC timer + RTC memory : 10 µA
Hibernation RTC timer only : 2.5 µA
But what's exactly the Hibernation ?
Does it correspond to the Power Down of each Power Domain ?
If so, it should be achieve by calling:
Then, if I want to be able to Wake Up the ESP32 on external wake up, and be able to save data in the RTC Memory, I assume I should call:esp_deep_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH | ESP_PD_DOMAIN_RTC_SLOW_MEM | ESP_PD_DOMAIN_RTC_FAST_MEM, ESP_PD_OPTION_OFF);
esp_deep_sleep_start();
Then how much the ESP32 should consume ?esp_deep_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH | ESP_PD_DOMAIN_RTC_SLOW_MEM, ESP_PD_OPTION_ON);
esp_deep_sleep_start();
Should I consider the ULP co-processor is powered (0.15 mA) on and the RTC Memory (10 µA) which makes something like 0.16 mA ?
Can I already rely on the values given in the Datasheet or this part of the ESP32 is not totally developped yet ?
I've done some measurements by myself but it seems I cannot go below 0.2 mA.
So if you have any values already measured for comparison, it would be helpful.
Cheers,
Alexis
Re: Wake Up from GPIO
Hi Alexis,Alexis wrote:I'm able to set the ESP32 in Deep Sleep and wake it up with External Wake Up.
is there any chance you can share deep sleep / external wake up example code?
- rajkumar patel
- Posts: 29
- Joined: Mon Apr 10, 2017 12:43 pm
- Location: india
Re: Wake Up from GPIO
has anyone got clarity on this?Alexis wrote:
ULP sensor-monitored pattern : 25 µA @1% duty
how could i achieve hibernation exactly?Alexis wrote: But what's exactly the Hibernation ?
Does it correspond to the Power Down of each Power Domain ?
whenever i try to use selection of the options
as,
esp_deep_sleep_pd_config(ESP_PD_DOMAIN_MAX, ESP_PD_OPTION_OFF)
or
esp_deep_sleep_pd_config(ESP_PD_DOMAIN_MAX, ESP_PD_OPTION_AUTO)
these configuration calls are returning error code.
i'm unable to understand the significance of providing this config option.
i'm putting the esp in deep sleep and then waking it up using a rtc gpio interrupt and then running a wakeup stub which is stored in fast memory(if i'm guessing it correctly) as i've used RTC_DATA_ATTR for storage.
this is working correctly when i'm using configuration as :
esp_deep_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON)
right now, my main interest is to get the power consumption stats.Alexis wrote: Can I already rely on the values given in the Datasheet or this part of the ESP32 is not totally developped yet ?
I've done some measurements by myself but it seems I cannot go below 0.2 mA.
Alexis
could i rely on the data sheet values for this?
Regards,
Rajkumar M. Patel
Rajkumar M. Patel
Re: Wake Up from GPIO
ESP_PD_DOMAIN_MAX is out of bounds limit, you can't use
- rajkumar patel
- Posts: 29
- Joined: Mon Apr 10, 2017 12:43 pm
- Location: india
Who is online
Users browsing this forum: stdenits and 326 guests