I have a three-node serial bus, wired into what I thought would be a master/slave configuration, but nodes that I didn't think would be able to receive data are receiving data. In other words, it's working better than I thought it should, and I don't understand why.
First, the setup: I have three Raspberry Pis, each with one of these USB-Serial Adapters: https://www.amazon.com/Serial-Converter-Adapter-Supports-Windows/dp/B0195ZD3P4/
It claims to have an FTDI chip. I am not using any special drivers - whatever kernel driver that was in Raspbian is what I'm using. I'm testing with minicom, just to send data from between nodes. I think it's in RS485 mode, but I'm not sure how to tell.
I started out with just two nodes. I decided to connect them as a "crossover", because I wanted to test as though it was a Modbus network with one node as a Master and the other node as a slave device. So, I wired the Tx pairs on one dongle to the Rx pairs on the other dongle.
Here are pictures - sorry, don't have enough karma to post them as separate images yet:
For node one (the master) - white/green and green are connected to TR+ and TR-, and white/blue and blue are connected to RD+ and RD-. Brown connects to Gnd.
Then, on node two, I crossed them over: white/blue and blue are connected to TR+ and TR-, and then white/green and green connect to RD+ and RD-. Brown again goes to Gnd.
I set minicom to read from /dev/ttyUSB0 on both of them to be 115200/8/N/1, and success! I could type on node 1 and see it show up on node 2, and vice versa. Typing on node one lit up the Tx light on the Node 1 dongle and the Rx light on the node 2 dongle, and again vice versa.
This is where things get weird. I wired in node 3, exactly like node 2 (white/blue and blue are connected to TR+ and TR-, and then white/green and green connect to RD+ and RD-). Node 2 had each pin connected to two pairs of wires (shown above) and node 3 was wired with only one pair of wires.
And still success! I could type on node 1, and see it on both nodes 2 and 3.
But then something unexpected happened: if I typed on node 2, I saw it on node 1 - but I also saw it on node 3! This was unexpected: node 2 and 3 share the Tx pair, but somehow node 3 is reading from the Tx pair as though it was Rx, without the same crossover that happens at node 1. The full combo turns out to work - if I type at node 3, node 1 and node 2 both see it as well.
So, my question is: how is this happening? Is the USB dongle doing some kind of magic where if it sees data on Tx but it knows it is not the one transmitting, it switches it to Rx? Do "T/R-, T/R+, RXD-, RXD+, Gnd" not mean what I think they mean? I do not have a resistor on either end, in part because I'm not sure of where it would go, so is there some kind of reflection going on?
My worry is that I'm going to get into something undebuggable when I switch between protocols - Modbus wants a 'Master/Slave' setup, with Tx going to multiple Rx of the slave devices, but BACnet appears to want everything on a completely shared bus - all the Tx goes to the Tx of all devices. I thought I was in Modbus configuration, but I'm just not sure anymore.