From 7316d8444f3519e7ce18ae523784836b21734091 Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Tue, 5 Jun 2018 16:24:15 +0200 Subject: [PATCH] change powerbank_interval --- src/main.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 59ae151..e906da8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -27,7 +27,8 @@ const char* server = "ingress.opensensemap.org"; //const char* password = ""; constexpr unsigned int postingInterval = 60000; //Uploadintervall in Millisekunden -constexpr unsigned int powerbankInterval = 10000; +constexpr unsigned int powerbankInterval = 10000/2; +constexpr unsigned int powerbankInterval_max = 10000; constexpr unsigned int dhcp_interval = 60*60*1000; //senseBox ID @@ -218,6 +219,7 @@ void ICACHE_FLASH_ATTR sendValues() { WiFi.mode(WIFI_STA); wifiMulti.addAP("nether.net", "password1"); wifiMulti.addAP("LNet", "password2"); + wifiMulti.addAP("hw1_gast", "password3"); wifiMulti.addAP("Freifunk", ""); if ( ip != INADDR_NONE && dns != INADDR_NONE && gateway != INADDR_NONE && subnet != INADDR_NONE @@ -234,7 +236,7 @@ void ICACHE_FLASH_ATTR sendValues() { while (WiFi.status() != WL_CONNECTED) { tries++; Serial.print("."); - if (tries*retry_delay >= powerbankInterval) { + if (tries*retry_delay >= powerbankInterval_max) { Serial.println(" [ERROR]"); Serial.println("Retrying in 10 seconds.."); sendESPNOW(); @@ -254,7 +256,7 @@ void ICACHE_FLASH_ATTR sendValues() { while (wifiMulti.run() != WL_CONNECTED) { tries++; Serial.print("."); - if (tries*retry_delay >= powerbankInterval) { + if (tries*retry_delay >= powerbankInterval_max) { Serial.println(" [ERROR]"); Serial.println("Retrying in 10 seconds.."); sendESPNOW();