It was working fine before, so I know it is working. I can blink an LED using uploaded code, and if I reflash the nodemcu firmware I can connect to the router right away. Can anyone help?
#include <ESP8266WiFi.h>
const char* ssid = "Test_Network";
const char* password = "password";
// Create an instance of the server
// specify the port to listen on as an argument
WiFiServer server(80);
void setup() {
Serial.begin(115200);
delay(10000);
// prepare GPIO2
pinMode(2, OUTPUT);
digitalWrite(2, 0);
// Connect to WiFi network
Serial.println();
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
As you can see, the code is exactly from the example except for the delay. I changed that so I could get the serial monitor open before the code executes on upload.
I've copied my network SSID and password directly from the lua files, and compared them many times. I know that part is correct.
Any ideas?