From 713f7d7a0a7844c890dd16d17b64f2bb68b58889 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A4r=20Svanstr=C3=B6m?= Date: Thu, 18 Feb 2021 00:31:19 +0100 Subject: [PATCH 1/4] Fix problem with E360 reader --- p1reader.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/p1reader.h b/p1reader.h index 2539815..e269a78 100644 --- a/p1reader.h +++ b/p1reader.h @@ -256,6 +256,7 @@ class P1Reader : public Component, public UARTDevice { if (available()) { uint16_t crc = 0x0000; ParsedMessage parsed = ParsedMessage(); + bool telegramEnded = false; while (available()) { int len = readBytesUntil('\n', buffer, BUF_SIZE); @@ -273,6 +274,7 @@ class P1Reader : public Component, public UARTDevice { int crcFromMsg = (int) strtol(&buffer[1], NULL, 16); parsed.crcOk = crc == crcFromMsg; ESP_LOGI("crc", "Telegram read. CRC: %04X = %04X. PASS = %s", crc, crcFromMsg, parsed.crcOk ? "YES": "NO"); + telegramEnded = true; // otherwise pass the row through the CRC calculation } else { @@ -296,6 +298,11 @@ class P1Reader : public Component, public UARTDevice { } // clean buffer memset(buffer, 0, BUF_SIZE - 1); + + if (!telegramEnded && !available()) { + // wait for more data + delay(2000); + } } // if the CRC pass, publish sensor values From e3c593937f13a8246393352f79546c43882e8733 Mon Sep 17 00:00:00 2001 From: Andreas Date: Tue, 16 Mar 2021 17:45:22 +0100 Subject: [PATCH 2/4] 40ms seems to be needed for E360. --- p1reader.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/p1reader.h b/p1reader.h index e269a78..3b287da 100644 --- a/p1reader.h +++ b/p1reader.h @@ -301,7 +301,7 @@ class P1Reader : public Component, public UARTDevice { if (!telegramEnded && !available()) { // wait for more data - delay(2000); + delay(40); } } From 416f92ac1768a70a5b43091f021c1bd429d73dda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A4r=20Svanstr=C3=B6m?= Date: Sat, 3 Apr 2021 21:41:31 +0200 Subject: [PATCH 3/4] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 92a9d05..ce9f800 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,9 @@ Please note that the project currently doesn't support the Aidon meter from Tekn ## Verified meter hardware / supplier * [Sagemcom T211](https://www.ellevio.se/globalassets/uploads/2020/nya-elmatare/ellevio_produktblad_fas3_t211_web2.pdf) / Ellevio +* [Landis+Gyr E360](https://eu.landisgyr.com/blog-se/e360-en-smart-matare-som-optimerarden-totala-agandekostnaden) + +https://github.com/psvanstrom/esphome-p1reader/issues/4#issuecomment-810794020 ## Hardware I have used an ESP-12 based NodeMCU for my circuit. Most ESP-12/ESP-32 based controllers would probably work. The P1 port on the meter provides 5V up to 250mA which makes it possible to power the circuit directly from the P1 port. From adf62b3c8f399da13b20efe918e875a5e0974d60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A4r=20Svanstr=C3=B6m?= Date: Sat, 3 Apr 2021 21:49:54 +0200 Subject: [PATCH 4/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ce9f800..5a7e89c 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Please note that the project currently doesn't support the Aidon meter from Tekn * [Sagemcom T211](https://www.ellevio.se/globalassets/uploads/2020/nya-elmatare/ellevio_produktblad_fas3_t211_web2.pdf) / Ellevio * [Landis+Gyr E360](https://eu.landisgyr.com/blog-se/e360-en-smart-matare-som-optimerarden-totala-agandekostnaden) -https://github.com/psvanstrom/esphome-p1reader/issues/4#issuecomment-810794020 +*Note:* There's currently a bug in the E360 firmware, causing it to stop sending out data after a while. Check this comment for more info: https://github.com/psvanstrom/esphome-p1reader/issues/4#issuecomment-810794020 ## Hardware I have used an ESP-12 based NodeMCU for my circuit. Most ESP-12/ESP-32 based controllers would probably work. The P1 port on the meter provides 5V up to 250mA which makes it possible to power the circuit directly from the P1 port.