ESP8266Ping icon indicating copy to clipboard operation
ESP8266Ping copied to clipboard

Pings are failing

Open buzzy opened this issue 6 years ago • 0 comments

I made a very simple test where I connect to another ESP8266 and then try to ping it. I connect correctly and get the IP 192.168.4.2 on my "slave" ESP8266. But trying ping the "master" ESP8266 on 192.168.4.1 fails. Any idea why? If I connect to the "master" ESP8266 from my laptop, I can ping it without any issues.

#include <Arduino.h> #include <ESP8266WiFi.h> #include <ESP8266Ping.h>

const char *ssid = "ESP8266"; const char *password = "testpassword";

IPAddress ip (192, 168, 4, 1);

void setup() { Serial.begin(9600);

WiFi.begin(ssid, password);

while (WiFi.status() != WL_CONNECTED) { // Wait for the Wi-Fi to connect
    delay(1000);
}

Serial.println(WiFi.localIP());

}

void loop() { bool ret = Ping.ping(ip); if (ret) { Serial.println("PING! PONG!"); } else { Serial.println("Failed"); }

delay(1000);

}

buzzy avatar Sep 28 '18 17:09 buzzy