Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By real2
#65004 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:
Code: Select allvoid 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!
User avatar
By Otto Haldi
#65016 // Router Connection
const char ssid[] = "SSID"; // mon réseau SSID
const char pass[] = "pass"; // mon mot de passe
WiFiServer server(4050); // Port Forwarding

void setup() {

// Start WiFi network
int progress=0;
Serial.print("Connecting to ");
Serial.println(ssid);

WiFi.disconnect(); // Help to get a faster connecion!
WiFi.softAPdisconnect();
WiFi.begin(ssid, pass);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
progress++;
if(progress==10)progress=0;
Serial.print(".");
}
// your code...