Wakeup From Sleep With a Timer (ESP32 + Arduino series)

Поделиться
HTML-код
  • Опубликовано: 1 июн 2024
  • You can't let the ESP32 be in deep sleep forever. At some point you need to wake it up and the easiest way is by using a timer.
    Learn how to configure your board so it will automatically wakeup after a certain periode of time. For instance: you can sleep for 15 minutes, wakeup, make a temperature measurement and go back to deep sleep.
    ⚡️Other videos in this series:
    • ESP32 + Arduino
    (Everything you need to know about programming the ESP32 by using the Arduino Framework)
    🌍 Social
    Twitter: / savjee
    Facebook: / savjee
    Blog: savjee.be
    Become a Simply Explained member: / @simplyexplained
  • НаукаНаука

Комментарии • 20

  • @demiurgiac
    @demiurgiac День назад +1

    Never used "sleep" before. A little intimidated. You just saved me a lot of fooling around. Didn't realize how simple it would be. Thank you!. Also, like your style. No long intro with graphics, no personal story, no music...

  • @bgable7707
    @bgable7707 28 дней назад

    @3 mins, Great job explaining what code will run and what code will NEVER run, ie, void loop doesn't need to have code for the program to work correctly.

  • @thomasleftwite
    @thomasleftwite 10 месяцев назад

    The video helps me much, thank you!

  • @Chamuga9563
    @Chamuga9563 11 месяцев назад

    Very nice video! you helped me alot

  • @BlueyMcPhluey
    @BlueyMcPhluey 2 года назад

    wow this is so much easier than I thought it would be, and funnily enough the project I'm working on is to take temperature data and send it to a cloud server 😅

  • @bubi146
    @bubi146 3 года назад +2

    Hi
    It's a very nice instructional video you have made, and it takes place quietly, so everyone can follow - nicely made! I have a sketch that shows the time (clock), with an update every minute. It appears on the E-Paper display and it is ESP32 board that controls it. It is powered by a battery. I want to hear if you could make a small modification, so that it is not updated 24 hours a day, but only at certain time of the day, to save battery. It could e.g. Go in Deep sleep at 2300 and then wake up again at 0700, thereby saving power on the night, when I am not looking at the clock. Is it possible?
    Yours sincerely
    Georg

  • @duff8402
    @duff8402 3 года назад

    Any thoughts why one would get "esp_deep_sleep.h no such file or directory" error? I'm running IDE on a Raspberry Pi with all libraries updaed, but I cant seem to kick this error or find any fixes on google

  • @ianmather7109
    @ianmather7109 2 года назад

    Hi
    I followed your video to the letter but when the sleep code is in my Arduino IOT code the esp32 will not go online, I take the deep sleep code out and it does. I tried deep sleep code with my ESP12E and that did the same. Thoughts anyone

  • @mrbumcraic5046
    @mrbumcraic5046 2 года назад

    running from usb power, I have a sim 7600 connected to the 5v on the ESP32. The power to SIM7600 dies not turn off when in deep sleep resulting i major power drain.
    Can this be overcome

  • @worldexplorerPL
    @worldexplorerPL 2 года назад

    Hello, thanks for a very thorough tutorial. However, I have a question for the DEEP SLEEP state. If I have any digital outputs and one of them is set to HIGH when entering deep sleep, how does this output react after sleep? Are the outputs still latched or are they all LOW?

    • @juncusbufonius
      @juncusbufonius Год назад

      They would return to their startup state but you've probably worked this out with a print statement telling you their state. I believe he says you can store persistent variables and that would be the way to reinitialise them to their pre sleep state in setup.

  • @EasyOne
    @EasyOne 4 месяца назад

    Can I add deep sleep a Timer to esp32 Internet Clock oled ?

  • @gutny
    @gutny 11 месяцев назад

    This mode has ULP still working?

  • @igorbisori5117
    @igorbisori5117 3 года назад

    I would like to put my esp32 into deep sleep with a timer. Currently esp 32 exposes an api which is called every 20 minutes. I would like to put him to sleep for 19 minutes, allow the bee to respond and then put him back to sleep. I've seen your example but it doesn't use the loop method. In my loop method there is the server.handleClient () statement; and with the sleep timer it is never called. how can i solve? Thanks to those who will answer

    • @mrbumcraic5046
      @mrbumcraic5046 2 года назад +1

      put all of your code in setup (still keep the loop function , just leave it empty)

  • @tritile
    @tritile 2 года назад +2

    2:36 that was sad :/

  • @Dralsoft
    @Dralsoft 2 года назад +1

    I'm doing this, setting the variable to 60minutes but it wakeups instantly. The maximum seems to be 35 minutes. Any ideas?

    • @mrbumcraic5046
      @mrbumcraic5046 2 года назад +1

      use esp_sleep_enable_timer_wakeup(8ULL*60*60*1000*1000); for example if you want 8 hours

    • @claytonnlambert
      @claytonnlambert Год назад

      Did you sort this out? It seems no matter what value I set it instantly restarts.

    • @claytonnlambert
      @claytonnlambert Год назад

      Fixed by delaying a bit between enabling deep sleep and starting deep sleep. Not sure why, but I must be doing something wrong.