       break;
     case SYSTEM_EVENT_STA_DISCONNECTED:
       ESP_LOGI( TAG, "STA Disconnected");
+      WiFi.begin();
       break;
     case SYSTEM_EVENT_STA_STOP:
       ESP_LOGI( TAG, "STA Stopped");


  waitForWifi();

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

    WiFi.mode( WIFI_AP_STA );
    WiFi.beginSmartConfig();

    const time_t DELAY_SECONDS = 60 * 5;
    const time_t END_TIME = time( NULL ) + DELAY_SECONDS;

    ESP_LOGI( TAG, "Waiting %i seconds for SmartConfig.", DELAY_SECONDS );

    while ( !WiFi.smartConfigDone() && time( NULL ) < END_TIME ) {
      char remainingSCTime[12];
      if ( xOledTaskHandle ) {
        OLED.clear();
        OLED.setFont( ArialMT_Plain_10 );
        OLED.drawString( 64, 10, "Waiting for SmartConfig." );
        snprintf( remainingSCTime, sizeof( remainingSCTime), "%3.i seconds", END_TIME - time( NULL ) );
        OLED.drawString( 64, 30, remainingSCTime );
        OLED.invertDisplay();
        OLED.display();
