diff --git a/.gitignore b/.gitignore index 70ec5cfc7..7d0802d8a 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ platformio.ini lib/readme.txt .travis.yml +stackdmp.txt \ No newline at end of file diff --git a/lib/MyESP/MyESP.h b/lib/MyESP/MyESP.h index 097a767fc..393cae003 100644 --- a/lib/MyESP/MyESP.h +++ b/lib/MyESP/MyESP.h @@ -76,7 +76,7 @@ extern "C" { #define COLOR_BOLD_OFF "\x1B[22m" // fixed by Scott Arlott // SPIFFS -#define SPIFFS_MAXSIZE 500 // https://arduinojson.org/v5/assistant/ +#define SPIFFS_MAXSIZE 500 // https://arduinojson.org/v6/assistant/ // CRASH #define SAVE_CRASH_EEPROM_OFFSET 0x0100 // initial address for crash data diff --git a/src/ems-esp.ino b/src/ems-esp.ino index 4d93fe067..26205d65b 100644 --- a/src/ems-esp.ino +++ b/src/ems-esp.ino @@ -327,7 +327,7 @@ void showInfo() { _renderIntValue("Burner current power", "%", EMS_Boiler.curBurnPow); _renderFloatValue("Flame current", "uA", EMS_Boiler.flameCurr); _renderFloatValue("System pressure", "bar", EMS_Boiler.sysPress); - myDebug(" Current System Service Code: %s", EMS_Boiler.serviceCodeChar); + myDebug(" System Service Code: %s(%d)", EMS_Boiler.serviceCodeChar, EMS_Boiler.serviceCode); // UBAParametersMessage _renderIntValue("Heating temperature setting on the boiler", "C", EMS_Boiler.heating_temp); @@ -446,6 +446,7 @@ void publishValues(bool force) { rootBoiler["boilTemp"] = _float_to_char(s, EMS_Boiler.boilTemp); rootBoiler["pumpMod"] = _int_to_char(s, EMS_Boiler.pumpMod); rootBoiler["ServiceCode"] = EMS_Boiler.serviceCodeChar; + rootBoiler["ServiceCodeNumber"] = EMS_Boiler.serviceCode; serializeJson(doc, data, sizeof(data)); @@ -512,9 +513,9 @@ void publishValues(bool force) { for (size_t i = 0; i < measureJson(doc) - 1; i++) { crc.update(data[i]); } - uint32_t checksum = crc.finalize(); - if ((previousThermostatPublishCRC != checksum) || force) { - previousThermostatPublishCRC = checksum; + fchecksum = crc.finalize(); + if ((previousThermostatPublishCRC != fchecksum) || force) { + previousThermostatPublishCRC = fchecksum; myDebugLog("Publishing thermostat data via MQTT"); // send values via MQTT diff --git a/src/ems.cpp b/src/ems.cpp index 0ec1d69b3..f14d83ed9 100644 --- a/src/ems.cpp +++ b/src/ems.cpp @@ -203,6 +203,7 @@ void ems_init() { EMS_Boiler.flameCurr = EMS_VALUE_FLOAT_NOTSET; // Flame current in micro amps EMS_Boiler.sysPress = EMS_VALUE_FLOAT_NOTSET; // System pressure strlcpy(EMS_Boiler.serviceCodeChar, "??", sizeof(EMS_Boiler.serviceCodeChar)); + EMS_Boiler.serviceCode = EMS_VALUE_SHORT_NOTSET; // UBAMonitorSlow EMS_Boiler.extTemp = EMS_VALUE_FLOAT_NOTSET; // Outside temperature @@ -925,6 +926,8 @@ void _process_UBAMonitorWWMessage(uint8_t type, uint8_t * data, uint8_t length) /** * UBAMonitorFast - type 0x18 - central heating monitor part 1 (25 bytes long) * received every 10 seconds + * e.g. 08 00 18 00 4B 01 67 02 00 01 01 40 40 01 4B 80 00 01 4A 00 00 0E 30 45 01 09 00 00 00 (CRC=04), #data=25 + * 08 00 18 00 4B 01 56 03 00 01 01 40 40 01 3E 80 00 01 4D 00 00 0E 30 45 01 09 00 00 00 (CRC=EA), #data=25 */ void _process_UBAMonitorFast(uint8_t type, uint8_t * data, uint8_t length) { EMS_Boiler.selFlowTemp = data[0]; @@ -948,6 +951,9 @@ void _process_UBAMonitorFast(uint8_t type, uint8_t * data, uint8_t length) { EMS_Boiler.serviceCodeChar[0] = char(data[18]); // ascii character 1 EMS_Boiler.serviceCodeChar[1] = char(data[19]); // ascii character 2 + // read error code + EMS_Boiler.serviceCode = (data[20] << 8) + data[21]; + if (data[17] == 0xFF) { // missing value for system pressure EMS_Boiler.sysPress = 0; } else { diff --git a/src/ems.h b/src/ems.h index 5147223b0..2d579fdbf 100644 --- a/src/ems.h +++ b/src/ems.h @@ -27,6 +27,7 @@ #define EMS_VALUE_INT_OFF 0 // boolean false #define EMS_VALUE_INT_NOTSET 0xFF // for 8-bit ints #define EMS_VALUE_LONG_NOTSET 0xFFFFFF // for 3-byte longs +#define EMS_VALUE_SHORT_NOTSET 0xFFFF // for 2-byte shorts #define EMS_VALUE_FLOAT_NOTSET -255 // float #define EMS_THERMOSTAT_READ_YES true @@ -158,20 +159,21 @@ typedef struct { // UBAParameterWW uint8_t wWComfort; // Warm water comfort or ECO mode // UBAMonitorFast - uint8_t selFlowTemp; // Selected flow temperature - float curFlowTemp; // Current flow temperature - float retTemp; // Return temperature - uint8_t burnGas; // Gas on/off - uint8_t fanWork; // Fan on/off - uint8_t ignWork; // Ignition on/off - uint8_t heatPmp; // Circulating pump on/off - uint8_t wWHeat; // 3-way valve on WW - uint8_t wWCirc; // Circulation on/off - uint8_t selBurnPow; // Burner max power - uint8_t curBurnPow; // Burner current power - float flameCurr; // Flame current in micro amps - float sysPress; // System pressure - char serviceCodeChar[2]; // 2 character status/service code + uint8_t selFlowTemp; // Selected flow temperature + float curFlowTemp; // Current flow temperature + float retTemp; // Return temperature + uint8_t burnGas; // Gas on/off + uint8_t fanWork; // Fan on/off + uint8_t ignWork; // Ignition on/off + uint8_t heatPmp; // Circulating pump on/off + uint8_t wWHeat; // 3-way valve on WW + uint8_t wWCirc; // Circulation on/off + uint8_t selBurnPow; // Burner max power + uint8_t curBurnPow; // Burner current power + float flameCurr; // Flame current in micro amps + float sysPress; // System pressure + char serviceCodeChar[2]; // 2 character status/service code + uint16_t serviceCode; // error/service code // UBAMonitorSlow float extTemp; // Outside temperature