[nibeheatpump] Support 16-bit addressing (#13752)

* [nibeheatpump] Support for 16-bit addressing

Signed-off-by: Pauli Anttila <pauli.anttila@gmail.com>
This commit is contained in:
pali
2022-12-02 00:15:34 +02:00
committed by GitHub
parent 8d39875219
commit 383b5137e4
6 changed files with 31 additions and 41 deletions

View File

@@ -24,6 +24,7 @@
* 3.7.2022 v4.00 Send messages to IP address received from the UDP messages
* 13.7.2022 v4.01 Fixed target IP address issue
* 29.7.2022 v5.00 New configuration model and PRODINo ESP32 Ethernet v1 support with OTA update
* 19.11.2022 v5.10 Support 16-bit addressing.
*/
#define VERSION "5.00"

View File

@@ -279,12 +279,6 @@ int NibeGw::checkNibeMessage(const byte* const data, byte len)
if (data[0] != 0x5C)
return -1;
if (len >= 2)
{
if (data[1] != 0x00)
return -1;
}
if (len >= 6)
{
int datalen = data[4];
@@ -295,7 +289,7 @@ int NibeGw::checkNibeMessage(const byte* const data, byte len)
byte checksum = 0;
// calculate XOR checksum
for (int i = 2; i < (datalen + 5); i++)
for (int i = 1; i < (datalen + 5); i++)
checksum ^= data[i];
byte msg_checksum = data[datalen + 5];

View File

@@ -13,15 +13,16 @@
* ----------------------------------------------------------------------------
*
* Frame format:
* +----+----+------+-----+-----+----+----+-----+
* | 5C | 00 | ADDR | CMD | LEN | DATA | CHK |
* +----+----+------+-----+-----+----+----+-----+
* |------------ CHK -----------|
* +----+------+------+-----+-----+----+----+-----+
* | 5C | ADDR | ADDR | CMD | LEN | DATA | CHK |
* +----+------+------+-----+-----+----+----+-----+
*
* |------------ CHK ------------------|
*
* Address:
* 0x16 = SMS40
* 0x19 = RMU40
* 0x20 = MODBUS40
* 0x0016 = SMS40
* 0x0019 = RMU40
* 0x0020 = MODBUS40
*
* Checksum: XOR
*