Hi all,
this is my first post and I would like to congratulate you for this wonderful site
I am also interested in a wired network and I know that rs485 bus has some limitations.. but rs485 modules are also really cheap (and I have already bought a lot of them ).
Just an idea to handling the bus.. why don't you use a different size for the first message that Leo propose to check the collision? The size should follow a priority: maximum priority for Controller/Gateway, less priority for Repeater, lower priority for Sensor nodes.
For example
3 start bytes - Controller/Gateway
2 start bytes - Repeater
1 start byte - Sensor Node
In this way if a sensor and the Gateway start sending the byte in the same time, the gateway wins.
This could help also with sensors that need high priority, for example alarms. In this case we only need to change the priority of the sensor that send the message (maybe with a new option on the send() command .. like the ack option).
Max