davydnorris wrote:sblantipodi wrote:davydnorris wrote:Remove the connection between the reset and GPIO - then when you tell it to sleep for any amount of time it will not wake up
but sometimes I need to make it sleep and sometimes I need to power it off.
any solution to the problem?
So really you want to do two different things here:
- sleep, in which case you can use the regular deep sleep routine
- shutdown, in which case you want to shut down the ESP
The NonOS documentation says that system_deep_sleep(0) should not set a wake up timer at all, and should sleep forever until you supply an external pulse on the RST pin. This is still deep sleep though - if you actually want to shut the unit down then you can toggle GPIO0. Have a look at this thread.
https://www.esp8266.com/viewtopic.php?f=11&t=4458
I don't need to power the esp off strictly. A sleep forever for me is enough but the problem is that it doesn't sleep forever.