11yewang
(11yewang)
July 3, 2021, 12:35pm
1
HA modbus RTU OVER TCP connect ESP_easy ser2net, can’t recieve full data bytes, NO CRC BYTES. As the modbus protcol ,the recieve datas should be 9,but in fact only 7
My configration code is below.
modbus:
- name: "SMA"
type: rtuovertcp
host: 192.168.0.124
port: 502
delay: 5
timeout: 5
sensors:
- name: IM1281B
unit_of_measurement: ℃
slave: 2
address: 0078
count: 1
data_type: uint
scale: 0.01
precision: 2
scan_interval: 30
logger:
logs:
homeassistant.components.modbus: debug
pymodbus.client: debug
nickrout
(Nick Rout)
July 3, 2021, 12:43pm
2
Post your log , not a pic of it.
11yewang
(11yewang)
July 3, 2021, 1:19pm
3
2021-07-03 20:13:40 DEBUG (SyncWorker_3) [pymodbus.client.sync] Connection to Modbus server established. Socket ('192.168.0.13', 58373)
2021-07-03 20:13:40 DEBUG (SyncWorker_3) [pymodbus.transaction] Current transaction state - TRANSACTION_COMPLETE
2021-07-03 20:13:40 DEBUG (SyncWorker_3) [pymodbus.transaction] Running transaction 2
2021-07-03 20:13:40 DEBUG (SyncWorker_3) [pymodbus.transaction] Clearing current Frame : - 0x2 0x3 0x4 0x0 0x0 0xa 0xbe
2021-07-03 20:13:40 DEBUG (SyncWorker_3) [pymodbus.framer.rtu_framer] Resetting frame - Current Frame in buffer - 0x2 0x3 0x4 0x0 0x0 0xa 0xbe
2021-07-03 20:13:40 DEBUG (SyncWorker_3) [pymodbus.transaction] SEND: 0x2 0x3 0x0 0x4e 0x0 0x1 0xe4 0x2e
2021-07-03 20:13:40 DEBUG (SyncWorker_3) [pymodbus.framer.rtu_framer] Changing state to IDLE - Last Frame End - 1625314390.859892, Current Time stamp - 1625314420.829982
2021-07-03 20:13:40 DEBUG (SyncWorker_3) [pymodbus.client.sync] New Transaction state 'SENDING'
2021-07-03 20:13:40 DEBUG (SyncWorker_3) [pymodbus.transaction] Changing transaction state from 'SENDING' to 'WAITING FOR REPLY'
2021-07-03 20:13:40 DEBUG (SyncWorker_3) [pymodbus.transaction] Changing transaction state from 'WAITING FOR REPLY' to 'PROCESSING REPLY'
2021-07-03 20:13:40 DEBUG (SyncWorker_3) [pymodbus.transaction] RECV: 0x2 0x3 0x4 0x0 0x0 0xa 0xbe
2021-07-03 20:13:40 DEBUG (SyncWorker_3) [pymodbus.framer.rtu_framer] Frame - [b'\x02\x03\x04\x00\x00\n\xbe'] not ready
2021-07-03 20:13:40 DEBUG (SyncWorker_3) [pymodbus.transaction] Getting transaction 2
2021-07-03 20:13:40 DEBUG (SyncWorker_3) [pymodbus.transaction] Changing transaction state from 'PROCESSING REPLY' to 'TRANSACTION_COMPLETE'
2021-07-03 20:13:40 DEBUG (SyncWorker_3) [homeassistant.components.modbus.modbus] Pymodbus: Modbus Error: [Input/Output] No Response received from the remote unit/Unable to decode response
when i use the modbusscan tool to test the device, the datas are full and correct ,but the modbusscan tool “Valid Slave Responses” is 0.
11yewang
(11yewang)
July 3, 2021, 1:28pm
4
when i use the modbusPoll tool to test the device, the datas are full and correct ,but the modbusPoll tool shows “Checksum error”.
11yewang
(11yewang)
July 4, 2021, 3:19am
5
I found the reason . My power meter(IM1281B) is not a standard modbus protocol device. In it’s protocol, a register has 4 bytes datas, but standard modbus protocol only has 2 bytes datas in a register.