     Serial.print("failed, rc=");
     Serial.print(client.state());
   }
-  startMills = millis();
+  //startMills = millis();
   return client.connected();
 }
 

  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());

  startMills = millis();

  if (WiFi.status() == WL_CONNECTED) {
    if (!client.connected()) {
      if (client.connect((char*) clientName.c_str())) {
        client.publish(hellotopic, "hello again wifi and mqtt from ESP8266 s06");
        Serial.print("reconnecting wifi and mqtt");
      } else {
        Serial.print("mqtt publish fail after wifi reconnect");
      }
    } else {
      client.publish(hellotopic, "hello again wifi from ESP8266 s06");

#include <pgmspace.h>
#include <Wire.h>

#define _IS_MY_HOME 1
// wifi
#ifdef _IS_MY_HOME
#include "/usr/local/src/ap_setting.h"
#else
#include "ap_setting.h"
