I am having a problem keeping code on my ESP. I have a very simple task that I want this board to accomplish, I have a push button (connected to ground with a pull-up resistor) that is connected to pin 0 so I can read whether it is high or low. Then I send that to the server and I can read it from my web browser. Everything works perfectly right after I upload, however, after the board has been disconnected from power for a while, when I power it up, it no longer works. I have to re-upload the sketch in order to get it back in a working state. It’s acting as if it’s brand new every time it has been off for a little while(5-10 minutes or more).
Some more info:
I am using an adafruit feather ESP8266 board so I can power it from 5v micro usb, and upload easily.
I am using arduino IDE to program it, and the sketch I wrote is a modified version of the ESP blink sketch, with other code examples from A Beginner's Guide to the ESP8266
The only additional classes I am using are these ones:
<ESP8266WiFi.h>, <WiFiClient.h>, <ESP8266WiFiMulti.h>, <ESP8266mDNS.h>, <ESP8266WebServer.h>
I am trying to avoid adding an arduino as a middle layer between the button and the ESP, but if that is the only way to make it work, I will give that a shot. Any suggestions are greatly appreciated!