diff --git a/CHANGELOG.md b/CHANGELOG.md index 4556aef40..47d17bb0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,7 @@ There are breaking changes in this release. See `publish_time` below and make su ### Removed - thermostat scan and autodetect deep functions +- removed Event Logging to SPIFFS (worried about wearing). Replaced with SysLog. ## [1.9.3] 2019-10-26 diff --git a/platformio.ini b/platformio.ini index 0a212feed..c0976bdcf 100644 --- a/platformio.ini +++ b/platformio.ini @@ -16,9 +16,25 @@ default_envs = release ;custom_flags = -DFORCE_SERIAL -DMYESP_DEBUG custom_flags = -;general_flags = -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH_LOW_FLASH -DVTABLES_IN_FLASH -general_flags = -fno-exceptions -lstdc++ -DNO_GLOBAL_EEPROM -DBEARSSL_SSL_BASIC -;general_flags = +# +# Available lwIP variants (macros): +# -DPIO_FRAMEWORK_ARDUINO_LWIP_HIGHER_BANDWIDTH = v1.4 Higher Bandwidth (default) +# -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY = v2 Lower Memory +# -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH = v2 Higher Bandwidth +# -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH_LOW_FLASH +# -DPIO_FRAMEWORK_ARDUINO_LWIP2_IPV6_LOW_MEMORY +# Other flags +# -DVTABLES_IN_FLASH +# -DNO_GLOBAL_EEPROM +# -DBEARSSL_SSL_BASIC +general_flags = -std=c++11 -DNO_GLOBAL_EEPROM -DBEARSSL_SSL_BASIC -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY + +# From https://github.com/esp8266/Arduino/blob/master/tools/sdk/ld +# eagle.flash.4m1m.ld = 1019 KB sketch, 1000 KB SPIFFS. 4KB EEPROM, 4KB RFCAL, 12KB WIFI stack, 2052 KB OTA & buffer +# eagle.flash.4m2m.ld = same as above but with 2024 KB SPIFFS +# eagle.flash.4m.ld = same as above but with no SPIFFS storage +build_flags_4m1m = -Wl,-Teagle.flash.4m1m.ld +build_flags = ${common.general_flags} ${common.build_flags_4m1m} [env] framework = arduino @@ -26,13 +42,13 @@ platform = espressif8266 lib_deps = https://github.com/rlogiacco/CircularBuffer https://github.com/PaulStoffregen/OneWire - ;https://github.com/me-no-dev/ESPAsyncWebServer - https://github.com/me-no-dev/ESPAsyncWebServer#b0c6144 + https://github.com/me-no-dev/ESPAsyncWebServer + ;https://github.com/me-no-dev/ESPAsyncWebServer#b0c6144 https://github.com/bakercp/CRC32 JustWifi@2.0.2 AsyncMqttClient@0.8.2 EEPROM_Rotate@0.9.2 - ArduinoJson@6.12.0 + ArduinoJson@6.13.0 ESPAsyncUDP ESPAsyncTCP@1.2.2 upload_speed = 921600 @@ -51,27 +67,27 @@ upload_port = ems-esp.local # Do not modify [env:travis] board = esp12e -build_flags = ${common.general_flags} +build_flags = ${common.build_flags} extra_scripts = scripts/main_script.py [env:esp12e] board = esp12e -build_flags = ${common.general_flags} +build_flags = ${common.build_flags} extra_scripts = scripts/main_script.py [env:d1_mini] board = d1_mini -build_flags = ${common.general_flags} +build_flags = ${common.build_flags} extra_scripts = scripts/main_script.py [env:nodemcuv2] board = nodemcuv2 -build_flags = ${common.general_flags} +build_flags = ${common.build_flags} extra_scripts = scripts/main_script.py [env:nodemcu] board = nodemcu -build_flags = ${common.general_flags} +build_flags = ${common.build_flags} extra_scripts = scripts/main_script.py # @@ -80,7 +96,7 @@ extra_scripts = scripts/main_script.py [env:debug] board = d1_mini build_type = debug -build_flags = ${common.general_flags} ${common.custom_flags} +build_flags = ${common.build_flags} ${common.custom_flags} extra_scripts = pre:scripts/pre_script.py scripts/main_script.py @@ -88,7 +104,7 @@ extra_scripts = [env:release] board = d1_mini build_type = release -build_flags = ${common.general_flags} ${common.custom_flags} +build_flags = ${common.build_flags} ${common.custom_flags} extra_scripts = pre:scripts/pre_script.py scripts/main_script.py \ No newline at end of file diff --git a/src/MyESP.cpp b/src/MyESP.cpp index c903d84f7..de6294244 100644 --- a/src/MyESP.cpp +++ b/src/MyESP.cpp @@ -380,7 +380,9 @@ bool MyESP::mqttSubscribe(const char * topic) { char * topic_s = _mqttTopic(topic); uint16_t packet_id = mqttClient.subscribe(topic_s, _mqtt_qos); - // myDebug_P(PSTR("[MQTT] Subscribing to %s"), topic_s); +#ifdef MYESP_DEBUG + myDebug_P(PSTR("[MQTT] Subscribing to %s"), topic_s); +#endif if (packet_id) { // add to mqtt log @@ -497,7 +499,6 @@ void MyESP::_mqtt_setup() { // last will if (_hasValue(_mqtt_will_topic)) { - //myDebug_P(PSTR("[MQTT] Setting last will topic %s"), _mqttTopic(_mqtt_will_topic)); mqttClient.setWill(_mqttTopic(_mqtt_will_topic), 1, true, _mqtt_will_offline_payload); // retain always true } @@ -650,7 +651,9 @@ void MyESP::_telnetConnected() { } void MyESP::_telnetDisconnected() { - // myDebug_P(PSTR("[TELNET] Telnet connection closed")); +#ifdef MYESP_DEBUG + myDebug_P(PSTR("[TELNET] Telnet connection closed")); +#endif if (_telnet_callback_f) { (_telnet_callback_f)(TELNET_EVENT_DISCONNECT); // call callback } @@ -1144,7 +1147,6 @@ void MyESP::_setSystemBootStatus(uint8_t status) { data.value = Rtcmem->sys; data.parts.boot_status = status; Rtcmem->sys = data.value; - // myDebug("*** setting boot status to %d", data.parts.boot_status); } uint8_t MyESP::_getSystemStabilityCounter() { @@ -1677,104 +1679,6 @@ size_t MyESP::_fs_validateConfigFile(const char * filename, size_t maxsize, Json return size; } -// validates the event log file in SPIFFS -// returns true if all OK -size_t MyESP::_fs_validateLogFile(const char * filename) { - // exit if we have disabled logging - if (!_general_log_events) { - return 0; - } - - // see if we can open it - File eventlog = SPIFFS.open(filename, "r"); - if (!eventlog) { - myDebug_P(PSTR("[FS] File %s not found"), filename); - return 0; - } - - // check sizes - size_t size = eventlog.size(); - size_t maxsize = ESP.getFreeHeap() - 2000; // reserve some buffer -#ifdef MYESP_DEBUG - myDebug_P(PSTR("[FS] Checking file %s (%d/%d bytes)"), filename, size, maxsize); -#endif - if (size > maxsize) { - eventlog.close(); - myDebug_P(PSTR("[FS] File %s size %d is too large"), filename, size); - return 0; - } else if (size == 0) { - eventlog.close(); - myDebug_P(PSTR("[FS] Corrupted file %s"), filename); - return 0; - } - - /* - // check integrity by reading file from SPIFFS into the char array - char * buffer = new char[size + 2]; // reserve some memory to read in the file - size_t real_size = file.readBytes(buffer, size); - if (real_size != size) { - file.close(); - myDebug_P(PSTR("[FS] Error, file %s sizes don't match (%d/%d), looks corrupted"), filename, real_size, size); - delete[] buffer; - return false; - } - file.close(); - delete[] buffer; - */ - - /* - File configFile = SPIFFS.open(filename, "r"); - myDebug_P(PSTR("[FS] File: ")); - while (configFile.available()) { - SerialAndTelnet.print((char)configFile.read()); - } - myDebug_P(PSTR("[FS] end")); // newline - configFile.close(); - */ - - // parse it to check JSON validity - // its slow but the only reliable way to check integrity of the file - uint16_t char_count = 0; - bool abort = false; - char char_buffer[MYESP_JSON_LOG_MAXSIZE]; - StaticJsonDocument doc; - - // eventlog.seek(0); - while (eventlog.available() && !abort) { - char c = eventlog.read(); // read a char - - // see if we have reached the end of the string - if (c == '\0' || c == '\n') { - char_buffer[char_count] = '\0'; // terminate and add it to the list -#ifdef MYESP_DEBUG - Serial.printf("Got line: %s\n", char_buffer); -#endif - // validate it by looking at JSON structure - DeserializationError error = deserializeJson(doc, char_buffer); - if (error) { - myDebug_P(PSTR("[FS] Event log has a corrupted entry (error %s)"), error.c_str()); - abort = true; - } - char_count = 0; // start new record - } else { - // add the char to the buffer if recording, checking for overrun - if (char_count < MYESP_JSON_LOG_MAXSIZE) { - char_buffer[char_count++] = c; - } else { - abort = true; // reached limit of our line buffer - } - } - } - - eventlog.close(); - - if (abort) { - return 0; - } - - return size; -} - // format File System void MyESP::_fs_eraseConfig() { myDebug_P(PSTR("[FS] Performing a factory reset...")); @@ -1795,12 +1699,6 @@ void MyESP::setSettings(fs_loadsave_callback_f loadsave, fs_setlist_callback_f s // load system config from SPIFFS // returns false on error or the file needs to be recreated bool MyESP::_fs_loadConfig() { - // see if old file exists and delete it - if (SPIFFS.exists("/config.json")) { - SPIFFS.remove("/config.json"); - myDebug_P(PSTR("[FS] Removed old config version")); - } - StaticJsonDocument doc; // set to true to print out contents of file @@ -1973,20 +1871,9 @@ bool MyESP::fs_saveCustomConfig(JsonObject root) { configFile.close(); if (n) { - /* - // reload the settings, not sure why? - if (_fs_loadsave_callback_f) { - if (!(_fs_loadsave_callback_f)(MYESP_FSACTION_LOAD, root)) { - myDebug_P(PSTR("[FS] Error parsing custom config json")); - } - } - */ - if (_general_log_events) { - _writeEvent("INFO", "system", "Custom config stored in the SPIFFS", ""); + _writeLogEvent("INFO", "system", "Custom config stored in the SPIFFS", ""); } - - // myDebug_P(PSTR("[FS] custom config saved")); ok = true; } } @@ -2020,9 +1907,8 @@ bool MyESP::fs_saveConfig(JsonObject root) { if (n) { if (_general_log_events) { - _writeEvent("INFO", "system", "System config stored in the SPIFFS", ""); + _writeLogEvent("INFO", "system", "System config stored in the SPIFFS", ""); } - // myDebug_P(PSTR("[FS] system config saved")); ok = true; } @@ -2122,30 +2008,16 @@ void MyESP::_fs_setup() { } } - /* - // fill event log with tests - SPIFFS.remove(MYESP_EVENTLOG_FILE); - File fs = SPIFFS.open(MYESP_EVENTLOG_FILE, "w"); - fs.close(); - char logs[100]; - for (uint8_t i = 1; i < 143; i++) { - sprintf(logs, "Record #%d", i); - _writeEvent("WARN", "system", "test data", logs); + // see if old files exists from previous versions and delete it + if (SPIFFS.exists(MYESP_OLD_CONFIG_FILE)) { + SPIFFS.remove(MYESP_OLD_CONFIG_FILE); + myDebug_P(PSTR("[FS] Removed old config settings")); } - */ - // validate the event log. Sometimes it can can corrupted. - size_t size = _fs_validateLogFile(MYESP_EVENTLOG_FILE); - if (size) { - myDebug_P(PSTR("[FS] Event log loaded (%d bytes)"), size); - } else { -#ifndef MYESP_DEBUG - myDebug_P(PSTR("[FS] Resetting event log")); - SPIFFS.remove(MYESP_EVENTLOG_FILE); - if (_general_log_events) { - _writeEvent("WARN", "system", "Event Log", "Log was erased due to probable file corruption"); - } -#endif + // see if old file exists and delete it + if (SPIFFS.exists(MYESP_OLD_CONFIG_FILE)) { + SPIFFS.remove(MYESP_OLD_CONFIG_FILE); + myDebug_P(PSTR("[FS] Removed old config settings")); } // load the main system config file if we can. Otherwise create it and expect user to configure in web interface @@ -2380,127 +2252,13 @@ void MyESP::crashInfo() { } #endif -// write a log entry to SPIFFS +// write a log entry to SysLog via UDP // assumes we have "log_events" on -void MyESP::_writeEvent(const char * type, const char * src, const char * desc, const char * data) { - // this will also create the file if its doesn't exist - File eventlog = SPIFFS.open(MYESP_EVENTLOG_FILE, "a"); - if (!eventlog) { +void MyESP::_writeLogEvent(const char * type, const char * src, const char * desc, const char * data) { + // TODO: finish function #ifdef MYESP_DEBUG - Serial.println("[SYSTEM] Error opening event log for writing"); + Serial.printf("%s: %s\n", type, desc); #endif - eventlog.close(); - return; - } - - StaticJsonDocument root; - root["type"] = type; - root["src"] = src; - root["desc"] = desc; - root["data"] = data; - root["time"] = now(); // is relative if we're not using NTP - - // Serialize JSON to file - (void)serializeJson(root, eventlog); - - eventlog.print("\n"); // this indicates end of the entry - - eventlog.close(); -} - -// send a paged list (10 items) to the ws -void MyESP::_sendEventLog(uint8_t page) { - if (_ota_pre_callback_f) { - (_ota_pre_callback_f)(); // call custom function - } - - File eventlog; - // if its missing create it, it'll be empty though - if (!SPIFFS.exists(MYESP_EVENTLOG_FILE)) { - myDebug_P(PSTR("[FS] Event log is missing. Creating it.")); - eventlog = SPIFFS.open(MYESP_EVENTLOG_FILE, "w"); - eventlog.close(); - } - - eventlog = SPIFFS.open(MYESP_EVENTLOG_FILE, "r"); - - // the size of the json will be quite big so best not to use stack (StaticJsonDocument) - // it only covers 10 log entries - DynamicJsonDocument doc(MYESP_JSON_MAXSIZE); - JsonObject root = doc.to(); - root["command"] = "eventlist"; - root["page"] = page; - - JsonArray list = doc.createNestedArray("list"); - - size_t static lastPos; - // if first page, reset the file pointer - if (page == 1) { - lastPos = 0; - } - - eventlog.seek(lastPos); // move to position in file - - uint8_t char_count = 0; - uint8_t line_count = 0; - bool abort = false; - char char_buffer[MYESP_JSON_LOG_MAXSIZE]; - float pages; - - // start at top and read until we find the page we want (sets of 10) - while (eventlog.available() && !abort) { - char c = eventlog.read(); - - // see if we have reached the end of the string - if (c == '\0' || c == '\n') { - char_buffer[char_count] = '\0'; // terminate and add it to the list -#ifdef MYESP_DEBUG - Serial.printf("Got line %d: %s\n", line_count + 1, char_buffer); -#endif - list.add(char_buffer); - // increment line counter and check if we've reached 10 records, if so abort - if (++line_count == 10) { - abort = true; - } - char_count = 0; // start new record - } else { - // add the char to the buffer if recording, checking for overrun - if (char_count < MYESP_JSON_LOG_MAXSIZE) { - char_buffer[char_count++] = c; - } else { - abort = true; // reached limit of our line buffer - } - } - } - - lastPos = eventlog.position(); // remember last position for next cycle - - // calculate remaining pages, as needed for footable - if (eventlog.available()) { - float totalPagesRoughly = eventlog.size() / (float)(lastPos / page); - pages = totalPagesRoughly < page ? page + 1 : totalPagesRoughly; - } else { - pages = page; // this was the last page - } - - eventlog.close(); // close SPIFFS - - root["haspages"] = ceil(pages); - - char buffer[MYESP_JSON_MAXSIZE]; - size_t len = serializeJson(root, buffer); - -#ifdef MYESP_DEBUG - Serial.printf("\nEVENTLOG: page %d, length=%d\n", page, len); - serializeJson(root, Serial); -#endif - - _ws->textAll(buffer, len); - _ws->textAll("{\"command\":\"result\",\"resultof\":\"eventlist\",\"result\": true}"); - - if (_ota_post_callback_f) { - (_ota_post_callback_f)(); // call custom function - } } // Handles WebSocket Events @@ -2556,7 +2314,7 @@ void MyESP::_procMsg(AsyncWebSocketClient * client, size_t sz) { const char * command = doc["command"]; #ifdef MYESP_DEBUG - Serial.printf("*** Got command: %s\n", command); + myDebug("*** Got command: %s\n", command); #endif // Check whatever the command is and act accordingly @@ -2574,19 +2332,10 @@ void MyESP::_procMsg(AsyncWebSocketClient * client, size_t sz) { _formatreq = true; } else if (strcmp(command, "forcentp") == 0) { NTP.getNtpTime(); - } else if (strcmp(command, "geteventlog") == 0) { - uint8_t page = doc["page"]; - _sendEventLog(page); - } else if (strcmp(command, "clearevent") == 0) { - _emptyEventLog(); } else if (strcmp(command, "scan") == 0) { WiFi.scanNetworksAsync(std::bind(&MyESP::_printScanResult, this, std::placeholders::_1), true); } else if (strcmp(command, "gettime") == 0) { _timerequest = true; - } else if (strcmp(command, "settime") == 0) { - time_t t = doc["epoch"]; - setTime(t); - _timerequest = true; } else if (strcmp(command, "getconf") == 0) { _fs_sendConfig(); } @@ -2595,22 +2344,6 @@ void MyESP::_procMsg(AsyncWebSocketClient * client, size_t sz) { client->_tempObject = NULL; } -// delete the event log -void MyESP::_emptyEventLog() { - if (_ota_pre_callback_f) { - (_ota_pre_callback_f)(); // call custom function - } - if (SPIFFS.remove(MYESP_EVENTLOG_FILE)) { - _writeEvent("WARN", "system", "Event log cleared", ""); - myDebug_P(PSTR("[WEB] Event log cleared")); - } else { - myDebug_P(PSTR("[WEB] Could not clear event log")); - } - if (_ota_post_callback_f) { - (_ota_post_callback_f)(); // call custom function - } -} - // read both system config and the custom config and send as json to web socket bool MyESP::_fs_sendConfig() { File configFile; @@ -2632,7 +2365,7 @@ bool MyESP::_fs_sendConfig() { configFile.close(); #ifdef MYESP_DEBUG - Serial.printf("_fs_sendConfig() sending system (%d): %s\n", size, json); + myDebug("_fs_sendConfig() sending system (%d): %s\n", size, json); #endif _ws->textAll(json, size); @@ -2653,7 +2386,7 @@ bool MyESP::_fs_sendConfig() { configFile.close(); #ifdef MYESP_DEBUG - Serial.printf("_fs_sendConfig() sending custom (%d): %s\n", size, json); + myDebug("_fs_sendConfig() sending custom (%d): %s\n", size, json); #endif _ws->textAll(json, size); @@ -2684,7 +2417,7 @@ void MyESP::_sendCustomStatus() { size_t len = serializeJson(root, buffer); #ifdef MYESP_DEBUG - Serial.printf("_sendCustomStatus() sending: %s\n", buffer); + myDebug("_sendCustomStatus() sending: %s\n", buffer); #endif _ws->textAll(buffer, len); @@ -2836,13 +2569,10 @@ void MyESP::_webserver_setup() { } if (!index) { ETS_UART_INTR_DISABLE(); // disable all UART interrupts to be safe - _writeEvent("INFO", "system", "Firmware update started", ""); -#ifdef MYESP_DEBUG - Serial.printf("[SYSTEM] Firmware update started: %s\n", filename.c_str()); -#endif + _writeLogEvent("INFO", "system", "Firmware update started", ""); Update.runAsync(true); if (!Update.begin((ESP.getFreeSketchSpace() - 0x1000) & 0xFFFFF000)) { - _writeEvent("ERRO", "system", "Not enough space to update", ""); + _writeLogEvent("ERRO", "system", "Not enough space to update", ""); #ifdef MYESP_DEBUG Update.printError(Serial); #endif @@ -2850,7 +2580,7 @@ void MyESP::_webserver_setup() { } if (!Update.hasError()) { if (Update.write(data, len) != len) { - _writeEvent("ERRO", "system", "Writing to flash failed", ""); + _writeLogEvent("ERRO", "system", "Writing to flash failed", ""); #ifdef MYESP_DEBUG Update.printError(Serial); #endif @@ -2858,10 +2588,10 @@ void MyESP::_webserver_setup() { } if (final) { if (Update.end(true)) { - _writeEvent("INFO", "system", "Firmware update finished", ""); + _writeLogEvent("INFO", "system", "Firmware update finished", ""); _shouldRestart = !Update.hasError(); } else { - _writeEvent("ERRO", "system", "Firmware update failed", ""); + _writeLogEvent("ERRO", "system", "Firmware update failed", ""); #ifdef MYESP_DEBUG Update.printError(Serial); #endif @@ -3036,7 +2766,7 @@ void MyESP::_bootupSequence() { if ((_ntp_enabled) && (now() > 10000) && !_have_ntp_time) { _have_ntp_time = true; if (_general_log_events) { - _writeEvent("INFO", "system", "System booted", ""); + _writeLogEvent("INFO", "system", "System booted", ""); } } return; @@ -3068,7 +2798,7 @@ void MyESP::_bootupSequence() { // write a log message if we're not using NTP, otherwise wait for the internet time to arrive if (!_ntp_enabled) { if (_general_log_events) { - _writeEvent("INFO", "system", "System booted", ""); + _writeLogEvent("INFO", "system", "System booted", ""); } } } @@ -3151,7 +2881,7 @@ void MyESP::loop() { if (_shouldRestart) { if (_general_log_events) { - _writeEvent("INFO", "system", "System is restarting", ""); + _writeLogEvent("INFO", "system", "System is restarting", ""); } myDebug("[SYSTEM] Restarting..."); _deferredReset(500, CUSTOM_RESET_TERMINAL); diff --git a/src/MyESP.h b/src/MyESP.h index c014b4c7f..f875b9d29 100644 --- a/src/MyESP.h +++ b/src/MyESP.h @@ -9,7 +9,7 @@ #ifndef MyESP_h #define MyESP_h -#define MYESP_VERSION "1.2.19" +#define MYESP_VERSION "1.2.20" #include #include @@ -53,7 +53,8 @@ extern struct rst_info resetInfo; #define MYESP_CONFIG_FILE "/myesp.json" #define MYESP_CUSTOMCONFIG_FILE "/customconfig.json" -#define MYESP_EVENTLOG_FILE "/eventlog.json" +#define MYESP_EVENTLOG_FILE "/eventlog.json" // depreciated +#define MYESP_OLD_CONFIG_FILE "/config.json" // depreciated #define MYESP_HTTP_USERNAME "admin" // HTTP username #define MYESP_HTTP_PASSWORD "admin" // default password @@ -67,7 +68,6 @@ extern struct rst_info resetInfo; #define MYESP_WIFI_RECONNECT_INTERVAL 600000 // If could not connect to WIFI, retry after this time in ms. 10 minutes // set to value >0 if the ESP is overheating or there are timing issues. Recommend a value of 1. -// initially set to 0 for no delay. Change to 1 if getting WDT resets from wifi #define MYESP_DELAY 1 // MQTT @@ -266,8 +266,8 @@ class MyESP { MyESP(); ~MyESP(); - // write event called from within lambda classs - static void _writeEvent(const char * type, const char * src, const char * desc, const char * data); + // write event called from within lambda class + static void _writeLogEvent(const char * type, const char * src, const char * desc, const char * data); // wifi void setWIFICallback(void (*callback)()); @@ -475,10 +475,6 @@ class MyESP { web_callback_f _web_callback_f; const char * _http_username; - // log - void _sendEventLog(uint8_t page); - void _emptyEventLog(); - // web void _onWsEvent(AsyncWebSocket * server, AsyncWebSocketClient * client, AwsEventType type, void * arg, uint8_t * data, size_t len); void _procMsg(AsyncWebSocketClient * client, size_t sz); diff --git a/src/ems-esp.cpp b/src/ems-esp.cpp index 15e1aa59d..50a61b1ac 100644 --- a/src/ems-esp.cpp +++ b/src/ems-esp.cpp @@ -1702,7 +1702,7 @@ void WebCallback(JsonObject root) { } } else { emsbus["ok"] = false; - emsbus["msg"] = "EMS Bus is not connected. Check event logs for errors."; + emsbus["msg"] = "EMS Bus is not connected."; } } diff --git a/src/ems.cpp b/src/ems.cpp index 6a02f90b7..302e27aeb 100644 --- a/src/ems.cpp +++ b/src/ems.cpp @@ -1323,7 +1323,6 @@ void _process_UBAMonitorFast(_EMS_RxTelegram * EMS_RxTelegram) { */ void _process_UBAMonitorFast2(_EMS_RxTelegram * EMS_RxTelegram) { EMS_Boiler.selFlowTemp = _toByte(6); - // EMS_Boiler.retTemp = _toShort(13); EMS_Boiler.burnGas = _bitRead(11, 0); EMS_Boiler.wWHeat = _bitRead(11, 2); @@ -1331,23 +1330,21 @@ void _process_UBAMonitorFast2(_EMS_RxTelegram * EMS_RxTelegram) { EMS_Boiler.curBurnPow = _toByte(10); EMS_Boiler.selBurnPow = _toByte(9); // burn power max setting - // set boiler temp only if we actually have a real value if (_toShort(7) != EMS_VALUE_USHORT_NOTSET) { - EMS_Boiler.boilTemp = _toShort(7); // 0x8000 if not available + EMS_Boiler.curFlowTemp = _toShort(7); // 0x8000 if not available } EMS_Boiler.flameCurr = _toShort(19); - // system pressure. FF means missing - // EMS_Boiler.sysPress = _toByte(17); // this is *10 - // read the service code / installation status as appears on the display EMS_Boiler.serviceCodeChar[0] = char(_toByte(4)); // ascii character 1 EMS_Boiler.serviceCodeChar[1] = char(_toByte(5)); // ascii character 2 EMS_Boiler.serviceCodeChar[2] = '\0'; // null terminate string - // read error code - // EMS_Boiler.serviceCode = _toShort(20); + // still to figure out: + // EMS_Boiler.serviceCode + // EMS_Boiler.retTemp + // EMS_Boiler.sysPress // at this point do a quick check to see if the hot water or heating is active _checkActive(); @@ -1363,8 +1360,7 @@ void _process_UBAMonitorSlow(_EMS_RxTelegram * EMS_RxTelegram) { EMS_Boiler.extTemp = _toShort(0); } - EMS_Boiler.curFlowTemp = _toShort(2); - + EMS_Boiler.boilTemp = _toShort(2); // 0x8000 if not available EMS_Boiler.pumpMod = _toByte(9); EMS_Boiler.burnStarts = _toLong(10); EMS_Boiler.burnWorkMin = _toLong(13); diff --git a/src/websrc/index.html b/src/websrc/index.html index 0bd7ac770..913e8d81c 100644 --- a/src/websrc/index.html +++ b/src/websrc/index.html @@ -52,9 +52,6 @@ -
  • - Event Log -
  • Backup & Restore
  • diff --git a/src/websrc/myesp.htm b/src/websrc/myesp.htm index 33617f7f0..b23e0c091 100644 --- a/src/websrc/myesp.htm +++ b/src/websrc/myesp.htm @@ -119,7 +119,7 @@
    + data-content="Enabling logging of all events to a remote SysLog">
    -
    -
    -
    Loading Logs. Please wait...
    -
    -
    -
    -
    - Event Log -
    Dates shown in () represent elapsed time in seconds when NTP Time is disabled
    -
    Event Logging has been disabled. See Settings->General Settings. -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    -

    MQTT Settings @@ -386,14 +360,6 @@
    -
    - - -
    - -
    -
    -