Chat freely about anything...

User avatar
By mattrix
#45615 Hi,

I would like my ESP8266 to be able to detect a long press on a button that also does a hardware reset.
I use deep sleep, so an interrupt won't work.

Detecting the long press is easy in the setup, just time how long the button is pressed - if more than 1second, then wipe WiFi data.

However, the ESP8266 does not boot while the Reset button is still grounded.
Therefore, I think I will need to use another pin for my new reset button.

Then, need some hardware so when the button is held, it quickly GNDs the reset pin just once to reboot and then I can see how long it's pressed for in the setup().

My goal is just to have 1x simple reset button. If held then does a 'factory reset'

Any ideas?

Could I maybe use a gpio_pin_wakeup_enable ?
Can you call that before a deep sleep?
I really want deep sleep as it needs to be very power efficient.
User avatar
By martinayotte
#45632 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.