I am trying to get a simple modbus controller working, but it produces continuous crc errors. Looking at the log it seems like a lot of random data is read all the time.
Some things I have noticed and tried
- The moment I disconnect the tx pin everything stops.
- Also if I remove the modbus configuration from the yaml nothing is happening on the uart.
- The moment I add only the modbus config, the noise starts again on the uart
- If I load custom firmware on the same device it works perfectly so I know there is nothing wrong with the physical setup and wiring.
I am using an esp32 dev board with a max 485 module. I tried a different board with the same results and also working with custom firmware.
Here is my yaml
uart:
id: uart_bus
rx_pin: GPIO17 #GPIO20
tx_pin: GPIO16 #GPIO21
baud_rate: 9600
debug:
modbus:
flow_control_pin: GPIO32
id: modbus1
uart_id: uart_bus
send_wait_time: 200ms
modbus_controller:
- id: river_modbus
address: 0x1 ## address of the Modbus slave device on the bus
modbus_id: modbus1
setup_priority: -10
command_throttle: 100ms
Small snippet of my log files,
19:25:29][W][modbus:108]: Modbus CRC Check failed! 1030!=EA03
[19:25:29][W][modbus:108]: Modbus CRC Check failed! 47F4!=F4F4
[19:25:29][W][modbus:108]: Modbus CRC Check failed! 7577!=F4D0
[19:25:29][W][modbus:108]: Modbus CRC Check failed! 7577!=F0F4
[19:25:29][W][modbus:108]: Modbus CRC Check failed! AD76!=F4D4
[19:25:29][W][modbus:108]: Modbus CRC Check failed! B570!=F4FC
[19:25:29][D][uart_debug:114]: <<< 54:00:00:03:EA:F8:50:54:54:54:50:50:50:50:54:54:02:5A:FA:FE:FA:FA:FC:FC:FC:F0:FC:FE:FC:FC:FC:FC:FC:FC:FC:F4:C0:FC:FC:F4:F4:F4:F4:F0:D0:F4:FC:F4:F4:F4:F4:F4:F4:FC:F4:D4:D0:F4:F4:F4:F4:F4:F4:F4:D4:D4:F4:F4:F4:F0:F4:F4:F4:F4:F4:D4:FC:F4:F4:F4:F4:F4:F4:F4:F4:F4:D4:FC:F0:F4:F4:F4:F4:F4:F4:F4:F4:D0:F4:F4:F4:F4:F4:F0:F4:F4:D4:D4:F4:F4:FC:F4:FC:F4:50:54:54:54:54:55
[19:25:29][W][modbus:108]: Modbus CRC Check failed! F117!=F4F4
[19:25:29][W][modbus:108]: Modbus CRC Check failed! 7671!=F4F4
[19:25:29][W][modbus:108]: Modbus CRC Check failed! BC6E!=F4FC