void setup()
{
Serial.begin(9600);
Serial.println("serial begin");
delay(500);
status = WiFi.begin(ssid);
delay(500);
Serial.println("past wifi begin");
if ( status != WL_CONNECTED) {
Serial.println("Couldn't get a wifi connection");
//while(true);
Serial.println("About to go into for loop");
for (int i=0; i<5; i++){
Serial.println("Trying to connect again");
tryagain();
if ( status != WL_CONNECTED){Serial.println("Not Connected");}
else if (status == WL_CONNECTED){
Serial.println("Connected");
break;
}
}
}
}
void loop () {
Serial.println("Lost in loop");
Serial.println(status);
delay(1000);
}
void tryagain(void){
delay(1000);
status = WiFi.begin(ssid, pass);
delay(1000);
}
Moderator: igrr
I'm used to everything happening in micro to milliseconds max.
But lets do a comparison :
If you take your phone and dial a number and you simply hangup within few second and try new redial again, there not a lot of chance that you will get a connection if you don't wait enough for the other person to answer...