u/cociludzie

Image 1 — CRCs mismatches and timeouts on Modbus via RS485. May I ask for help in troubleshooting?
Image 2 — CRCs mismatches and timeouts on Modbus via RS485. May I ask for help in troubleshooting?
Image 3 — CRCs mismatches and timeouts on Modbus via RS485. May I ask for help in troubleshooting?
Image 4 — CRCs mismatches and timeouts on Modbus via RS485. May I ask for help in troubleshooting?
▲ 13 r/raspberryDIY+1 crossposts

CRCs mismatches and timeouts on Modbus via RS485. May I ask for help in troubleshooting?

Hi guys. May I ask you for help since I have no one else in my surroundings to ask for it?

I am a farmer and I have build a seed dryer. I am not a professional PLC engineer. Since I like to tinker with linux, python and electronics in total I've equipped the dryer with a Danfoss FC302 vfd that is powering a 11kW blower and two XY-MD02 temperature/humidity sensors. These elements are controlled via modbus rs485 (9600 baud rate, the lowest I could set up) by a RaspberryPi 5 with a Waveshare Hat CAN/RS485. I have a remote access to it via LTE.

I have a problem with rs485 communication. When the Danfoss VFD is in standby, modbus works perfectly -- no crc mismatches, no timeouts. But when I command the VFD to power the blower, errors begin to appear. I have no access to any oscilloscope to analyze rs485 signal.

Topology of my rs485:
I have a logical daisy chain on cat6 ethernet cables. I am using orange twisted that goes into the VFD and green pair from the same cat6 cable that goes back to the switchboard. There the green twisted pair is connected with the orange twisted pair from the next cat6 cable that goes to the first XY-MD02 sensor. There the green pair comes back to switchboard, it is connected with orange twisted pair from the next cat6 cable and it goes 20 meters to the second XY-MD02 on the other side of the dryer. There the rs485 line ends on the XY-MD02 sensor and is terminated with 120 ohm resistor. Twisted pairs are connected on the switchboard with wago topjobs connectors.

I have to add that the XY-MD02 sensors are powered with 24V over brown pairs in cat6 cables and of course it runs in the same cables with rs485 on orange and green pairs.

On the last picture you can see two pipes. On the right side it is a 4x4mm2 line that connects VFD with blower. On the left side there is a cat6 cable that runs to the second XY-MD02 sensor.The lines are separated circa 60 cm from each other.

WHAT I HAVE TRIED SO FAR
Firstly, I have used cat7 cables because I was aware that vfd would create noise. But oh boy, I couldn't communicate with the devices, even that the cat7 cable shields were connected to the ground from DC. I have replaced cat7 with unshielded cat6 and now the communication works flawlessly when VFD is in standby.

I tried to bridge grounds from 5v and 24v dc and connect it to cat7 shields and 61 terminal on Danfoss (dedicated rs485 ground terminal, the XY-MD02 lack it). One of the power supplies didn't work, it was somehow overloaded. I had to separate grounds.

I have 120 ohm termination both on raspberrypi hat (start of the rs485 line) and by the second XY-MD02 sensor (logical end of the line).

I have added ferrite rings by the VFD and by the switchboard. Maybe it helped a little bit, but the change wasn't like day and night.

Here are some logs from the systemd unit that governs the modbus communication:

