• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

learn ESP32 BOOK

Q&A Forum › learn ESP32 BOOK
0 Vote Up Vote Down
Mohammed Azeez asked 3 years ago

Hi I have A question regarding an example in the MODULE 3 (esp32 deep sleep) page 114 .and my Question is in the example  this instruction is used

( esp_sleep_enable_ext0_wakeup(GPIO_NUM_33,1);

which mean when GPIO 33 is high  weakup the esp32… but I noticed that  when the GPIO33 still high(keep in high state) the esp32 go to sleep again  after that wekup and continue periodically sleep and weakup every nearly 1 sec.

is that normal?

I mean if you have a sensor or data  sending to server it can not finish the job.because it will go to sleep…

5 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Hi.

In that specific example, that is normal.

The ESP32 wakes up when GPIO 33 goes to HIGH, when it is asleep.
If the ESP32 is awake and you keep pressing GPIO 33, it won’t react. It will only react to GPIO 33 when it is asleep.

In that particular example, the sketch simply prints the wake up reason, waits 1 second and then it goes to sleep again. That’s why, if you keep pressing GPIO33 HIGH, it will wake up every 1 seconds. Because that’s what that particular code does.

If you have data to read and send to a server, it will only go to sleep when it reaches this line of code:

esp_deep_sleep_start();

So, it will do all the other tasks before going to sleep.

I hope this is clear.

Regards,
Sara

0 Vote Up Vote Down
Mohammed Azeez answered 3 years ago

that was clear ,for example if we have a sensor to measure the current  flow which is connected to GPIO 33  and when the current not exist esp32 will go to sleep,when the current exist the esp32 will weak-up to measure time elapsed and  send the data to the server , but in that case it will always weak up then go to sleep periodically. actually I had an idea that when the current exist the esp32 should be always weak up and when the current not exit esp32 go to sleep
because this situation I ask this question
thanks a lot

0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

However, if you want that to happen, you can add an if statement in your code that checks if GPIO33 is HIGH. 
When, the ESP32 wakes up, it checks the state of GPIO 33.
If it is still HIGH, do whatever you want to do (without the sleep command).
If it is not, the ESP32 goes back to sleep.
In that scenario, the ESP32 will be awake as long as the GPIO33 is HIGH.
I hope you understand.
Regards,
Sara

0 Vote Up Vote Down
Mohammed Azeez answered 3 years ago

yes I understood you. very will
..thanks a lot  for your effort and your time

0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Great!
I’ll mark this question as resolved.
If you need further help, you just need to open a new question in our forum.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] SMART HOME with RPi, ESP32, and ESP8266 (version 1.2) March 8, 2023
  • [eBook Updated] ESP32-CAM Projects (version 1.3) January 7, 2023

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2023 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.