WiFi.status() hangs / resets board Using one of the RobotDyn boards with onboard WiFi and a Generic ESP8266 module.

I can load the sketch, but when WiFi.status() is called to see if WiFi enabled, the sketch hangs, rebooting the board after ten seconds are so.


void setup() {
  Serial.begin( 115200 );
  Serial.println( "begin - wifi status: " );
  // program hangs here - - - - - - - 
  int status = WiFi.status();
  Serial.println( status );
}
I think it might be a problem with the code you are using, prior to version 2.2.0 of the "ESP Core" the first block of code worked, since only the second version works.

It seems that you can get around it by rather than doing this:

 WiFi.begin(ssid, password); // connect to the network
 while (WiFi.status() != WL_CONNECTED) 
 {
     delay(500);
 }


You should do this:

if (WiFi.status() != WL_CONNECTED) 
{
     WiFi.begin(ssid, password); // connect to the network
     delay (500);
}


Does that look it might be a likely cause?

Sources
 1  2