I'm not sure myself, but when I start over using the cleaner code:
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
// WiFi CREDENTIALS
const char *ssid = "xxxx";
const char *password = "xxxx";
void setup() {
Serial.begin(115200);
WiFi.begin(ssid, password);
Serial.println("");
Serial.print("Connecting");
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.print("Connected to ");
Serial.println(ssid);
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
}
void loop() {
if (WiFi.status() == WL_CONNECTED) {
Serial.println("From ESP Connected!");
}
delay(5000);
}
My gut is telling me that maybe WiFi.mode(WIFI_STA) is causing the error?
By the way, it worked already, thanks Juraj and cbalakus for the help!