leodesigner / powmr4500_comm

PowMr 4500W/6500W Inverter communication protocol
GNU General Public License v3.0
9 stars 2 forks source link

Response 4 bytes longer than expected and split into two packages #10

Closed G-Christ closed 3 weeks ago

G-Christ commented 1 month ago

Hi @leodesigner , I have the 6.5 Kw-48V version and trying to get it integrated into Home assistant using @lufton component esphome-inv-8851 that also uses some of your code.

I flashed the original DTU but both my status and configuration responses are 4 bytes longer than expected and the status response is split into two packages 120 and 38 bytes. Here are some examples:

`[15:50:30][D][uart_debug:114]: >>> 88 51 00 03 02 00 00 00 4C B0

[15:50:30][W][inv_8851:064]: There was a message with length 104, that can't be parsed.

[15:50:30][D][uart_debug:114]: <<< 88 51 00 03 02 00 5E 00 20 14 EF C4 64 19 FC 08 88 13 00 00 00 00 B8 0B B8 0B B8 0B 50 0A 72 15 84 03 38 18 70 17 F8 11 5C 12 50 0A B8 0B F0 0A 7C 15 E0 15 18 15 C0 12 64 00 F4 01 64 00 00 00 00 00 3C FB 32 00 3C EC 32 F6 7C 15 88 13 F4 01 24 13 08 00 5A 5A 50 5A 5A 50 D0 16 3C 00 3C 00 1E 00 32 5F 14 00 B7 61

[15:50:35][D][uart_debug:114]: >>> 88 51 00 03 00 00 00 00 4D 08

[15:50:35][W][inv_8851:064]: There was a message with length 120, that can't be parsed.

[15:50:35][D][uart_debug:114]: <<< 88 51 00 03 00 00 94 00 85 33 87 0B 00 00 00 00 34 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 10 00 60 12 00 00 00 00 00 00 00 00 00 00 00 00 F1 08 8B 00 88 13 3E 01 B7 00 85 00 9E 00 04 02 02 02 50 00 00 00 E6 FF 00 00 00 00 00 00 00 00 00 00 00 00 37 15 FE FF 00 00 00 00 10 09 61 00 C2 00 54 10 00 00 F2 FF 00 00 33 33 33 32 2F 19 00 00 00 00 00 00

[15:50:35][W][inv_8851:064]: There was a message with length 38, that can't be parsed.

[15:50:35][D][uart_debug:114]: <<< 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 18 99

[15:50:40][D][uart_debug:114]: >>> 88 51 00 03 02 00 00 00 4C B0

[15:50:40][W][inv_8851:064]: There was a message with length 104, that can't be parsed.

[15:50:40][D][uart_debug:114]: <<< 88 51 00 03 02 00 5E 00 20 14 EF C4 64 19 FC 08 88 13 00 00 00 00 B8 0B B8 0B B8 0B 50 0A 72 15 84 03 38 18 70 17 F8 11 5C 12 50 0A B8 0B F0 0A 7C 15 E0 15 18 15 C0 12 64 00 F4 01 64 00 00 00 00 00 3C FB 32 00 3C EC 32 F6 7C 15 88 13 F4 01 24 13 08 00 5A 5A 50 5A 5A 50 D0 16 3C 00 3C 00 1E 00 32 5F 14 00 B7 61

[15:50:45][D][uart_debug:114]: >>> 88 51 00 03 00 00 00 00 4D 08

[15:50:45][W][inv_8851:064]: There was a message with length 120, that can't be parsed.

[15:50:45][D][uart_debug:114]: <<< 88 51 00 03 00 00 94 00 85 33 87 0B 00 00 00 00 34 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 10 00 60 12 00 00 00 00 00 00 00 00 00 00 00 00 F2 08 86 00 88 13 32 01 A0 00 75 00 8F 00 04 02 01 02 46 00 00 00 E7 FF 00 00 00 00 00 00 00 00 00 00 00 00 37 15 FE FF 00 00 00 00 0E 09 65 00 BF 00 4E 10 00 00 F2 FF 00 00 33 33 32 32 2D 19 00 00 00 00 00 00

[15:50:45][W][inv_8851:064]: There was a message with length 38, that can't be parsed.

[15:50:45][D][uart_debug:114]: <<< 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 5E 2E

[15:50:50][D][uart_debug:114]: >>> 88 51 00 03 02 00 00 00 4C B0

[15:50:50][W][inv_8851:064]: There was a message with length 104, that can't be parsed.

[15:50:50][D][uart_debug:114]: <<< 88 51 00 03 02 00 5E 00 20 14 EF C4 64 19 FC 08 88 13 00 00 00 00 B8 0B B8 0B B8 0B 50 0A 72 15 84 03 38 18 70 17 F8 11 5C 12 50 0A B8 0B F0 0A 7C 15 E0 15 18 15 C0 12 64 00 F4 01 64 00 00 00 00 00 3C FB 32 00 3C EC 32 F6 7C 15 88 13 F4 01 24 13 08 00 5A 5A 50 5A 5A 50 D0 16 3C 00 3C 00 1E 00 32 5F 14 00 B7 61

[15:50:55][D][uart_debug:114]: >>> 88 51 00 03 00 00 00 00 4D 08

[15:50:55][W][inv_8851:064]: There was a message with length 120, that can't be parsed.

[15:50:55][D][uart_debug:114]: <<< 88 51 00 03 00 00 94 00 85 33 87 0B 00 00 00 00 34 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 10 00 60 12 00 00 00 00 00 00 00 00 00 00 00 00 F0 08 8C 00 88 13 40 01 BB 00 89 00 A3 00 04 02 02 02 52 00 00 00 E6 FF 00 00 00 00 00 00 00 00 00 00 00 00 36 15 FE FF 00 00 00 00 10 09 5D 00 BC 00 51 10 00 00 F2 FF 00 00 33 33 31 33 2C 19 00 00 00 00 00 00 `

So no data is being processed

I got the advice from @lufton to increase the rx_bufer_size and stop logging, i did that but no change. I have also experimented with various Baud rates and stop bit, but only works with baud rate 9600 and 1 stop bit.

` substitutions: inverter_maximum_power: "6500" name: powmr-inverter-dtu friendly_name: PowMr inverter dtu

esp32: board: esp32-c3-devkitm-1

Enable logging

logger:

baud_rate: 0

level: VERBOSE

uart: id: uart_0 baud_rate: 9600 tx_pin: GPIO4 rx_pin: GPIO5 data_bits: 8 stop_bits: 1 parity: NONE rx_buffer_size: 3000

debug: direction: BOTH dummy_receiver: false after: delimiter: "\r" sequence:

Any idea how to fix or at least what and how to examine in order to locate the reason and get it fixed?

Hope you can help

leodesigner commented 3 weeks ago

I am closing the issue since @lufton already replied.