alarm@suszarnia ~> journalctl -f -u suszarnia
May 19 16:46:15 suszarnia python3[681]: >>>>> Repeating....
May 19 16:46:15 suszarnia python3[681]: >>>>> recv: 0x1 0x10 0xa 0xf9 0x0 0x2 0x92 0x21 extra data:
May 19 16:46:15 suszarnia python3[681]: >>>>> send: 0x14 0x4 0x0 0x1 0x0 0x2 0x22 0xce
May 19 16:46:15 suszarnia python3[681]: >>>>> recv: 0x14 0x4 0x4 0x0 0xd6 0x1 0xa6 0xdf 0x57 extra data:
May 19 16:46:15 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 19 16:46:15 suszarnia python3[681]: >>>>> Repeating....
May 19 16:46:15 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 19 16:46:15 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 19 16:46:15 suszarnia python3[681]: WARNING | Modbus read error: Modbus Error: [Input/Output] No response received after 3 retries, continue with next request
May 19 16:46:15 suszarnia python3[681]: INFO | Manual set to off
May 20 09:51:47 suszarnia python3[681]: INFO | Manual set to on
May 20 09:52:00 suszarnia python3[681]: ERROR | No response received after 3 retries, continue with next request
May 20 09:52:00 suszarnia python3[681]: >>>>> send: 0x14 0x4 0x0 0x1 0x0 0x2 0x22 0xce
May 20 09:52:00 suszarnia python3[681]: >>>>> recv: 0x14 0x4 0x4 0x0 0xae 0x2 0x29 0x1e 0x1a extra data:
May 20 09:52:00 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:52:00 suszarnia python3[681]: >>>>> recv: 0x15 0x4 0x4 0x0 0xbb 0x2 0x15 0x1f 0xf extra data:
May 20 09:52:00 suszarnia python3[681]: >>>>> send: 0x1 0x3 0xb 0x5d 0x0 0x13 0x97 0xf1
May 20 09:52:00 suszarnia python3[681]: >>>>> Repeating....
May 20 09:52:00 suszarnia python3[681]: >>>>> recv: 0x1 0x3 0x26 0xe 0x7 0x6 0xcb 0x0 0x8d 0x0 0x2d 0x1 0xcb 0x0 0x35 0x3 extra data:
May 20 09:52:00 suszarnia python3[681]: >>>>> extra:  unexpected data: 0x1 0x3 0x26 0xe 0x7 0x6 0xcb 0x0 0x8d 0x0 0x2d 0x1 0xcb 0x0 0x35 0x3
May 20 09:52:00 suszarnia python3[681]: >>>>> recv: 0x63 0x6 0x22 0x0 0xdb 0x0 0x9f 0x0 0x0 0x0 0x1e 0x2 0x55 0x0 0x0 0x0 extra data: 0x1 0x3 0x26 0xe 0x7 0x6 0xcb 0x0 0x8d 0x0 0x2d 0x1 0xcb 0x0 0x35 0x3
May 20 09:52:00 suszarnia python3[681]: >>>>> extra:  unexpected data: 0x1 0x3 0x26 0xe 0x7 0x6 0xcb 0x0 0x8d 0x0 0x2d 0x1 0xcb 0x0 0x35 0x3 0x63 0x6 0x22 0x0 0xdb 0x0 0x9f 0x0 0x0 0x0 0x1e 0x2 0x55 0x0 0x0 0x0
May 20 09:52:00 suszarnia python3[681]: >>>>> recv: 0x0 0x0 0x0 0x0 0x0 0x0 0x4f 0x0 0x7b 0x90 0xf2 extra data: 0x1 0x3 0x26 0xe 0x7 0x6 0xcb 0x0 0x8d 0x0 0x2d 0x1 0xcb 0x0 0x35 0x3 0x63 0x6 0x22 0x0 0xdb 0x0 0x9f 0x0 0x0 0x0 0x1e 0x2 0x55 0x0 0x0 0x0
May 20 09:52:00 suszarnia python3[681]: >>>>> send: 0x1 0x10 0xa 0xf9 0x0 0x2 0x4 0x4 0x7c 0x9 0xd 0x45 0x5c
May 20 09:52:00 suszarnia python3[681]: >>>>> Repeating....
May 20 09:52:00 suszarnia python3[681]: >>>>> recv: 0x1 0x10 0xa 0xf9 0x0 0x2 0x92 0x21 extra data:
May 20 09:52:00 suszarnia python3[681]: >>>>> send: 0x14 0x4 0x0 0x1 0x0 0x2 0x22 0xce
May 20 09:52:00 suszarnia python3[681]: >>>>> recv: 0x14 0x4 0x4 0x0 0xae 0x2 0x29 0x1e 0x1a extra data:
May 20 09:52:00 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:52:00 suszarnia python3[681]: >>>>> Repeating....
May 20 09:52:00 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:52:00 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:52:00 suszarnia python3[681]: WARNING | Modbus read error: Modbus Error: [Input/Output] No response received after 3 retries, continue with next request
May 20 09:52:33 suszarnia python3[681]: INFO | Reference set to 10867
May 20 09:52:39 suszarnia python3[681]: ERROR | No response received after 3 retries, continue with next request
May 20 09:52:39 suszarnia python3[681]: >>>>> send: 0x14 0x4 0x0 0x1 0x0 0x2 0x22 0xce
May 20 09:52:39 suszarnia python3[681]: >>>>> recv: 0x14 0x4 0x4 0x0 0xae 0x2 0x25 0x1e 0x1f extra data:
May 20 09:52:39 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:52:39 suszarnia python3[681]: >>>>> recv: 0x15 0x4 0x4 0x0 0xbb 0x2 0x15 0x1f 0xf extra data:
May 20 09:52:39 suszarnia python3[681]: >>>>> send: 0x1 0x3 0xb 0x5d 0x0 0x13 0x97 0xf1
May 20 09:52:39 suszarnia python3[681]: >>>>> Repeating....
May 20 09:52:39 suszarnia python3[681]: >>>>> recv: 0x1 0x3 0x26 0xf 0x7 0x9 0xc 0x0 0x8d 0x0 0xa 0x1 0x9b 0x0 0x47 0x1 extra data:
May 20 09:52:39 suszarnia python3[681]: >>>>> extra:  unexpected data: 0x1 0x3 0x26 0xf 0x7 0x9 0xc 0x0 0x8d 0x0 0xa 0x1 0x9b 0x0 0x47 0x1
May 20 09:52:39 suszarnia python3[681]: >>>>> recv: 0xa3 0x8 0x36 0x0 0x1d 0x0 0xd4 0x0 0x0 0x0 0x3 0x2 0x4f 0x0 0x0 0x0 extra data: 0x1 0x3 0x26 0xf 0x7 0x9 0xc 0x0 0x8d 0x0 0xa 0x1 0x9b 0x0 0x47 0x1
May 20 09:52:39 suszarnia python3[681]: >>>>> extra:  unexpected data: 0x1 0x3 0x26 0xf 0x7 0x9 0xc 0x0 0x8d 0x0 0xa 0x1 0x9b 0x0 0x47 0x1 0xa3 0x8 0x36 0x0 0x1d 0x0 0xd4 0x0 0x0 0x0 0x3 0x2 0x4f 0x0 0x0 0x0
May 20 09:52:39 suszarnia python3[681]: >>>>> recv: 0x0 0x0 0x0 0x0 0x0 0x0 0x4f 0x0 0x7b 0x95 0xd7 extra data: 0x1 0x3 0x26 0xf 0x7 0x9 0xc 0x0 0x8d 0x0 0xa 0x1 0x9b 0x0 0x47 0x1 0xa3 0x8 0x36 0x0 0x1d 0x0 0xd4 0x0 0x0 0x0 0x3 0x2 0x4f 0x0 0x0 0x0
May 20 09:52:39 suszarnia python3[681]: >>>>> send: 0x1 0x10 0xa 0xf9 0x0 0x2 0x4 0x4 0x7c 0x2a 0x73 0xdc 0x4c
May 20 09:52:39 suszarnia python3[681]: >>>>> Repeating....
May 20 09:52:39 suszarnia python3[681]: >>>>> recv: 0x1 0x10 0xa 0xf9 0x0 0x2 0x92 0x21 extra data:
May 20 09:52:39 suszarnia python3[681]: >>>>> send: 0x14 0x4 0x0 0x1 0x0 0x2 0x22 0xce
May 20 09:52:39 suszarnia python3[681]: >>>>> recv: 0x14 0x4 0x4 0x0 0xae 0x2 0x25 0x1e 0x1f extra data:
May 20 09:52:39 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:52:39 suszarnia python3[681]: >>>>> Repeating....
May 20 09:52:39 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:52:39 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:52:39 suszarnia python3[681]: WARNING | Modbus read error: Modbus Error: [Input/Output] No response received after 3 retries, continue with next request
May 20 09:52:44 suszarnia python3[681]: ERROR | No response received after 3 retries, continue with next request
May 20 09:52:44 suszarnia python3[681]: >>>>> send: 0x1 0x10 0xa 0xf9 0x0 0x2 0x4 0x4 0x7c 0x2a 0x73 0xdc 0x4c
May 20 09:52:44 suszarnia python3[681]: >>>>> recv: 0x1 0x10 0xa 0xf9 0x0 0x2 0x92 0x21 extra data:
May 20 09:52:44 suszarnia python3[681]: >>>>> send: 0x14 0x4 0x0 0x1 0x0 0x2 0x22 0xce
May 20 09:52:44 suszarnia python3[681]: >>>>> recv: 0x14 0x4 0x4 0x0 0xae 0x2 0x25 0x1e 0x1f extra data:
May 20 09:52:44 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:52:44 suszarnia python3[681]: >>>>> Repeating....
May 20 09:52:44 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:52:44 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:52:44 suszarnia python3[681]: WARNING | Modbus read error: Modbus Error: [Input/Output] No response received after 3 retries, continue with next request
May 20 09:53:02 suszarnia python3[681]: ERROR | No response received after 3 retries, continue with next request
May 20 09:53:02 suszarnia python3[681]: >>>>> send: 0x14 0x4 0x0 0x1 0x0 0x2 0x22 0xce
May 20 09:53:02 suszarnia python3[681]: >>>>> recv: 0x14 0x4 0x4 0x0 0xae 0x2 0x27 0x9f 0xde extra data:
May 20 09:53:02 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:53:02 suszarnia python3[681]: >>>>> recv: 0x15 0x4 0x4 0x0 0xbb 0x2 0x12 0x5e 0xcd extra data:
May 20 09:53:02 suszarnia python3[681]: >>>>> send: 0x1 0x3 0xb 0x5d 0x0 0x13 0x97 0xf1
May 20 09:53:02 suszarnia python3[681]: >>>>> Repeating....
May 20 09:53:02 suszarnia python3[681]: >>>>> recv: 0x1 0x3 0x26 0xf 0x7 0x2a 0x73 0x2 0x97 0x1 0x4 0x8 0x33 0x1 0x4c 0x3 extra data:
May 20 09:53:02 suszarnia python3[681]: >>>>> extra:  unexpected data: 0x1 0x3 0x26 0xf 0x7 0x2a 0x73 0x2 0x97 0x1 0x4 0x8 0x33 0x1 0x4c 0x3
May 20 09:53:02 suszarnia python3[681]: >>>>> recv: 0x71 0x26 0x95 0x0 0xec 0x3 0xe3 0x0 0x0 0x0 0x20 0x2 0x3b 0x0 0x0 0x0 extra data: 0x1 0x3 0x26 0xf 0x7 0x2a 0x73 0x2 0x97 0x1 0x4 0x8 0x33 0x1 0x4c 0x3
May 20 09:53:02 suszarnia python3[681]: >>>>> extra:  unexpected data: 0x1 0x3 0x26 0xf 0x7 0x2a 0x73 0x2 0x97 0x1 0x4 0x8 0x33 0x1 0x4c 0x3 0x71 0x26 0x95 0x0 0xec 0x3 0xe3 0x0 0x0 0x0 0x20 0x2 0x3b 0x0 0x0 0x0
May 20 09:53:02 suszarnia python3[681]: >>>>> recv: 0x0 0x0 0x0 0x0 0x0 0x0 0x4f 0x0 0x7b 0x5f 0xe5 extra data: 0x1 0x3 0x26 0xf 0x7 0x2a 0x73 0x2 0x97 0x1 0x4 0x8 0x33 0x1 0x4c 0x3 0x71 0x26 0x95 0x0 0xec 0x3 0xe3 0x0 0x0 0x0 0x20 0x2 0x3b 0x0 0x0 0x0
May 20 09:53:02 suszarnia python3[681]: >>>>> send: 0x1 0x10 0xa 0xf9 0x0 0x2 0x4 0x4 0x7c 0x2a 0x73 0xdc 0x4c
May 20 09:53:02 suszarnia python3[681]: >>>>> Repeating....
May 20 09:53:02 suszarnia python3[681]: >>>>> recv: 0x1 0x10 0xa 0xf9 0x0 0x2 0x92 0x21 extra data:
May 20 09:53:02 suszarnia python3[681]: >>>>> send: 0x14 0x4 0x0 0x1 0x0 0x2 0x22 0xce
May 20 09:53:02 suszarnia python3[681]: >>>>> recv: 0x14 0x4 0x4 0x0 0xae 0x2 0x28 0xdf 0xda extra data:
May 20 09:53:02 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:53:02 suszarnia python3[681]: >>>>> Repeating....
May 20 09:53:02 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:53:02 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:53:02 suszarnia python3[681]: WARNING | Modbus read error: Modbus Error: [Input/Output] No response received after 3 retries, continue with next request
May 20 09:53:06 suszarnia python3[681]: ERROR | No response received after 3 retries, continue with next request
May 20 09:53:06 suszarnia python3[681]: >>>>> send: 0x1 0x10 0xa 0xf9 0x0 0x2 0x4 0x4 0x7c 0x2a 0x73 0xdc 0x4c
May 20 09:53:06 suszarnia python3[681]: >>>>> recv: 0x1 0x10 0xa 0xf9 0x0 0x2 0x92 0x21 extra data:
May 20 09:53:06 suszarnia python3[681]: >>>>> send: 0x14 0x4 0x0 0x1 0x0 0x2 0x22 0xce
May 20 09:53:06 suszarnia python3[681]: >>>>> recv: 0x14 0x4 0x4 0x0 0xae 0x2 0x28 0xdf 0xda extra data:
May 20 09:53:06 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:53:06 suszarnia python3[681]: >>>>> Repeating....
May 20 09:53:06 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:53:06 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:53:06 suszarnia python3[681]: WARNING | Modbus read error: Modbus Error: [Input/Output] No response received after 3 retries, continue with next request
May 20 09:53:11 suszarnia python3[681]: ERROR | No response received after 3 retries, continue with next request
May 20 09:53:11 suszarnia python3[681]: >>>>> send: 0x1 0x10 0xa 0xf9 0x0 0x2 0x4 0x4 0x7c 0x2a 0x73 0xdc 0x4c
May 20 09:53:11 suszarnia python3[681]: >>>>> recv: 0x1 0x10 0xa 0xf9 0x0 0x2 0x92 0x21 extra data:
May 20 09:53:11 suszarnia python3[681]: >>>>> send: 0x14 0x4 0x0 0x1 0x0 0x2 0x22 0xce
May 20 09:53:11 suszarnia python3[681]: >>>>> recv: 0x14 0x4 0x4 0x0 0xae 0x2 0x28 0xdf 0xda extra data:
May 20 09:53:11 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:53:11 suszarnia python3[681]: >>>>> Repeating....
May 20 09:53:11 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:53:11 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:53:11 suszarnia python3[681]: WARNING | Modbus read error: Modbus Error: [Input/Output] No response received after 3 retries, continue with next request
May 20 09:53:15 suszarnia python3[681]: ERROR | No response received after 3 retries, continue with next request
May 20 09:53:15 suszarnia python3[681]: >>>>> send: 0x1 0x10 0xa 0xf9 0x0 0x2 0x4 0x4 0x7c 0x2a 0x73 0xdc 0x4c
May 20 09:53:15 suszarnia python3[681]: >>>>> recv: 0x1 0x10 0xa 0xf9 0x0 0x2 0x92 0x21 extra data:
May 20 09:53:15 suszarnia python3[681]: >>>>> send: 0x14 0x4 0x0 0x1 0x0 0x2 0x22 0xce
May 20 09:53:15 suszarnia python3[681]: >>>>> recv: 0x14 0x4 0x4 0x0 0xae 0x2 0x28 0xdf 0xda extra data:
May 20 09:53:15 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:53:15 suszarnia python3[681]: >>>>> Repeating....
May 20 09:53:15 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:53:15 suszarnia python3[681]: >>>>> send: 0x15 0x4 0x0 0x1 0x0 0x2 0x23 0x1f
May 20 09:53:15 suszarnia python3[681]: WARNING | Modbus read error: Modbus Error: [Input/Output] No response received after 3 retries, continue with next request
May 20 09:53:21 suszarnia python3[681]: INFO | Manual set to off
^C⏎                                              
u/cociludzie — 3 days ago