Unable tp ping remote host using ESP32 ping

kian79
Posts: 30
Joined: Thu Jun 13, 2019 3:27 am

Unable tp ping remote host using ESP32 ping

Postby kian79 » Sun Oct 09, 2022 12:41 am

Hi all,

I am following an example for this website:
https://techtutorialsx.com/2019/10/05/e ... mote-host/

I am able to successfully connect to my home WIFI network, but ping method just doesn't work and returns an error message "Ping failed" all the time.

Code: Select all

bool success = Ping.ping("www.google.com", 3);
 
if(!success){
    Serial.println("Ping failed");
    return;
}
 
Serial.println("Ping succesful.");
Would anyone know what could be the problem or how can I go about troubleshooting this problem?

Thanks in advance!

felmue
Posts: 70
Joined: Mon Nov 16, 2020 2:55 pm

Re: Unable tp ping remote host using ESP32 ping

Postby felmue » Sun Oct 09, 2022 7:04 am

Hello @kian79

have you tried to ping a different host? have you tried to connect to a different AP?

Thanks
Felix

P.S. the included ping example HostPing.ino works for me.

a2800276
Posts: 78
Joined: Sat Jan 23, 2016 1:59 pm

Re: Unable tp ping remote host using ESP32 ping

Postby a2800276 » Mon Oct 10, 2022 5:51 am

Some hosts don't respond to pings. Some network configurations may filter the necessary ICMP packets.

- Can you ping the target from a laptop connected to the same Wifi?
- Can you ping a different target from your device?
- Can you open a network connection (e.g. HTTP) from your device?

kian79
Posts: 30
Joined: Thu Jun 13, 2019 3:27 am

Re: Unable tp ping remote host using ESP32 ping

Postby kian79 » Mon Oct 10, 2022 12:22 pm

Hi all,

I tried some of the suggestions above. Using my home Wifi network, I tried changing different host names but ping is still unsuccessful.

However, when I set my mobile phone as a hotspot device and have the ESP32 connected to it, I was able to ping successfully different hostnames, eg www.google.com etc etc.

So I guess it has something to do with my home wifi network. But I don't know exactly what is causing it, the router settings maybe? I need the ESP32 to be connect to my home WiFi and not a mobile hotspot.

MagicEsp
Posts: 1
Joined: Mon Feb 12, 2024 6:29 pm

Re: Unable tp ping remote host using ESP32 ping

Postby MagicEsp » Mon Feb 12, 2024 6:36 pm

I've spent the past 2 hours with trying to fix this - -- I was using an old phone charger with the Esp32 - I swapped it out with another and hey presto It works! I can ping and see the web page - so it may be something you might want to try.

Spooky!

Who is online

Users browsing this forum: Baidu [Spider], Google [Bot] and 65 guests