 
   if (counter >= GETDATACOUNT) //Get new data
   {
-    // If we lost WiFi connection (it sometimes happens), restart the nodeMCU
-    if (WiFi.status() != WL_CONNECTED) {
-      ESP.restart();
-    }
-    else {
-      counter = 0;
-      getWeatherData();
-    }
+    counter = 0;
+    getWeatherData();
   }
   else {
     counter++;

    Serial.println(counter);
#endif
  }
}

void getWeatherData() //client function to send/receive GET request data.
{

    char c = client.read(); // Gets byte from WIFI buffer
    result = result + c;
  }
  client.stop(); //stop client

#ifdef DEBUG
  Serial.println(result);
#endif
  result.replace('[', ' ');
  result.replace(']', ' ');

// See the following for a description on JSON decoding:
// https://www.arduino.cc/en/Tutorial.WiFi101WeatherAudioNotifier
  char jsonArray [result.length() + 1];
  result.toCharArray(jsonArray, sizeof(jsonArray));
  jsonArray[result.length() + 1] = '\0';
