philbowles wrote:In any event you can't sleep "forever": According to the ESP8266 SDK, you can only sleep for 4,294,967,295 µs, which is about ~71 minutes.
Not true ...
http://bbs.espressif.com/viewtopic.php? ... =1023#p983
I've used "proper" FET based latching power supplies before, but they are no cheaper, from an IO point of view. Thanks for replying, anyway, but I was really after feedback on why the circuit wouldn't work rather than why the concept is bad. But in the absence of any such feedback, I guess I'll just prototype it and test the thing. Just thought somebody might have done something similar.
An alternative (which I haven't tried) is to use a purely resistive scheme.
In deep sleep GPIO16 is off and -RST is high. If switch is closed, and released then code starts running which sets GPIO16 high (output before mode). This holds reset high irrespective of switch which may then be sensed. Deep sleep sets GPIO16 off ready for next cycle.
Behaviour is different as user presses and releases button for operation to start. I don't know whether that is important for you.