esphome-p1mini: [W] | [p1reader:227] | Unknown data format (0x00). Resetting.

Issue Description

I get [W] | [p1reader:227] | Unknown data format (0x00). Resetting. It seemed to happen more often during periods of low load.

  • S34U18 (Sanxing SX631) / Vattenfall

Log

11:51:45 | [D] | [switch:055] | 'p1_cts': Sending state ON
11:51:45 | [D] | [switch:012] | 'status_led' Turning ON.
11:51:45 | [D] | [switch:055] | 'status_led': Sending state ON
11:51:45 | [W] | [p1reader:227] | Unknown data format (0x00). Resetting.
11:51:45 | [D] | [switch:016] | 'p1_cts' Turning OFF.
11:51:45 | [D] | [switch:055] | 'p1_cts': Sending state OFF
11:51:46 | [D] | [switch:016] | 'status_led' Turning OFF.
11:51:46 | [D] | [switch:055] | 'status_led': Sending state OFF
11:51:54 | [D] | [sensor:093] | 'p1mini WiFi Signal': Sending state -72.00000 dBm with 0 decimals of accuracy
11:51:56 | [D] | [switch:012] | 'p1_cts' Turning ON.
11:51:56 | [D] | [switch:055] | 'p1_cts': Sending state ON
11:51:56 | [D] | [switch:012] | 'status_led' Turning ON.
11:51:56 | [D] | [switch:055] | 'status_led': Sending state ON
11:51:59 | [D] | [p1reader:221] | ASCII data format
11:51:59 | [D] | [switch:016] | 'p1_cts' Turning OFF.
11:51:59 | [D] | [switch:055] | 'p1_cts': Sending state OFF
11:51:59 | [D] | [p1reader:282] | CRC verification OK
11:52:00 | [D] | [p1reader:328] | Could not parse value from line '/AUX5U18SEH13F10029'
11:52:00 | [D] | [p1reader:328] | Could not parse value from line '0-0:96.1.0(38303034363937333432383437313035303538393236)'
11:52:00 | [D] | [p1reader:328] | Could not parse value from line '0-0:1.0.0(230528105200W)'
11:52:00 | [D] | [sensor:093] | 'Cumulative Active Import': Sending state 232.07600 kWh with 3 decimals of accuracy
11:52:00 | [D] | [sensor:093] | 'Cumulative Active Export': Sending state 1331.51794 kWh with 3 decimals of accuracy
11:52:00 | [D] | [sensor:093] | 'Cumulative Reactive Import': Sending state 0.86900 kvarh with 3 decimals of accuracy
11:52:00 | [D] | [sensor:093] | 'Cumulative Reactive Export': Sending state 314.38101 kvarh with 3 decimals of accuracy
11:52:00 | [D] | [sensor:093] | 'Momentary Active Import': Sending state 0.00000 kW with 3 decimals of accuracy
11:52:00 | [D] | [sensor:093] | 'Momentary Active Export': Sending state 3.65900 kW with 3 decimals of accuracy
11:52:00 | [D] | [sensor:093] | 'Momentary Reactive Import': Sending state 0.00000 kvar with 3 decimals of accuracy
11:52:00 | [D] | [sensor:093] | 'Momentary Reactive Export': Sending state 0.86200 kvar with 3 decimals of accuracy
11:52:01 | [D] | [sensor:093] | 'Momentary Active Import Phase 1': Sending state 0.00000 kW with 3 decimals of accuracy
11:52:01 | [D] | [sensor:093] | 'Momentary Active Export Phase 1': Sending state 1.06200 kW with 3 decimals of accuracy
11:52:01 | [D] | [sensor:093] | 'Momentary Active Import Phase 2': Sending state 0.00000 kW with 3 decimals of accuracy
11:52:01 | [D] | [sensor:093] | 'Momentary Active Export Phase 2': Sending state 1.30900 kW with 3 decimals of accuracy
11:52:01 | [D] | [sensor:093] | 'Momentary Active Import Phase 3': Sending state 0.00000 kW with 3 decimals of accuracy
11:52:01 | [D] | [sensor:093] | 'Momentary Active Export Phase 3': Sending state 1.28700 kW with 3 decimals of accuracy
11:52:01 | [D] | [sensor:093] | 'Momentary Reactive Import Phase 1': Sending state 0.00000 kvar with 3 decimals of accuracy
11:52:01 | [D] | [sensor:093] | 'Current Phase 1': Sending state 4.80000 A with 1 decimals of accuracy
11:52:04 | [D] | [sensor:093] | 'p1mini WiFi Signal': Sending state -72.00000 dBm with 0 decimals of accuracy
11:52:07 | [D] | [switch:012] | 'p1_cts' Turning ON.
11:52:07 | [D] | [switch:055] | 'p1_cts': Sending state ON
11:52:07 | [D] | [switch:012] | 'status_led' Turning ON.
11:52:07 | [D] | [switch:055] | 'status_led': Sending state ON
11:52:07 | [W] | [p1reader:227] | Unknown data format (0x00). Resetting.
11:52:07 | [D] | [switch:016] | 'p1_cts' Turning OFF.
11:52:07 | [D] | [switch:055] | 'p1_cts': Sending state OFF
11:52:07 | [D] | [switch:016] | 'status_led' Turning OFF.
11:52:07 | [D] | [switch:055] | 'status_led': Sending state OFF
11:52:14 | [D] | [sensor:093] |  

Screenshot_20230528_103434_Home Assistant 20230528_105151

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 15 (8 by maintainers)

Most upvoted comments

Ok, @doe81, I have created a new branch ‘rts-always-high’ for you to test and verify. The steps to do this would be:

  1. Solder RTS back to D2
  2. Switch to the rts-always-high branch and flash
  3. Verify that the problems are back
  4. Look at the Readme.md (in the branch) for instructions
  5. Verify that the problems are solved

This is getting stranger and stranger… Sometimes when an update is requested, the meter sends an update with correct checksum, but sometimes it sends a few zero bytes…

I also notice that even when correct data is being received, the sending of data is very slow: “Cycle times: Message = 2242 ms (134 loops)”. This is over two seconds to transfer a moderate amount of data! I am starting to wonder if the meter is bad, either your particular unit or the design in general.

There is one thing that would be interesting to test, because it could affect several potential issues. It does involve more soldering though: Connect the RTS cable directly to 5V instead of D2.

  • This way the RTS signal will be 5V instead of the 3.3V from the ESP output, which is lower than the minimum specified value on many meters. So far I have not heard of any meters where 3.3V does not work, but it is outside of spec.
  • The RTS signal will be constantly high and it seems to be part of the P1 protocol that this means that the meter will send updates every 10 seconds. Maybe the meter works better in this mode.
  • The RTS signal will not go low as soon as those 0x00 bytes are received and maybe there will be more data giving a clue about what is going on.

Ok, I have added the logging to the main branch. Update to the latest version and see what the log says efter the error!