Long press reset button?
Posted: Sat Apr 16, 2016 5:21 pm
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.
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.