Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pings are failing #21

Open
buzzy opened this issue Sep 28, 2018 · 0 comments
Open

Pings are failing #21

buzzy opened this issue Sep 28, 2018 · 0 comments

Comments

@buzzy
Copy link

buzzy commented Sep 28, 2018

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);

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant