-->
Page 1 of 1

NodeMCU ESP-12E weirdness going on. How can I reset?

PostPosted: Mon Aug 05, 2019 2:18 am
by wakewatcher
I've been playing with this board for a month or so with good success. Never had any problems with sketches or the Arduino IDE with my ESP-12Es. Well that is until today. Today I put together a simple client and server. All the client does is establish a wifi connection with the server and then monitors the state of two push buttons and sends their states to the server which then prints the state on the com port. It was working fine when I decide to simplify the client and for now only monitor 1 button. I changed the code, compiled and uploaded. On the client side com port it showed the desired results of only monitoring one button but on the server side it was still get the states of both buttons and indeed when I pressed both buttons the client only showed one changing state but both were getting sent to the server. (This was an easy change I just changed int numButtons = 2; to int numButtons = 1; and the "for" statement did the rest. i.g for(i = 1; i < numButtons; i++) {stuff goes here}.

I've stared/googled this thing for hours. Finally I uploaded a totally different sketch which the loop only did this. Void Loop() { Serial.println("Hello World this many times: " + String(i++); delay(5000);}

The COM port happily prints out the Hello World message and counter forever BUT the client still monitors the state of the buttons and sends it to the server with no code to that effect in the sketch. So it appears that I've got a virtual machine going along side the latest uploaded sketch. My original client had a SimpleTimer (ala the SimpleTimer.h library) that called the polling routine and the client to server message sending code. Is it possible that this code is still residual in flash? I pressed the rst and flash buttons on the board with no joy. I also found in tools something that says "Erase Flash: Sketch and WiFi Settings" I set that and uploaded my Hello World Sketch but nothing changed. I didn't try the Erase All Flash content option as I didn't know if that would zorch any bootstrap that might be needed. Also for the same reason I didn't click on the "Burn Bootloader" selection. (Although maybe that's what I need to do. I really have no idea.) Hoping someone here can tell me how to clear my ESP-12E to a factory fresh state. Thx.