         Serial.print(client.state());
       }
       unsigned long now = millis();
-      //      if (now - lastReconnectAttempt > 5000) {
       if (now - lastReconnectAttempt > 1000) {
         lastReconnectAttempt = now;
         if (reconnect()) {

#define DOORPIN 5

//#define REPORT_INTERVAL 60000 // in msec
#define REPORT_INTERVAL 3000 // in msec

volatile unsigned long startMills ;
volatile unsigned long revMills ;

#endif

#define DEBUG_PRINT 0

//#define IPSET_STATIC { 192, 168, 10, 16 }
#define IPSET_GATEWAY { 192, 168, 10, 1 }
#define IPSET_SUBNET { 255, 255, 255, 0 }
#define IPSET_DNS { 192, 168, 10, 10 }

// ****************
void sendmqttMsg(char* topictosend, String payloadtosend);
void callback(char* intopic, byte* inpayload, unsigned int length);
String macToStr(const uint8_t* mac);
void IRCHECKING_START();
void DOORCHECKING();
void count_powermeter();

// ****************
const char* ssid = WIFI_SSID;
const char* password = WIFI_PASSWORD;
//int32_t channel = WIFI_CHANNEL;
//byte bssid[] = WIFI_BSSID;
byte mqtt_server[] = MQTT_SERVER;
//
//byte ip_static[] = IPSET_STATIC;
byte ip_gateway[] = IPSET_GATEWAY;
byte ip_subnet[] = IPSET_SUBNET;
byte ip_dns[] = IPSET_DNS;
// ****************


// ********** change MQTT_KEEPALIVE to 60 at PubSubClient.h *****************
EnergyMonitor emon1;
