 void wifiTask( void * pvParameters ) {
   /* trying last accesspoint */
-  //WiFi.onEvent( WiFiEvent );
   WiFi.mode( WIFI_STA );
   WiFi.setSleep( false );
+
   if ( wifi_network != "" ) WiFi.begin( wifi_network, wifi_password );
   else WiFi.begin();
-
-  ESP_LOGI( TAG, "Connecting WiFi" );
 
   if ( xTftTaskHandle ) {
     tft.setTextColor( TFT_TEXT_COLOR , TFT_BACK_COLOR );


  WiFi.waitForConnectResult();

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


  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 ) {
