   } else {
     wifi_connect();
   }
-
+  
   VIrms = emon1.calcIrms(1480) * 220.0;
   ave.push(VIrms);
   average = ave.mean();


  getResetInfo = "hello from ESP8266 s07 ";
  getResetInfo += ESP.getResetInfo().substring(0, 30);

  /*
  if (WiFi.status() == WL_CONNECTED) {
    if (!client.connected()) {
      if (client.connect((char*) clientName.c_str(), willTopic, 0, true, willMessage)) {
        client.publish(willTopic, "1", true);
        client.publish(hellotopic, (char*) getResetInfo.c_str());
        if (DEBUG_PRINT) {
          Serial.print("Sending payload: ");
          Serial.println(getResetInfo);
        }
      }
    } else {
      client.publish(willTopic, "1", true);
      client.publish(hellotopic, (char*) getResetInfo.c_str());
      if (DEBUG_PRINT) {
        Serial.print("Sending payload: ");
        Serial.println(getResetInfo);
      }
    }
  }
  */

  startMills = millis();
  sentMills = millis();


WiFiClient wifiClient;
PubSubClient client(wifiClient);

long lastReconnectAttempt = 0;

