 
   WiFi.waitForConnectResult();
 
-  if ( WiFi.status() != WL_CONNECTED ) {
+  if ( WiFi.status() != WL_CONNECTED && ( WiFi.status() != WL_CONNECT_FAILED ) ) {
     if ( xTftTaskHandle ) {
       tft.println( "\nNo WiFi connection.\nWaiting for SmartConfig." );
       tft.invertDisplay( true );

    webserverTaskPriority,          /* Priority of the task */
    NULL,                           /* Task handle. */
    1);                             /* Core where the task should run */

  while (1) {
    if ( !WiFi.isConnected() ) {
      ESP_LOGI( TAG, "No Wifi. Reconnecting.." );
      WiFi.reconnect();
      vTaskDelay( 9000 / portTICK_PERIOD_MS );
    }
    vTaskDelay( 1000 / portTICK_PERIOD_MS );
  }
}

/* https://github.com/espressif/arduino-esp32/blob/master/libraries/WiFi/src/WiFiType.h */


  waitForWifi();

  WiFi.setAutoReconnect( true );
  /* We have succesfully connected */
  WiFi.onEvent( WiFiEvent );
  ESP_LOGI( TAG, "WiFi connected to '%s' %s %s",
            WiFi.SSID().c_str(), WiFi.localIP().toString().c_str(), WiFi.macAddress().c_str() );
  if ( xTftTaskHandle ) {
