I know that I can do it by simply connecting that button to reset pin, but I need ESP to send different JSON based on how many times was button pressed. Right now if I press button again, ESP will just restart one more time and JSON for one click will be send.
I was thinking about connecting that button to reset pin and also to one of the ESP's pins (for counting how many times was button pressed) and then using another pin with P-channel MOSFET as switch to "cut the connection" between button and reset pin.
Can you recommend me good,small and cheap P-channel MOSFET that is suitable for this application or do you know about better way of solving my problem ?