Sending and receiving data between two Arduino Uno over a ethernet cable.

Hello,
I'm trying to figure out the best way to transfer data between two Arduino Uno’s. Arduino # 1 presents data from Arduino #2 and changes the setpoint for Arduino # 2 position control via the keypad. This means that both Arduinos will send and receive data, and this is where I have problems. The computers communicate via a 50 meter long Ethernet cable. It is a local network without internet connection. On this cable, some cameras also communicate to a recorder, see picture below. I have experimented with TCP but cannot both send and receive data. I have read on different forums about different ways to communicate but cannot find the right one.
A 70-year-old man who is happy to receive help.

Maybe try UDP instead. The ethernet library has an example UDPSendReceiveString that you may be able to adapt.

It would be worth posting up your code (use code tags) so we can see how you are trying now.

Make sure the two Arduinos have different MAC addresses. You have a router on the network why? If it is there to act as a dhcp server, print out the local ip address on each Arduino once you have started Ethernet and TCP/IP.

Presumably the 50m cable is CAT5 or CAT6 in which case that should be no problem.

Can you attach a PC to the network and ping each Arduino - that would ensure that the network between the 2 is working as expected and eliminate any problems like cables not plugged in properly, broken wires in the cables, bad crimping etc.

Is the position control you refer to for the engine shown on your diagram? You sort of jump in without any real introduction about what you are trying to achieve other than reading a keypad on one Arduino and setting a position control on the other. Roughly how often will the two exchange messages and how much data will be in each message?

Are the cameras and NVR independant to the Arduinos?

How much background with Ethernet & TCP do you have? There are a number of ways of sending data between the two Arduinos but a little more backgound information as outlined above would help ensure avoiding very inappropriate options. Are you likely to want to add any other functionality in the future, such as a way to remotely interrogate the Arduinos maybe by using a web page?

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.