RS485 transmit errors
-
Hello,
I am trying to setup a RS485 gateway on a raspberry with an arduino node.
Raspberry gateway is build with
./configure --my-gateway=ethernet --my-port=8011 --my-transport=rs485 --my-rs485-serial-port=/dev/ttyAMA0 --my-rs485-de-pin=37
The arduino sketch is configured with
#define MY_DEBUG #define MY_RS485 #define MY_RS485_DE_PIN 2 #define MY_RS485_BAUD_RATE 9600 #define MY_BAUD_RATE 9600 #define MY_NODE_ID 2
On each RS485 I have a 120 ohm resistor. The arduino and the raspberry are very close so the wires are short
The parent request from the node to the gateway fails. I have added extra logging on each side, and I see following issue
- the parent request is received by the gateway
- but the response to the node is corrupted.
The gateway write following bytes
- 1 -> SOH
- 2 -> destination node
- 0 -> source address
- 88 -> command
- 8 -> message length
- 2 -> STX
The node receives
- 1 -> SOH
- 65534-> destination node -> ERROR
- 0 -> source address
- 65496-> command-> ERROR
- 8 -> message length
- 2 -> STX
As you can see some bits are corrupted
Expected destination node =2 (in binary 0000 0000 0000 0010), while we received 65534 (in binary 1111 1111 1111 1110). The leading bits are 1 instead of 0
Same issue about command byte.
It is 100% reproductible, this message is always received with same values so I don't think it is caused by noise or something like that.Any idea about the root cause?
-
@sebastieng too much load ? one 120ohm on the far one should be enough