ESP01 won't connect to WiFi every once in a while.
Posted: Sun Apr 16, 2017 10:35 am
Hi, I'm facing a wired problem.
My ESP8266 01 is normally able to connect to my home WiFi network and communicate with other devices.
The problem is that every once on a while, after some debugging and resetting, it gets stuck in the connection loop. (Which waits for it to connect)
When that happens, even resetting the module won't help.
The only solution I found to this is flashing the AT firmware using some flasher.exe and then flashing my code again using the Arduino IDE.
I'm pretty new to all this, so I think that the problem might be something I'm doing wrong.
This is my code:
Thanks in advance!
My ESP8266 01 is normally able to connect to my home WiFi network and communicate with other devices.
The problem is that every once on a while, after some debugging and resetting, it gets stuck in the connection loop. (Which waits for it to connect)
When that happens, even resetting the module won't help.
The only solution I found to this is flashing the AT firmware using some flasher.exe and then flashing my code again using the Arduino IDE.
I'm pretty new to all this, so I think that the problem might be something I'm doing wrong.
This is my code:
Code: Select all
void setup() {
Serial.begin(9600);
delay(10);
// Initialize switch pin
pinMode(switchPin, OUTPUT);
digitalWrite(switchPin, LOW);
// Connect to WiFi
Serial.print("Connecting to ");
Serial.println(ssid);
Serial.print(WiFi.begin(ssid, password));
while (WiFi.status() != WL_CONNECTED) {
// Sometimes it gets stuck here.
Serial.print(WiFi.status());
delay(connectionStatusDelay);
}
Serial.println();
Serial.println("WiFi connected");
Thanks in advance!