Finally with all help from forum and from comments of my previous posts ,
I Could establish communication between:
- 2 arduino Due using ethernet switch (bi directional communication)
- 1 arduino and laptop again using same switch. (bi directional communication)
Thanks to all.
But my next issue where I am stuck is:
I have 3 arduino due, 1 of which is server and 2 other to be clients.
I am able to assign unique ip and mac address to each arduino.
Some of the commands I know on server side is
IPAddress ip(192, 168, 1, 177); EthernetServer server(23); Ethernet.begin(mac, ip, gateway, subnet); server.begin(); EthernetClient client = server.available(); client.parseInt(); (to receive an integer)
Some of the commands on Client side
IPAddress server(192,168,1,177); Ethernet.begin(mac, ip, gateway, subnet); client.connect(Server,23); client.println("something here");
Now the questions are:
- How would server know which client got connected ?
- Can both clients be connected together to server ? Of course the data receiving at server will be sequentially but can all 3 arduino be stay connected all the time ? (i.e. I don't need to do again and again client.connect etc ?
- Also if 2 clients are simultaneously sending client.println command then how to receive both the information on server arduino and how to differentiate them that which one sent which command ?