Arduino over IP

Hi

We are looking at a project where we would need to do the following:

We would have a Master Arduino with IP Shield that was connected to a Network also on the same Network would be a slave Arduino with IP Shield. What we want to do if one of the Arduino's was to lose connection this would be seen by the Master. The Master would then run a command to send a script to a PC via USB.

We would also be looking at if is possible for one Arduino on IP to see the GPIO of another on the same network.

By "IP Shield" did you mean "Ethernet Shield"?

EnhanceAutomation:

  1. We would have a Master Arduino with IP Shield that was connected to a Network.

  2. Also on the same Network would be a slave Arduino with IP Shield.

  3. What we want to do if one of the Arduino's was to lose connection this would be seen by the Master. The Master would then run a command to send a script to a PC via USB.

  4. We would also be looking at if is possible for one Arduino on IP to see the GPIO of another on the same network.

All of that could be done. Have the slaves send periodic UDP packets to the Master. The Master would keep track of how long it has been since the last UDP packet from each slave. If the time grows beyond a chosen number of packet intervals a message is sent to the PC via USB Serial. Naturally the more quickly you want to detect the failure the more often you have to send packets. This might cause extra alarms if traffic is delayed.
The UDP packets can contain the values of any "GPIO" pins you want.

Hi

Yes I did mean Ethernet shield. Thanks for the reply do you have any basic code to get me started for this as I'm not to sure about where to start with the UDP.

Yes I did mean Ethernet shield. Thanks for the reply do you have any basic code to get me started for this as I'm not to sure about where to start with the UDP.

Unless you have a particular need for UDP, typical tcp/ip using web server/client http protocol might be easier to setup.

Just use tcp sockets.

You can use TCP if you don't mind having to wait for the timeout failure to detect that communications has failed. The Master would also have to send to the slaves to detect failure since the slaves stopping sending TCP packets would not be noticed by the Master.

For UDP you can look at File->Examples->Ethernet->UDPSendReceiveString for the basics.