 
     // note the time that the connection was made:
     lastConnectionTime = millis();
+    return true;
   }
   else {
     // if you couldn't make a connection:
     Serial.println("connection to azure webservice failed");
+    reconnetWifi();
+    return false;
   }
 }
 

           Serial.print(duration);
           Serial.println(" sec");    
           delay(50);
          azureHttpPost("{deviceId:NeshMKR100Dev1, motion:0,elapsed:"+ duration + "}");  
    }
  }
}
boolean lockLow = true;
boolean takeLowTime;  
String duration ="0";
boolean webServiceSucceeded;

///*** WiFi Network Config ***///
char ssid[] = "YourWifiSSID"; //  your network SSID (name)
