 
 }
 
-// connect to adafruit io via MQTT
+// connect to MQTT server
 void connect() {
 
   while (WiFi.status() != WL_CONNECTED) {

  Serial.print(F("Connecting to "));
  Serial.println(WLAN_SSID);

  WiFi.begin(WLAN_SSID, WLAN_PASS);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);

    digitalWrite(BLUE_LED, LOW);
    delay(3000);
  }
  Serial.print(F("Connecting to MQTT server... "));
  while(!mqttclient.connected()) {
    if (mqttclient.connect("ESP8266Client")) {
      Serial.println(F("MQTT server Connected!"));  
        digitalWrite(GREEN_LED, HIGH);
        digitalWrite(BLUE_LED, LOW);
    } else {
      digitalWrite(GREEN_LED, LOW);
      digitalWrite(BLUE_LED, HIGH);
      Serial.print(F("MQTT server connection failed! rc="));
      Serial.print(mqttclient.state());
      Serial.println("try again in 10 seconds");
      // Wait 5 seconds before retrying
      delay(20000);
    }
  }

