It is possible to the esp32 to wake up from deep sleep without reading boot?

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
joao_gabriel99
Posts: 1
Joined: Tue Jul 12, 2022 10:11 pm

It is possible to the esp32 to wake up from deep sleep without reading boot?

Post by joao_gabriel99 » Tue Jul 12, 2022 10:22 pm

I want a piece of code to run once, it works as a trigger to the rest of the code (a button needs to be pressed), which I want to loop indefinitely, but this second code contains at its end a deep sleep. So that when the esp wake up it reads again the boot and requires to be triggered again. Hope I made it understandable.
So, it is possible?

tepalia02
Posts: 99
Joined: Mon Mar 21, 2022 5:13 am

Re: It is possible to the esp32 to wake up from deep sleep without reading boot?

Post by tepalia02 » Wed Jul 13, 2022 1:52 am

There are many articles on how to put the ESP32 in deep sleep mode and wake it with an external wake-up, like a button press. But I can't understand what is meant by 'without reading boot'.

KJM
Posts: 158
Joined: Sun Nov 18, 2018 10:53 pm
Location: Sydney AU

Re: It is possible to the esp32 to wake up from deep sleep without reading boot?

Post by KJM » Wed Jul 13, 2022 6:16 am

You could put your trigger code in boot.py & your deepsleep code in main.py I think after wakeup the esp32 should run boot.py first.

Lobo-T
Posts: 36
Joined: Tue Nov 16, 2021 2:36 pm

Re: It is possible to the esp32 to wake up from deep sleep without reading boot?

Post by Lobo-T » Wed Jul 13, 2022 6:19 am

I'm not sure I completely understand what you are asking, but you can check what caused a reset with machine.reset_cause()
https://docs.micropython.org/en/latest/ ... eset_cause

bilalmalikuet
Posts: 2
Joined: Wed Jul 13, 2022 7:40 am
Contact:

Re: It is possible to the esp32 to wake up from deep sleep without reading boot?

Post by bilalmalikuet » Wed Jul 13, 2022 7:44 am

ESP32 provides different ways to wake up from deep sleep such as Time wake up, External interrupt wake up, Touch pin wake up. This is a good reference to look into:
https://microcontrollerslab.com/micropy ... p-sources/

Post Reply