TLDR:
- I need to make a network of arduinos that will receive data, process it and send it to other output arduinos.
- The destination and origin of the messages is given by wether they are plugged.
- They must allow many inputs and outputs
Explanation:
I have been studying and struggling on how to make a kind of distributed processing environment using arduinos, and of course, the communication protocol is the hardest part. I tried to make my own protocol with a simpler scheme, but I learned that I would need a lot of low level knowledge on AVR and C programming that I don't have. For the sake of prototype I am thinking to use ready made libraries, but it is not so easy yet:
I describe below what I am trying to do in terms of communication. But an image will make it way easier:
[see attached image]
I mainly need each arduino to have n possible data inputs, and n possible data outputs. The best would be that n is 'virtually unlimited', but it will be ok for now if n is just more than 1, in which case I could do a module that forks the stream, effectively making a virtually unlimited amount of outputs (at cost of speed), but that is not well desired.
*The data outputs can all be the same, as the output value will always be the same to all the "children". However, some "children" may be busy, meaning that perhaps it is easier to keep outputs independent.
The devices are dinamically plugged and unplugged, but they can be already powered then, avoiding hot plugging problems (thanks, grumpy_mike http://forum.arduino.cc/index.ph... )
I also need the "network" to be "heterogeneous", meaning that hopefully it doesn't need one single master, specially because there are many isolated communication nodes. If I am a node, I know what I am sending to my children node, but I have no idea of what that "children" node is sending to my "grandchildren" node.
If interested, an example application is the one in this video (https://www.youtube.com/watch?v=...), only that in hardware, with all the changes that it implies to the idea.
So, a thought solution was that each device (arduino) would use the I2C protocol twice. Each device is both a slave and a master: it is a master to all the devices down, and a slave to all the devices up. Would this work? or will I be wasting my time, as I have been quite some days already?
if so, what is the best solution?
Am I dreaming of making a rocket to mars?
I know that mega readily does that, but I think it is on the expensive side, and also it has too much processing power that will be wasted, and that makes me sad. Whilst I will try to avoid it, if it is too much of a hassle, I can go for it.
[note: I posted the same question in the arduino forum http://forum.arduino.cc/index.ph...