psvanstrom / esphome-p1reader

ESPHome custom component for reading P1 data from electricity meters.
MIT License
267 stars 116 forks source link

Reading from UART timed out at byte 0! #3

Closed steeriks closed 1 year ago

steeriks commented 3 years ago

I am getting this error:

Aidon meter with Rj12 (activated) NodeMcu V3. Wiring as suggested!

[17:31:09][E][uart_esp8266:167]: Reading from UART timed out at byte 0! [17:31:09][E][uart_esp8266:167]: Reading from UART timed out at byte 0! [17:31:09][E][uart_esp8266:167]: Reading from UART timed out at byte 0! [17:31:09][E][uart_esp8266:167]: Reading from UART timed out at byte 0! [17:31:09][E][uart_esp8266:167]: Reading from UART timed out at byte 0! [17:31:10][E][uart_esp8266:167]: Reading from UART timed out at byte 0! [17:31:10][E][uart_esp8266:167]: Reading from UART timed out at byte 0! [17:31:10][E][uart_esp8266:167]: Reading from UART timed out at byte 0! [17:31:10][E][uart_esp8266:167]: Reading from UART timed out at byte 0! [17:31:10][E][uart_esp8266:167]: Reading from UART timed out at byte 0! [17:31:19][E][uart_esp8266:167]: Reading from UART timed out at byte 0! [17:31:19][E][uart_esp8266:167]: Reading from UART timed out at byte 0! [17:31:19][E][uart_esp8266:167]: Reading from UART timed out at byte 0! [17:31:19][E][uart_esp8266:167]: Reading from UART timed out at byte 0! [17:31:19][E][uart_esp8266:167]: Reading from UART timed out at byte 0! [17:31:20][E][uart_esp8266:167]: Reading from UART timed out at byte 0! [17:31:20][E][uart_esp8266:167]: Reading from UART timed out at byte 0! [17:31:20][E][uart_esp8266:167]: Reading from UART timed out at byte 0! [17:31:20][E][uart_esp8266:167]: Reading from UART timed out at byte 0! [17:31:20][E][uart_esp8266:167]: Reading from UART timed out at byte 0! [17:31:29][E][uart_esp8266:167]: Reading from UART timed out at byte 0! [17:31:29][E][uart_esp8266:167]: Reading from UART timed out at byte 0! [17:31:29][E][uart_esp8266:167]: Reading from UART timed out at byte 0! [17:31:29][E][uart_esp8266:167]: Reading from UART timed out at byte 0! [17:31:29][E][uart_esp8266:167]: Reading from UART timed out at byte 0! [17:31:30][E][uart_esp8266:167]: Reading from UART timed out at byte 0! [17:31:30][E][uart_esp8266:167]: Reading from UART timed out at byte 0! [17:31:30][E][uart_esp8266:167]: Reading from UART timed out at byte 0! [17:31:30][E][uart_esp8266:167]: Reading from UART timed out at byte 0! [17:31:30][E][uart_esp8266:167]: Reading from UART timed out at byte 0!

maccan-tech commented 3 years ago

Same here. Tekniskaverken, Aidon 6442SE meter with Rj12 (activated). Using ESP8266 (wemos d1) and a BC547C.

forsberg commented 3 years ago

Same here, also on Tekniska Verken with Aidon. Reason seems to be that Tekniska verken have adopted "Branschrekommendation 1.2", which is a binary protocol.

Protocol information available here: https://www.tekniskaverken.se/siteassets/tekniska-verken/elnat/aidonfd-rj12-han-interface-se-v13a.cleaned.pdf

Some more information here: https://github.com/aviborg/swedishP1

pp-svanstrom commented 3 years ago

@forsberg Great find! From version 1.3 of the specification they changed to an ASCII format, which is what my code is expecting. I will take a look at the binary format and see if I can add a field for the user to control which version the meter is using.

forsberg commented 3 years ago

I contacted Tekniska Verken kundsupport, and they are "painfully aware" and are "having a dialouge with their provider" about how to fix this.

I asked them if they have a timeline. Hopefully this will be fixed by itself in a couple of months.

bortek commented 3 years ago

I am also seeing this in my logs sporadically. My mete ris Landis E360. But I have more issue with CRC checksum which I put in a separate issue.

forsberg commented 3 years ago

I have the beginnings of a fix for this in a branch, but it needs a bit of cleanup - checking CRC and handling HDLC flag bytes inside frame.

Has been running stable for about a week on an Aidon 6442SE from Tekniska Verken, Linköping.

pp-svanstrom commented 3 years ago

Awesome @forsberg ! You're very welcome to do a PR once you have finished the cleanup, great work 👍

maccan-tech commented 3 years ago

@forsberg Your branch has workt great for me now the past week. But i get this every time it reads the data. But it works [10:41:09][D][hdlc:479]: Expect 0x01 (array tag), got 01

jpduhen commented 2 years ago

https://github.com/esphome/issues/issues/815#issuecomment-733584340 It helped me to reset the MH-Z19B by holdoing the HD 7sec to GND and resetting the ESP. You have to calibrate the MH by keeping it in fresh air for 20 mins.