Wifi_ping not working

Hi @PJ_Glasso, you are right about the details but I thought that inserting the topic in the WIO Terminal topic was automatic to indicate that I am working with WIO terminal. I used the wifiping example of the Arduino Seed rpcWiFi library. I insert the example below for clarity.

Click to see the code

/*
 *  This sketch sends data via HTTP GET requests to examle.com service.
 */

#include <rpcWiFi.h>
#include <rpcPing.h>

#include "secrets.h" 
char ssid[] = SECRET_SSID;
char password[] = SECRET_PASS;
const char *host = "www.baidu.com";
const char *url = "/index.html";

void setup()
{
    Serial.begin(115200);
    delay(10);

    // We start by connecting to a WiFi network

    Serial.println();
    Serial.println();
    Serial.print("Connecting to ");
    Serial.println(ssid);

    WiFi.begin(ssid, password);

    while (WiFi.status() != WL_CONNECTED)
    {
        Serial.print("Connecting to ");
        Serial.println(ssid);
        WiFi.begin(ssid, password);
        delay(1000);
        
    }

    Serial.println("");
    Serial.println("WiFi connected");
    Serial.println("IP address: ");
    Serial.println(WiFi.localIP());
}

int value = 0;

void loop()
{
  delay(5000);
  Serial.print("Pinging host ");
  Serial.println(host);
  bool ret = Ping.ping(host);
  //float avg_time_ms = Ping.averageTime();
  if(ret) {
    Serial.println("Success!!");
    Serial.println("TIME: ");
   // Serial.println(avg_time_ms);
  } else {
    Serial.println("Error :(");
  }
    
}

Thanks for any help

1 Like