 } //end reconnect()
 
 void setup() {
+
+  digitalWrite(LED, LOW);
+    Serial.begin(115200);
+    setup_wifi();
+  digitalWrite(LED, HIGH);
   
-  Serial.begin(115200);
-  setup_wifi();
   client.setServer(mqtt_server, 1883);
   client.setCallback(callback);
   pinMode(BUTTON_PIN,INPUT);
+
 }
 
 long lastActive = 0;

    {
      Serial.println("connected");
     //once connected to MQTT broker, subscribe command if any
     // client.subscribe("/theringbot/ring");
    } else {
      Serial.print("failed, rc=");
      Serial.print(client.state());

            char message[2];
            message[1] = 0;
            
                if(now-lastActive > 10*1000 ){
                  
                  message[0] = 'k';
                  Serial.println(message);
                  
                  //publish sensor data to MQTT broker
                  client.publish( topic , message);
                  lastActive = now;
                    
                }
                          
          }
          
          lastStatus = 1;
      
      }else{
       
          lastStatus  = 0;
     
     }
