Continuing the discussion from MODBUS Binding with SMA inverter missing lower byte:
I have done some additional tests to investigate the “missing lower byte” issue.
Test conditions:
-
To exclude a too high load as possible cause of problems, I used only one polling Thing (Current Power register 30775, length = 2, polling rate set to 60000 ms
-
Wireshark was used for data capturing with its “packets reassembly feature” turned off
-
For test 1 and test 3, Wireshark was running on the RaspBerry PI (host of OPENHAB), the display was redirected (PUTTY / XMING) to an INTEL-NUC Windows computer.
-
For test 2, Wireshark and the Radzio! Modbus Master Simulator were running on the INTEL-NUC Windows computer.
Tests performed:
-
SunnyBoy SB2500TLST-21 inverter queried from OPENHAB
-
SunnyBoy SB2500TLST-21 inverter queried from the Radzio! Modbus Master Simulator
-
SunnyBoy SB1.5-1VL-40 inverter queried from OPENHAB
Conclusion:
- the behaviour of SunnyBoy SB2500TLST-21 inverter is causing the “Missing Byte” problem as already stated before by Rossko57
- there is no defragmentation on the TCP/IP level
For details see test results below.
1. Testresult SunnyBoy SB2500TLST-21 inverter queried from OPENHAB
Response packet sent by SMA inverter in reply to the query.
Wireshark capture, packet length: 66 bytes
o Network Interface: 14 bytes
o IP Header: 20 bytes
o TCP Header: 20 bytes
o Payload (MODBUS response message) 12 bytes
Transaction ID 2 bytes
Protocol ID 2 bytes
Length 2 bytes (Length=7)
Unit iD 1 byte
Function Code 1 byte
Byte Count 1 byte (Byte Count = 4)
MSByte register 30775 1 byte
LSByte register 30775 1 byte
MSByte register 30776 1 byte ( LSByte register 30776 missing !)
Wireshark reports:
Packet size limited during capture: Modbus truncated
The response packet is followed by a [PUSH] packet sent by the SMA inverter.
Wireshark capture, packet length: 60 bytes
o Network interface: 14 bytes
o IP Header: 20 bytes
o TCP Header: 20 bytes
o Payload 6 bytes
LSByte register 30776 1 bytes
Padding bytes 5 bytes
The missing LSByte of register 30776 in the response message is not caused by defragmentation in the TCP/IP layers since:
-
The MF flag (More Fragments to come) in the IP Header of the response message is not set
-
The packet offset value in the IP Header of the [PUSH] packet is zero
It looks like OPENHAB is not processing the [PUSH] packet containing the LSByte of register 30776
Due to the lack of the LSByte the presentation of the actual current power is not a fluent line as shown below:
This missing LSByte is due to behavior of the SunnyBoy SB2500TLST-21.
I have no idea whether or not OPENHAB should be able to deal with this.
2.Testresult SunnyBoy SB2500TLST-21 inverter queried from the Radzio! Modbus Master Simulator
As with test 1, the LSByte of register 30776 is not contained in the response message but sent in a subsequent PUSH packet.
However , the Razio! Modbus Master Simulator includes the LSByte, received with the PUSH packet, in the result.
3. Testresult SunnyBoy SB1.5-1VL-40 inverter queried from OPENHAB
Response packet sent by SMA inverter in reply to the query:
Wireshark capture, packet length: 67 bytes
o Network interface: 14 bytes
o IP Header: 20 bytes
o TCP Header: 20 bytes
o Payload (MODBUS response message) 13 bytes
Transaction ID 2 bytes
Protocol ID 2 bytes
Length 2 bytes (Length = 7)
Unit iD 1 byte
Function Code 1 byte
Byte Count 1 byte (Byte Count = 4)
MSByte register 30775 1 byte
LSByte register 30775 1 byte
MSByte register 30776 1 byte
LSByte register 30776 1 byte
All queried data is included in the response message.
The value are as expected , as is the presentation in OPENHAB.