Browse Source

change powerbank_interval

lightsleep
Hendrik Langer 7 years ago
parent
commit
7316d8444f
  1. 8
      src/main.cpp

8
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();

Loading…
Cancel
Save