I just need to know, which protocol is best for multiple Arduino connection with automatic address assignment?
I want to have an Arduino mega as master, and as many as possible mini arduinos as slave! but it is not possible to give every module fix address! so it should be dynamic!
You have not told us what sort of physical communication you propose to use. Will it be wired, or wireless? And in either case, what specific system will you be using?
It also makes it much easier to help if you tell us what your project is intended to do?
If it is wireless and you have a really lot of programming experience, you could emulate the very FIRST local area network, called the Aloha Net. Used to transmit data to and from the various Hawaii islands. Each site would transmit and wait for an acknowledgment. If none came, then the site would wait for a truly random time and then try the transmission again. I don't know the number of slave sites, but it did run successfully.
I have never read of anyone doing it again, but you may want to consider it.
Robin2:
You have not told us what sort of physical communication you propose to use. Will it be wired, or wireless? And in either case, what specific system will you be using?
It also makes it much easier to help if you tell us what your project is intended to do?
...R
It will be wired, with some modular connections like puzzles.
I want to have some modules which connected to the main controller and assign address automatically.
Every module designed for certain job, for example Temperature sensors module, but sometimes we need more sensors. so we need to add another (SAME) module. but it should be very easy because of other peoples need to work with this system. and in this case I need automatic address assignment solution. something like USB
Paul_KD7HB:
If it is wireless and you have a really lot of programming experience, you could emulate the very FIRST local area network, called the Aloha Net. Used to transmit data to and from the various Hawaii islands. Each site would transmit and wait for an acknowledgment. If none came, then the site would wait for a truly random time and then try the transmission again. I don't know the number of slave sites, but it did run successfully.
I have never read of anyone doing it again, but you may want to consider it.
Paul
Actually I have an Idea,
Every new module attache to the system using a loop to send a command to every possible address and if an address does not respond then assign that address to the module! something like ping, but much much simpler. for few possible addresses, maybe 30.
The only problem in this method is, if an already assigned module move to other system and on second environment the address was already assigned then we have a conflict
Power_Broker:
Haven't looked too far into your requirements, but sounds like you should seriously consider the CAN protocol. Might be just what you need.