sensor.ino aktualisiert
This commit is contained in:
parent
85670b839a
commit
d361e4c380
18
sensor.ino
18
sensor.ino
@ -117,6 +117,7 @@ void setup() {
|
|||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
if ((millis() - lastTime) > timerDelay) {
|
if ((millis() - lastTime) > timerDelay) {
|
||||||
|
lastTime = millis();
|
||||||
//timeClient.update();
|
//timeClient.update();
|
||||||
//Get a time structure
|
//Get a time structure
|
||||||
//time_t epochTime = timeClient.getEpochTime();
|
//time_t epochTime = timeClient.getEpochTime();
|
||||||
@ -140,7 +141,15 @@ void loop() {
|
|||||||
Serial.printf("TVOC = %d \n", tvoc);
|
Serial.printf("TVOC = %d \n", tvoc);
|
||||||
Serial.println();
|
Serial.println();
|
||||||
|
|
||||||
if(WiFi.status()== WL_CONNECTED){
|
if(WiFi.status()!= WL_CONNECTED){
|
||||||
|
Serial.println("WiFi Disconnected");
|
||||||
|
WiFi.begin(WIFI_SSID, WIFI_PASS);
|
||||||
|
while (WiFi.status() != WL_CONNECTED)
|
||||||
|
{
|
||||||
|
delay(100);
|
||||||
|
Serial.print(".1.");
|
||||||
|
}
|
||||||
|
}
|
||||||
WiFiClientSecure client;
|
WiFiClientSecure client;
|
||||||
client.setInsecure();
|
client.setInsecure();
|
||||||
HTTPClient http;
|
HTTPClient http;
|
||||||
@ -159,15 +168,8 @@ void loop() {
|
|||||||
|
|
||||||
// Free resources
|
// Free resources
|
||||||
http.end();
|
http.end();
|
||||||
}
|
|
||||||
else {
|
|
||||||
Serial.println("WiFi Disconnected");
|
|
||||||
WiFi.begin(WIFI_SSID, WIFI_PASS);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
lastTime = millis();
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user