idontwantausername
Member
My project has ~20 teensys connected via half-duplex RS485. One is a slave, others are masters. The masters are sending bursts of data that is pretty time-sensitive so implementing 1 master - 19 slaves isn't going to work. Only a fraction of masters is transmitting at the same time.
For hardware, I'm using my own board based on Arduino MKR 485 Shield. I'm also using their ArduinoRS485 library which has been working fine.
The problem is that I get collisions. I think the easiest way to fix it would be to read the bits as they are being transmitted and if a collision is detected, abort and try again after a random interval.
The only way to get access the serial port at bit level that I can think of is to use a software (bit-bang) serial library. Is that the best way?
Is my collision strategy likely to work or does it need to be more complex than that?
I'm aware of this RS485 library which implements collision avoidance but it's pretty intimidating in it's complexity.
For hardware, I'm using my own board based on Arduino MKR 485 Shield. I'm also using their ArduinoRS485 library which has been working fine.
The problem is that I get collisions. I think the easiest way to fix it would be to read the bits as they are being transmitted and if a collision is detected, abort and try again after a random interval.
The only way to get access the serial port at bit level that I can think of is to use a software (bit-bang) serial library. Is that the best way?
Is my collision strategy likely to work or does it need to be more complex than that?
I'm aware of this RS485 library which implements collision avoidance but it's pretty intimidating in it's complexity.