|
@ -27,7 +27,8 @@ const char* server = "ingress.opensensemap.org"; |
|
|
//const char* password = "";
|
|
|
//const char* password = "";
|
|
|
|
|
|
|
|
|
constexpr unsigned int postingInterval = 60000; //Uploadintervall in Millisekunden
|
|
|
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; |
|
|
constexpr unsigned int dhcp_interval = 60*60*1000; |
|
|
|
|
|
|
|
|
//senseBox ID
|
|
|
//senseBox ID
|
|
@ -218,6 +219,7 @@ void ICACHE_FLASH_ATTR sendValues() { |
|
|
WiFi.mode(WIFI_STA); |
|
|
WiFi.mode(WIFI_STA); |
|
|
wifiMulti.addAP("nether.net", "password1"); |
|
|
wifiMulti.addAP("nether.net", "password1"); |
|
|
wifiMulti.addAP("LNet", "password2"); |
|
|
wifiMulti.addAP("LNet", "password2"); |
|
|
|
|
|
wifiMulti.addAP("hw1_gast", "password3"); |
|
|
wifiMulti.addAP("Freifunk", ""); |
|
|
wifiMulti.addAP("Freifunk", ""); |
|
|
|
|
|
|
|
|
if ( ip != INADDR_NONE && dns != INADDR_NONE && gateway != INADDR_NONE && subnet != INADDR_NONE |
|
|
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) { |
|
|
while (WiFi.status() != WL_CONNECTED) { |
|
|
tries++; |
|
|
tries++; |
|
|
Serial.print("."); |
|
|
Serial.print("."); |
|
|
if (tries*retry_delay >= powerbankInterval) { |
|
|
if (tries*retry_delay >= powerbankInterval_max) { |
|
|
Serial.println(" [ERROR]"); |
|
|
Serial.println(" [ERROR]"); |
|
|
Serial.println("Retrying in 10 seconds.."); |
|
|
Serial.println("Retrying in 10 seconds.."); |
|
|
sendESPNOW(); |
|
|
sendESPNOW(); |
|
@ -254,7 +256,7 @@ void ICACHE_FLASH_ATTR sendValues() { |
|
|
while (wifiMulti.run() != WL_CONNECTED) { |
|
|
while (wifiMulti.run() != WL_CONNECTED) { |
|
|
tries++; |
|
|
tries++; |
|
|
Serial.print("."); |
|
|
Serial.print("."); |
|
|
if (tries*retry_delay >= powerbankInterval) { |
|
|
if (tries*retry_delay >= powerbankInterval_max) { |
|
|
Serial.println(" [ERROR]"); |
|
|
Serial.println(" [ERROR]"); |
|
|
Serial.println("Retrying in 10 seconds.."); |
|
|
Serial.println("Retrying in 10 seconds.."); |
|
|
sendESPNOW(); |
|
|
sendESPNOW(); |
|
|