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?
It is possible to the esp32 to wake up from deep sleep without reading boot?
-
- Posts: 1
- Joined: Tue Jul 12, 2022 10:11 pm
Re: It is possible to the esp32 to wake up from deep sleep without reading boot?
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'.
Re: It is possible to the esp32 to wake up from deep sleep without reading boot?
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.
Re: It is possible to the esp32 to wake up from deep sleep without reading boot?
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
https://docs.micropython.org/en/latest/ ... eset_cause
-
- 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?
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/
https://microcontrollerslab.com/micropy ... p-sources/