Chat freely about anything...

User avatar
By chaeplin
#45633 martinayotte, you are right. Another input is needed.

https://raw.githubusercontent.com/chaep ... io_int.png

This one is I tested for door alarm.

martinayotte wrote:Unfortunately, the circuit in the above link provided by @mattrix is attached to CH_PD, not RESET.
Also, both CH_PD and RES can't be used as GPIO input, so firmware can read them to figure out any special reset mode.
Therefore, it would require a separate GPIO anyway, such the GPIO16 mentioned by @chaeplin ...
But the schematic provided by @chaeplin doesn't do the job either, since it is only disconnecting the RES switch when transistor base is low.
User avatar
By Barnabybear
#45643 Hi, I'm not sure that a reset will wake am ESP from sleeping, or if the ESP will be asleep when you need to do a reset. That a side, you can lookup the reason for a reset, the various different reasons have codes.
1: normal boot, 2: reset pin, 3: software reset & 4: watchdog reset.
If you simply connect a button from reset to ground, when pressed and relesed it will reset the ESP and record the code as 'reset pin' as opposed to 'wake from sleep' once you know it has been button reset you can do whatever with your code.
I can't remember the code to check but I'm sure Martin will when he checks in later.
User avatar
By martinayotte
#45650 @barnabybear, Doing external reset while in deepSleep is working. Remember the discovery done few weeks ago when some people were complaining about that, especially trying upload new sketch while deepSleep, and we discovered that a 220R or 1K resistor was needed instead of simple wire between RES and GPIO16 (due to the fact that GPIO16 is not OpenDrain during deepSleep but a strong HIGH).

But the OP goal of @mattrix wasn't related to deepSleep, even if of course it can be used, but to have external reset wit a button which is also used to distinguish Long or Short Reset (0.5sec vs maybe 5secs) so he can enter in special mode, maybe in AP mode instead of STA for example, or any other maintenance mode.

Maybe last @chaeplin schematic will work, someone has to try it out (but I'm too busy with my new PineA64 board and other OPi-PC boards to give it a try myself). If this schematic isn't enough, maybe it can be cured with the help of a mosfet. ;-)