We really need a way to differenciate RESET and Wake Up from Deep Sleep

User avatar
pratik
Posts: 416
Joined: Wed Jun 29, 2016 7:17 pm
Location: India
Contact:

Re: We really need a way to differenciate RESET and Wake Up from Deep Sleep

Postby pratik » Sun Dec 11, 2016 1:00 pm

Ohh! I get what you are saying.
This is now an SDK issue!
It is actually basic digital design stuff. Let me try to explain...

ESP8266 wakes from deep sleep by resetting itself, where it is the same recent as a user reset using a button. But when deep sleep is enabled, the chip RESETS ITSELF.
So in the hardware, once deep sleep is enabled - the chip expects the next reset event to be a wake-up reset. And if the user pulls the line low at this stage when deep sleep is enabled - the chip will think the GPIO caused this, not the user!
What you can do is you can use an external latch (a simple MOS and capacitor based one, will cost less than a button itself!) which stays high for say 5 seconds after the USER presses the reset button. The ESP8266 can then read this and determine if a button was pressed recently!

This is additional circuit design that is necessary to detect a button press. The ESP8266 has no internal hardware to distinguish (if deep sleep is enabled) whether a physical button press caused reset or a system wakeup caused a reset because they both do the same thing - alter reset pin!
Regards,
Pratik Panda
Website: http://www.PratikPanda.com

Custom firmware, Knowledge base and freelancing (ESP8266/ESP32):
http://www.iot-bits.com

garyeb
Posts: 4
Joined: Wed Nov 30, 2016 7:19 am

Re: We really need a way to differenciate RESET and Wake Up from Deep Sleep

Postby garyeb » Sun Dec 11, 2016 10:21 pm

Pratik,

After posting my question, a friend suggested precisely the external latch solution you offered as an alternative for this application. It will also have a much lower power consumption since the ESP is powered of until the button is pushed. As soon as my MOSFET order arrives, I will test the solution.

Thanks!

Gary

Who is online

Users browsing this forum: No registered users and 1 guest