Some networking fun: 28 arduinos linked in a network

I've been thinking of the network control here, and the cost of the devices. Ethernet simplifies some things, but is expensive, and still leaves you with a bit of programming to do.

Can the nodes be polled, or do they react to an event to transmit data?

If they can be polled, I believe I'd :

  • Buy $4 RS-485 boards off eBay
  • Give each node a node-id.
  • Put each node in listen-mode (in RS485 terms)
  • Use EasyTransfer for the transfers back & forth, as this simplifies programming, adds checksums etc. It also simplifies management of data types, you can send an arbitrary struct.
  • Have the Master send a package to each node in turn, then have Master go to "listen mode".
  • A node having received "his" package prepares his return data, enables transmit mode, sends data, and goes to "listen" again.
  • The master receives data, handles this in an appropriate way, enables transmit, and repeats.
  • The master needs to handle a time-out
  • You might get electrical problems on the RS485 bus if a node gets stuck in transmit enable mode.

btw: the avrdude issue usually means that you have something hogging the serial port on the Arduino - a device is hooked up to TX/RX and conflicts with the IDE trying to use the same pins.