diff --git a/platformio.ini b/platformio.ini index fb54d9c..086fe6f 100644 --- a/platformio.ini +++ b/platformio.ini @@ -14,7 +14,7 @@ framework = arduino monitor_speed = 115200 monitor_filters = esp8266_exception_decoder, default, time, printable, colorize -custom_prog_version = 2.0.0 +custom_prog_version = 2.0.1 build_flags = -DVERSION=${this.custom_prog_version} diff --git a/src/htmlProzessor.h b/src/htmlProzessor.h index 622715b..27883d6 100644 --- a/src/htmlProzessor.h +++ b/src/htmlProzessor.h @@ -3,9 +3,9 @@ String htmlProcessor(const String &var) { extern Settings _settings; if (var == F("pre_head_template")) - return (HTML_HEAD); + return (FPSTR(HTML_HEAD)); if (var == F("pre_foot_template")) - return (HTML_FOOT); + return (FPSTR(HTML_FOOT)); if (var == F("pre_software_version")) return (SOFTWARE_VERSION); if (var == F("pre_swversion")) @@ -16,7 +16,7 @@ String htmlProcessor(const String &var) return (String(ESP01).c_str()); if (var == F("pre_device_name")) return (_settings.data.deviceName); - if (var == ("pre_device_quantity")) + if (var == F("pre_device_quantity")) return (String(_settings.data.deviceQuantity).c_str()); if (var == F("pre_mqtt_server")) return (_settings.data.mqttServer); diff --git a/src/main.cpp b/src/main.cpp index 108ebf1..147ee80 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -29,6 +29,7 @@ bool restartNow = false; bool workerCanRun = true; unsigned long mqtttimer = 0; unsigned long RestartTimer = 0; +unsigned long notifyTimer = 0; byte ReqDevAddr = 1; char mqtt_server[80]; char mqttClientId[80]; @@ -439,7 +440,13 @@ bool epWorker() } else { - notifyClients(); // anyway, call the client something + if(errorcode != 0 && millis() > (notifyTimer +1000)){ + notifyClients(); // anyway, call the client something + notifyTimer = millis(); + } else if(errorcode == 0) { + notifyClients(); // anyway, call the client something + } + } // mqtt part, when time is come, fire up the mqtt function to send all data to the broker diff --git a/src/webpages/HTML_CONFIRM_RESET.html b/src/webpages/HTML_CONFIRM_RESET.html index d0ef6e3..aefb04e 100644 --- a/src/webpages/HTML_CONFIRM_RESET.html +++ b/src/webpages/HTML_CONFIRM_RESET.html @@ -1,6 +1,6 @@ %pre_head_template%