phpmodbus icon indicating copy to clipboard operation
phpmodbus copied to clipboard

Byte Missing

Open AntonWert opened this issue 1 year ago • 0 comments

Hello,

I try to read the status Register (30201) of a Sunny Boy. Expected answer is 307

I do have one inverter, providing me the correct answer.

Another (older) Device brings up an error: readMultipleRegisters: START Connected Packet: ac4e00000006030375f90002 Send Wait data ... Data received (12) Packet: ac4e00000007030304000001 Modbus response error code: NOERROR Disconnected readMultipleRegisters: DONE

I have modified the library showing me the amount of recived bytes. If the problem orrurs, only 12 bytes are recived instead of 13. The 12 Bytes will chrash readMultipleRegistersParser on line 506 $data[$i] = ord($packet[9+$i]); accessing the array out of range. Notice: Uninitialized string offset: 12

Of course, then the result is garbage (256)

I have running pymodmon in parallel, giving me the correct value for all inverters.

I would like to support, but modbus is just not my area. But I can help on questions.

AntonWert avatar Jun 18 '23 15:06 AntonWert