Ethernet ping

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Leobute
 
Posts: 3
Joined: Sun May 30, 2021 4:01 pm

Ethernet ping

Post by Leobute »

Hi all,
there are weeks i am becoming mad in finding some way to simply ping a server.
I have checked w5500 library, Ethernet2 library, but i cannot end with it.
Or receiving error message lwip\icmp.h not found, or error during compiling....

Please, can you help me telling a library to download or a way that let me simply ping some server ?

Really thanks

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Ethernet ping

Post by adafruit_support_mike »

The Ethernet library doesn't support ICMP (the connection protocol of ping packets), for arguably good reasons:

Pings are notoriously easy to abuse, for everything from address harvesting (find machines in an unknown network by pinging the broadcast address and seeing which ones respond) to denial of service attacks (ping flooding). Many ISPs and firewalls block ICMP by default.

Considering how easy it would be to turn a microcontroller into a ping flood generator:

Code: Select all

void loop () {
    ping( address );
}
I can see the point of making it harder to do.

If you aren't interested in rolling your own ICMP layer, I'd suggest polling servers by trying to open a TCP connection to some well-known port. It's more complicated, but will tell you whether the server is answering calls.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”