Can anyone help me understand the numerical data in the RS485 Modbus data traffic that I listen to between my single phase Growatt inverter 3000TL-XH and its Chint DDSU666 power meter?
I use an ESP32 and UART, and this code in my yaml:
debug:
direction: RX
dummy_receiver: true
after:
timeout: 3ms
sequence:
- lambda: |-
UARTDebug::log_hex(direction, bytes, ','); // Log the message in hex.
ESP_LOGD("custom", "Bytes: %d", bytes.size()); // Log byte count.
The timeout separates the messages because Modbus terminates them with a 3.5 character gap. This works nicely and I can see the 8 byte requests for data from the inverter and the 29 and 37 byte responses from the power meter, but I can’t manage to decode the two byte numerical values for voltage, power, etc, that the manual says are stored at addresses starting from 2000H. Here is an example of the ever-repeating messages that are logged:
<<< 03,03,40,00,00,0C,51,ED Read C (12) 2-byte registers from bank 4000H
Bytes: 8
<<< 03,03,18,44,18,BE,B8,44,18,BE,B8,00,00,00,00,00,00,00,00,00,00,00,00,43,A8,5E,B8,4D,2F
Bytes: 29
<<< 03,03,20,00,00,10,4E,24 Read 10 (16) 2-byte registers from bank 2000H
Bytes: 8
<<< 03,03,20,43,75,E6,66,3F,BD,D2,F2,BE,97,8D,50,3E,4E,21,96,3E,B7,31,90,BF,53,74,BC,00,00,00,00,42,47,E1,48,DE,DF
Bytes: 37
<<< 03,03,40,00,00,0C,51,ED Read C (12) 2-byte registers from bank 4000H
Bytes: 8
<<< 03,03,18,44,18,BE,B8,44,18,BE,B8,00,00,00,00,00,00,00,00,00,00,00,00,43,A8,5E,B8,4D,2F
Bytes: 29
<<< 03,03,20,00,00,10,4E,24 Read 10 (16) 2-byte registers from bank 2000H
Bytes: 8
<<<03,03,20,43,75,E6,66,3F,BE,14,7B,BE,97,58,E2,3E,4E,A4,A9,3E,B7,3E,AB,BF,53,74,BC,00,00,00,00,42,48,28,F6,0C,BA
Bytes: 37
In the 37 byte responses reading from bank 2000H, the pairs of data bytes which the manual says are single precision floating point start with bytes 4 and 5, after the device ID=3, function code=3 (read registers), and the number of bytes to read. So in the 37 byte responses above the hex bytes 43 and 75 should be the high and low bytes of a number, the voltage, with subsequent pairs holding other values, the 8th pair should be the grid frequency. But I can’t interpret them. Another Chint manual describes them as Floating Inverse (AB CD). 16-bit quantities are not technically ‘single precision’ but half-precision, but trying that interpretation and others has got me nowhere.
I thought this would be the easy bit, the voltage read from register 2000H is going to be around 240v, and the frequency (register 200EH) around 50hz, so even with factors of 10 added they should be recognizable. Can anyone point me in the right direction?