Direct Arduino to Arduino Ethernet problems

Hi all

I have been battling away on a project where I want to send simple temperature values directly from one arduino to another arduino, both with W1500 ethernet shields attached. To start I am simply trying to send “hello world” from one to the other and having the receiver display in the serial port.

I have a crossover cable between the two arduinos, and I have confirmed both the sheilds are connected and ethernet cables are connected correctly.

I have been unable to receive any communication on the receiver side, the packetsize has been 0 at all times. I would think the transmitter is working correctly, since the TX LED flashed continuously and “Message Sent” is repeatedly displayed on the serial port. I therefore believe it to be the receiver. Switching the ethernet shields has the same results.

Any guidance would be greatly appreciated! Thanks in advance.


//Transmitter Code
//Observations: Seems to work. TX light on shield flashes continuously.

#include <SPI.h>        
#include <Ethernet.h>
#include <EthernetUdp.h>

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //Destination MAC address

IPAddress ip(192, 168, 0, 25); //Local IP address
IPAddress destIp(192,168,0,21); //Destination ip address

unsigned int localPort = 5000; // local port to listen on
unsigned int destPort = 5005; //Destination port

EthernetUDP Udp; //Instance of UDP

char message[] = "Hello World!";

/*Initialise the sending of data using UDP over ethernet*/
void setup() {


  Ethernet.begin(mac,ip); // start the Ethernet and UDP:

void loop() {

  Udp.beginPacket(destIp, destPort); //Start Packet


    Udp.endPacket(); //Close Packet

    Serial.println("Message Sent"); //Send Confirmation message



#include <SPI.h>    
#include <Ethernet.h>
#include <EthernetUdp.h>

// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
IPAddress ip(192, 168, 0, 21);

unsigned int localPort = 5005;      // local port to listen on

// buffers for receiving and sending data
char packetBuffer[UDP_TX_PACKET_MAX_SIZE];  // buffer to hold incoming packet,
char ReplyBuffer[] = "acknowledged";        // a string to send back

// An EthernetUDP instance to let us send and receive packets over UDP
EthernetUDP Udp;

void setup() {

  // start the Ethernet
  Ethernet.begin(mac, ip);
  // Open serial communications and wait for port to open:
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only

  // Check for Ethernet hardware present
  if (Ethernet.hardwareStatus() == EthernetNoHardware) {
    Serial.println("Ethernet shield was not found.  Sorry, can't run without hardware. :(");
    while (true) {
      delay(1); // do nothing, no point running without Ethernet hardware
  if (Ethernet.linkStatus() == LinkOFF) {
    Serial.println("Ethernet cable is not connected.");

  // start UDP
  Serial.print("hereee ");

void loop() {
  // if there's data available, read a packet
  int packetSize = Udp.parsePacket();
   // Serial.println(packetSize);
  if (packetSize) {
    Serial.print("Received packet of size ");
    Serial.print("From ");
    IPAddress remote = Udp.remoteIP();
    for (int i=0; i < 4; i++) {
      Serial.print(remote[i], DEC);
      if (i < 3) {
    Serial.print(", port ");

    // read the packet into packetBufffer, UDP_TX_PACKET_MAX_SIZE);

    // send a reply to the IP address and port that sent us the packet we received
    Udp.beginPacket(Udp.remoteIP(), Udp.remotePort());

Each Ethernet device must have a unique MAC address. The two programs use the same mac address. Usually Arduino Ethernet shields come with a piece of paper with a unique MAC address. I stopped and did not look at the rest of the program.

Maybe some day Arduino hardware engineers figure out how to program the MAC address in the Ethernet adapter before it leaves the factory like every other Ethernet device on the planet.

Cheers for that. That was a mistake which didn't exist in previous versions. Changing the MAC address did not result in any change to the system. My Ethernet shields never came with mac address, and I have read that the mac address simply has to be unique for the system it is used in, hence these random values used

You’re correct. You don’t need to use any special MAC. Just make up values that are unique.

You actually shouldn’t need the crossover cable with the W5100 since it does auto-MDIX, but it shouldn’t hurt either.

Yeah I thought so with the MAC address, but the auto-MDIX is news to me.

Has any one else been able to communicate directly between arduino uno?

So I have been using wire shark and the arduino seems to be transmitting just fine.

I did notice however that the lights are completely different between being plugged into the computer and being plugged into another ethernet shield. Infact the lights are no different to when the ethernet is unplugged, which suggests something is going wrong with my connections.

The first photos show arduino to arduino ethernet connection.


The second photos show arduino to PC connection.

I have used both crossover and standard cables, and have checked both arduino communicate to the PC. This definetly has me stumped. Any ideas?

Arduino to PC


I have now installed a Ethernet switch between the two arduinos. Still no received messages though