Help with ethernet shield Ping example please

Greetings,

I am looking for a simple example to get me started with an ethernet shield R3, W5100 on my Arduino UNO.

I want the arduino to ping a device (192.168.0.21) on the network and return the ping status via serial interface or led etc.

I have found the example code and managed to give the Arduino an IP address (192.168.0.111) and can ping it from my laptop when connected directly. So I'm confident everything is on the same network and able to communicate.

So now I just need some help to get the Arduino to initiate the ping please?

I cant find any examples or library that i can use so any help would be greatly appreciated.

This is what I have used to give my device an IP and its working and detecting the W5100 chipset OK.

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

byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
IPAddress ip(192,168, 0, 111);

void setup() {
  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }

  Ethernet.begin(mac, ip);

  if (Ethernet.hardwareStatus() == EthernetNoHardware) {
    Serial.println("Ethernet shield was not found.");
  }
  else if (Ethernet.hardwareStatus() == EthernetW5100) {
    Serial.println("W5100 Ethernet controller detected.");
  }
  else if (Ethernet.hardwareStatus() == EthernetW5200) {
    Serial.println("W5200 Ethernet controller detected.");
  }
  else if (Ethernet.hardwareStatus() == EthernetW5500) {
    Serial.println("W5500 Ethernet controller detected.");
  }
}

void loop () {}

Try the Arduino-Ping library.

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