ESP32_ping
ESP32_ping copied to clipboard
i hope this helps someone(:
void setup() {
Serial.begin(115200);
Serial.print("Connecting t ");
Serial.println(ssid);
// WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } Serial.print("We got IP: "); Serial.println(WiFi.localIP()); Serial.print("And gateway: "); Serial.println(WiFi.gatewayIP()); }
// the loop function runs over and over again until power down or reset void loop() { Serial.print("For testing wifi we can always just ping the gateway"); if (ping_start(WiFi.gatewayIP(), 4, 0, 0, 5)) Serial.println("OK"); else Serial.println("FAILED"); delay(10000);
}