Cannot Verify ESP32Ping.h Library
Posted: Mon Sep 01, 2025 4:07 pm
In attempt to solve a PHP texting issue I have tried using the ESP32Ping library in an app to determine if the domain in question can be reached or pinged.
PROBLEM - If I include the correct IP address in the 'remote_ip() variable I get 'Success!!'. If I leave that same variable blank (" "), I still get 'Success!!'. This makes no sense to me so I my code must not be correct. Any help will be greatly appreciated.
Here is my sketch:
PROBLEM - If I include the correct IP address in the 'remote_ip() variable I get 'Success!!'. If I leave that same variable blank (" "), I still get 'Success!!'. This makes no sense to me so I my code must not be correct. Any help will be greatly appreciated.
Here is my sketch:
Code: Select all
#include "config.h"
#include <WiFi.h>
#include <ESP32Ping.h>
const IPAddress remote_ip(" ");
void connect_wifi()
{
Serial.println();
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi Connected!\n");
Serial.print("IP address: ");
Serial.print(WiFi.localIP());
Serial.println();
}
void setup() {
Serial.begin(115200); delay(1000);
connect_wifi(); delay(1000);
}
void loop() {
if(Ping.ping(remote_ip)) {
Serial.println("Success!!");
} else {
Serial.println("Error :(");
}
delay(15000);
}