-->
Page 1 of 1

Distinguishing wake-up reset from button pressed reset

PostPosted: Mon Jun 15, 2015 2:59 pm
by phil_jones2000
I want to put an ESP8266 into deep sleep, waking every, say, 10 minutes to make and report a measurement. I'd also like a means of forcing the ESP8266 to wake up through a button press. If I connect GPIO16 to nRST to allow deep sleep wake-up to operate is there any way to distinguish this event from a button press on the nRST pin? I don't feel that it is possible but thought I should ask.

In general how can a deep sleep device be forced to wake to do something other than it would normally do on wake-up? I have seen mention somewhere of generating a reset event by capacitive coupling - perhaps this could be combined by a switch on a GPIO to allow the state of the GPIO to be checked after reset. Has anyone tried this successfully?

Re: Distinguishing wake-up reset from button pressed reset

PostPosted: Tue Jun 23, 2015 4:34 am
by tytower
When it comes out of deepSleep() I think a pulse is sent out on GPIO16(XPD) it is attached to the reset pin and I have always used a small capacitor but others say a direct link works . That pulse causes a reset and the program starts from scratch again. So if you put a button on reset to ground that should do the job . It will restart from scratch and then wait the normal deepSleep() time until the next reset pulse .

No clue as to how to make it do something different unless you write a variable to EEPROM ...say state=1 in your program and on wake up have your program read that variable from EEPROM and do something else if it is 1. Manipulation of EEPROM is in the ESP8266 examples