So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By destroyedlolo
#71176 Hi all,

I'm new with ESP but I'm confused with WiFi.begin() after reading several articles (sometime saying the reverse of others). I'm using Arduino's IDE and didn't changed WiFi.persistent() or autoconnect.

So, some questions :
1/ if I use the same SSID and password, is the flash written or not at each call WiFi.begin() ?

It is worth to have a code like this one ?
Code: Select all   for( int i=0; i< 120; i++ ){   // Trying with autoconnect
      if(WiFi.status() == WL_CONNECTED)
         break;
      delay(500);
      Serial.print("-");
   }

   if(WiFi.status() != WL_CONNECTED){   // failed, back to manual connection
      WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
      while(WiFi.status() != WL_CONNECTED){
         delay(500);
         Serial.print(".");
      }
   }


2/ my internet box is changing its bssid at every startup : will it cause issues when persistence is used ?

Thanks

Laurent