diff --git a/src/emsesp.cpp b/src/emsesp.cpp index 70289c5d4..6a0b0c727 100644 --- a/src/emsesp.cpp +++ b/src/emsesp.cpp @@ -569,6 +569,7 @@ void EMSESP::incoming_telegram(uint8_t * data, const uint8_t length) { // check first for echo uint8_t first_value = data[0]; if (((first_value & 0x7F) == txservice_.ems_bus_id()) && (length > 1)) { + DEBUG_LOG(F("Tx echo")); return; // it's an echo } diff --git a/src/mixing.cpp b/src/mixing.cpp index 488406976..3ee78c099 100644 --- a/src/mixing.cpp +++ b/src/mixing.cpp @@ -153,7 +153,7 @@ void Mixing::process_MMStatusMessage(std::shared_ptr telegram) { // the heating circuit is determine by which device_id it is, 0x20 - 0x23 // 0x21 is position 2. 0x20 is typically reserved for the WM10 switch module // see https://github.com/proddy/EMS-ESP/issues/270 and https://github.com/proddy/EMS-ESP/issues/386#issuecomment-629610918 - hc_ = 0x22 - device_id(); + hc_ = device_id() - 0x20 + 1; telegram->read_value(flowTemp_, 1); // is * 10 telegram->read_value(pumpMod_, 3); telegram->read_value(flowSetTemp_, 0); diff --git a/src/telegram.cpp b/src/telegram.cpp index ea7443bcb..b3613ecb9 100644 --- a/src/telegram.cpp +++ b/src/telegram.cpp @@ -268,7 +268,7 @@ void RxService::add(uint8_t * data, uint8_t length) { uint8_t message_length; // work out depending on the type where the data message block starts - if (data[2] < 0xF0) { + if (data[2] < 0xF0 || length < 6) { // EMS 1.0 type_id = data[2]; message_data = data + 4; // message block starts at 5th byte