Git Product home page Git Product logo

esp8266ping's Introduction

ESP8266Ping

Let the ESP8266 ping a remote machine.

With this library an ESP8266 can ping a remote machine and know if it's reachable. It provide some basic measurements on ping messages (avg response time).

Usage

First, include the library in your sketch along with WiFi library:

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

Next, simply call the Ping.ping() function

IPAddress ip (192, 168, 0, 1); // The remote ip to ping
bool ret = Ping.ping(ip);

ret will be true if the remote responded to pings, false if not reachable. The library supports hostname too, just pass a string instead of the ip address:

bool ret = Ping.ping("www.google.com");

Additionally, the function accept a second integer parameter count that specify how many pings has to be sent:

bool ret = Ping.ping(ip_or_host, 10);

After Ping.ping() has been called, the average response time (in milliseconds) can be retrieved with

int avg_time_ms = Ping.averageTime();

esp8266ping's People

Contributors

andreas-ibm avatar andreyshamis avatar dancol90 avatar probonopd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esp8266ping's Issues

ping library for ESP32?

I've been using this library on a NODE (ESP8266) but I now need to move the project to an ESP32. Would it be possible to extend the library to work on the ESP32?

Curious problem

When using Arduino 1.8.13 and esp8266 2.7.4 boards version, I got success whenever pinging outside of my local network. If I replaced "google.com" with some outlandish URL, I invariably got success. I updated to the latest Arduino1.8.19 and esp8266 3.0.2 and everything started working. I was using a Wemos D1 mini and modifying the example "HostPing".
If you get stuck with the library seemingly not working, try updating your IDE and boards/libraries. I hope that this might help someone avoid the lost time that I suffered.

WeMos D1 mini

Hello, Im trying your library but it works weird at my WeMos D1 mini and IDE 1.8.1.
If internet run normaly, then:
Ping.ping("www.google.com") return 1
Ping.averageTime() return time about 17-20ms
But, If I disconnect cable from my ISP out of wifi router then Ping.ping still return 1 and time is 0-10ms.
And when wifi router is switched off, then Ping.ping return 0.

Here is part of my code and serial monitor.
wemos ping
Im using Wifi router Tenda F300.

Please make ping async

As title,
pinging requires a lot of time with this lib.

Is it possible to make it async?

PingClass not defined as extern? So header file cannot be referenced in multiple source files in same project?

PingClass not defined as extern? So header file cannot be referenced in multiple source files in same project? I want to use PingClass in multiple locations in source, which has multiple source files. This can be done with other ESP8266 libraries/APIs header files, but no yours. If I include ESP8266Ping.h in more than a single source file (.cpp). For example Server.cpp and Wireless.cpp, results in compile/link errors.

c:/users/[redacted]/documents/arduinodata/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: sketch\Wireless.cpp.o:(.bss._ZN9PingClass7_errorsE+0x0): multiple definition of `PingClass::_errors'; sketch\Server.cpp.o:(.bss._ZN9PingClass7_errorsE+0x0): first defined here

c:/users/[redacted]/documents/arduinodata/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: sketch\Wireless.cpp.o:(.bss._ZN9PingClass8_successE+0x0): multiple definition of `PingClass::_success'; sketch\Server.cpp.o:(.bss._ZN9PingClass8_successE+0x0): first defined here

c:/users/[redacted]/documents/arduinodata/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: sketch\Wireless.cpp.o:(.bss._ZN9PingClass9_avg_timeE+0x0): multiple definition of `PingClass::_avg_time'; sketch\Server.cpp.o:(.bss._ZN9PingClass9_avg_timeE+0x0): first defined here

c:/users/[redacted]/documents/arduinodata/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: sketch\Wireless.cpp.o:(.bss._ZN9PingClass15_expected_countE+0x0): multiple definition of `PingClass::_expected_count'; sketch\Server.cpp.o:(.bss._ZN9PingClass15_expected_countE+0x0): first defined here

c:/users/[redacted]/documents/arduinodata/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: sketch\Wireless.cpp.o: in function `PingClass::_ping_recv_cb(void*, void*)':

C:\Users[redacted]\Documents\Arduino\libraries\ESP8266Ping\src/ESP8266Ping.impl.h:67: multiple definition of `PingClass::_ping_recv_cb(void*, void*)'; sketch\Server.cpp.o:C:\Users[redacted]\Documents\Arduino\libraries\ESP8266Ping\src/ESP8266Ping.impl.h:67: first defined here

c:/users/[redacted]/documents/arduinodata/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: sketch\Wireless.cpp.o: in function `PingClass::PingClass()':

C:\Users[redacted]\Documents\Arduino\libraries\ESP8266Ping\src/ESP8266Ping.impl.h:23: multiple definition of `PingClass::PingClass()'; sketch\Server.cpp.o:C:\Users[redacted]\Documents\Arduino\libraries\ESP8266Ping\src/ESP8266Ping.impl.h:23: first defined here

c:/users/[redacted]/documents/arduinodata/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: sketch\Wireless.cpp.o: in function `PingClass::PingClass()':

C:\Users[redacted]\Documents\Arduino\libraries\ESP8266Ping\src/ESP8266Ping.impl.h:23: multiple definition of `PingClass::PingClass()'; sketch\Server.cpp.o:C:\Users[redacted]\Documents\Arduino\libraries\ESP8266Ping\src/ESP8266Ping.impl.h:23: first defined here

c:/users/[redacted]/documents/arduinodata/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: sketch\Wireless.cpp.o: in function `PingClass::ping(IPAddress, unsigned char)':

C:\Users[redacted]\Documents\Arduino\libraries\ESP8266Ping\src/ESP8266Ping.impl.h:25: multiple definition of `PingClass::ping(IPAddress, unsigned char)'; sketch\Server.cpp.o:C:\Users[redacted]\Documents\Arduino\libraries\ESP8266Ping\src/ESP8266Ping.impl.h:25: first defined here

c:/users/[redacted]/documents/arduinodata/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: sketch\Wireless.cpp.o: in function `PingClass::ping(char const*, unsigned char)':

C:\Users[redacted]\Documents\Arduino\libraries\ESP8266Ping\src/ESP8266Ping.impl.h:54: multiple definition of `PingClass::ping(char const*, unsigned char)'; sketch\Server.cpp.o:C:\Users[redacted]\Documents\Arduino\libraries\ESP8266Ping\src/ESP8266Ping.impl.h:54: first defined here

c:/users/[redacted]/documents/arduinodata/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: sketch\Wireless.cpp.o: in function `PingClass::averageTime()':

C:\Users[redacted]\Documents\Arduino\libraries\ESP8266Ping\src/ESP8266Ping.impl.h:65: multiple definition of `PingClass::averageTime()'; sketch\Server.cpp.o:C:\Users[redacted]\Documents\Arduino\libraries\ESP8266Ping\src/ESP8266Ping.impl.h:65: first defined here

c:/users/[redacted]/documents/arduinodata/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-3-20ed2b9/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: sketch\Wireless.cpp.o:C:\Users[redacted]\Documents\Arduino\libraries\ESP8266Ping\src/ESP8266Ping.h:57: multiple definition of `Ping'; sketch\Server.cpp.o:C:\Users[redacted]\Documents\Arduino\libraries\ESP8266Ping\src/ESP8266Ping.h:57: first defined here

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board NodeMCU 0.9 (ESP-12 Module).

Non-blocking version?

I am using this library in a home automation project. Basically, the device pings my (local) MQTT broker and 8.8.8.8 every minute to make sure the broker and the internet connection are working. If several consecutive attempts fail, the device reboots in AP mode and waits for someone to fix it, probably by giving updated Wi-Fi credentials or a new MQTT broker address.

It works pretty well. The problem is that the ping process is slow and blocks the device from doing anything else. I don't know enough C to look at this code and figure out exactly what is happening. Is there a way to make a version of this library where one could specify a function or instruction to run in a loop while waiting for the ping to execute? Mostly I want the device to be able to respond to MQTT messages and HTTP requests while executing a ping.

I guess I could drop the ping frequency to once every five minutes or something, but I think there is a more elegant solution.

[Feature Request] Timeout for ping

@dancol90 Hello,
Is there any method to set timeout while pinging? If the ping is not received within the timeout, return as HOST_UNREACHABLE.
I really need the timeout feature for my application where ESP needs to figure whether the network is connected to the internet or not.
Something like following will be nicer to have:

Ping.setTimeout(ms);
bool status = Ping.ping(HOST);

Adjust Packet Size

Hi,
Thanks for sharing this library! Its been working so far but I was wondering if it was possible to adjust the packet size.

Cannot be used across multiple TUs

Code goes in .cpp files, not .h files. This library cannot be used across multiple translation units. It needs refactoring into a .h and .cpp pair rather than a monolithic .h file.

The .h file should contain the class definition and an extern to a global instance (if one is really needed). The .cpp file should contain the implementation and, if one is needed, a global instance.

Pinging ip, but return false

I'm trying to ping my phone in the same network, but the function
bool pingip = Ping.ping(remote_ip, 5);
returns false
In Serial writes:
ping 15, timeout 0, total payload 480 bytes, 15511 ms
I thing ip is avalaibe but function returns false....

The whole code:
bool pingme() {
Serial.print("Pinging to ip\n");
bool pingip = Ping.ping(remote_ip, 15);
if(pingip) {
Serial.println("ping Success!!");
return true;
} else {
Serial.println("ping Error :(");
return false;
}
}

Ping fails

Every ip address and host names are failing to ping.
the Ping.averageTime() returns zero.

output from serial

Connecting to WiFi
..............
WiFi connected with ip 192.168.4.64
GATEWAY: 192.168.4.254
Pinging ip 192.168.4.254
Error :(
TIME: 0

Memmory Allocation

i had made a little code using this library and I experienced a system restart every few hours. After searching and debuging i´ve fount that everytime i use the ping.ping eats almost 50 bytes from memory, so, i guess when it run out of memory, some wahtchdog restarte de DSP32
code :
byte x=10, y=0;
if (Ping.ping(gateway,1)) {PingCount=0; lcd.setCursor (x,y); lcd.print ((char)4);}
else {PingCount++; lcd.setCursor (x,y); lcd.print (" ");}

Suggestion: retrieve ip address if ping to host was successful

Thanks for the library! Just a thought. Would be nice if one could retrieve the ip address from a ping reply to a host in order to save another dns request. I use the function to select one out of three servers based on their latency and whould like to use the returned ip address straight away instead of accessing the selected server by its host name once again.

Ping Fail ESP8266 + Platformio Core 6.1.11 / Home 3.4.4

Hello,

I try ESP8266Ping on ESP8266 + Platformio Core 6.1.11 / Home 3.4.4 and still return false. It is not working.

Any ideas?

Thanks.

`
#include <ESP8266HTTPClient.h>
#include <ESP8266WiFi.h>
#include <ESPAsyncTCP.h>
#include <WiFiClient.h>
#include <ESP8266Ping.h>

const IPAddress ipHomeGW(192.168.1.1);

if (Ping.ping(ipHomeGW)) {} //still return false

`

Add to the Arduino Library Manager

Hey Any plans to add this library to the Arduino Library Manager?
It looks ready to be added only needs the library.json file, to be complete

Thanks and I hope you consider this

Ping local domain name

Hi,

Thanks for sharing the library, kindly i want to ask if it possible to ping local domain name something like this:

Ping.ping("node.local");

note: node is another ESP8266 on the same local network.

I have tried from my pc to ping node.local and was successful but from your code i could note able to make it work.

Please enlighten me if you have a solution.

Best regards
Rabee

Pings are failing

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

}

Can't ping self.

If I don't call ping(), the ESP responds to ICMP ping requests from other devices on the local network. If I call ping(), the ESP cannot be pinged.

My test code:

`#define SKETCH "pingTest"
#define VERSION "1.00" // Four characters

/*
This program is a test of the ping function
*/

//-------------------------
#include <ESP8266Ping.h> //Includes ESP8266WiWi.h
#include <Kaywinnet.h> // WiFi credentials

char pingIP[20]; // IP that we're going to ping.

//****************************** SERIAL **************************
void beginSerial() {
Serial.begin(115200);
delay(1000);
Serial.println();
Serial.println(SKETCH);
Serial.println(VERSION);
Serial.println();
}

//****************************** WiFi **************************
void setup_wifi() {
Serial.println();
Serial.println("Connecting to ");
Serial.println(MY_SSID);

//WiFi.hostname(SKETCH);
WiFi.begin(MY_SSID, MY_PASSWORD);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(WiFi.status());
Serial.print(" ");
}

Serial.println("\nWiFi connected, ");
Serial.print("MAC Address: ");
Serial.println(WiFi.macAddress());
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
Serial.print("Hostname: ");
Serial.println(WiFi.hostname().c_str());
Serial.print(F("Default Gateway: "));
Serial.println(WiFi.gatewayIP().toString());
Serial.print(F("Subnet Mask: "));
Serial.println(WiFi.subnetMask());
}

//****************************** PING **************************

void pingit() {
Serial.print(pingIP);
Serial.print(F(": "));
if (Ping.ping(pingIP)) { // Ping
Serial.println("OK");
} else {
Serial.println("Fail");
}
// yield(); // Reset the WDT on the ESP8266
}

//****************************** SETUP **************************
void setup() {
beginSerial();
setup_wifi();
}

//****************************** LOOP **************************
void loop() {
strcpy(pingIP, "192.168.1.1");
pingit();
strcpy(pingIP, "192.168.1.57");
pingit();
strcpy(pingIP, "192.168.1.124");
pingit();
strcpy(pingIP, "192.168.1.183");
pingit();
strcpy(pingIP, "127.0.0.1");
pingit();

Serial.println(F("---------------"));
delay(1000);
}
`

Average ping time giving strange results

I have a NodeMCU running a program based on your example. Its pinging several different targets using your library.
I have set it to run 5 pings with a time out of 200ms.
One of the targets - 192.168.1.14 - returns long ping times and sometimes misses pings.

Here is one output from pinger.OnEnd

Ping statistics for 192.168.1.14:
Packets: Sent = 5, Received = 4, Lost = 1 (20.00% loss),
Approximate round trip times in milli-seconds:
Minimum = 21ms, Maximum = 142ms, Average = 323.00ms
Destination host data:
IP address: 192.168.1.14
MAC address: 78:32:1b:c6:dd:a9

I dont understand how an average of 323 can be true when the timeout is 200ms?
Sorry, my programming skills are not good enough to analyse or debug your code, so I'm just raising it as an issue.

Can't use domain name, must use IP address

I wrote a sketch for a Wemos D1 Mini that pings three of my local IP devices (router, MQTT broker and Home Assistant Pi) plus one external location, like google.com, amazon.com, for example. It repeats every five seconds. If a ping passes, a green LED is lit, else a red LED. I randomize my external IP addresses so not to look like a DOS attack. It could be 30-seconds between pings of the same host.

The basic idea is that I want to be able to tell at a glance if my local devices, router and the WWW are functioning.

It works just fine.. If I ping

Ping.ping(172.217.11.14)

... every five seconds, it runs forever with no issue.
However, if I ping

Ping.ping(google.com)

...after about 10-15 minutes I will crash out with "ESP Exception (9) and wdt reset ". The Wemos will restart and start running again for about 10-15 minutes. Repeat.

When I replace google.com with their IP address, 172.217.11.14, it runs forever without problems.

If I read correctly, Exception (9) means that the code has attempted to write to address space that the program doesn't have permission to use. (I can force the same crash by creating a char array for five characters and writing six characters to it.)

I am stumped.

DEBUG_PING

Hello,

How can i see the values of the DEBUG_PING(), like tresp_time and ttotal_time?

Thanks in advance

Pinging made up domain names also working?

Hi,

I was trying to ping google.com, and it was working fine but then I tried pinging a wrong domain name and it still came out fine.

if(Ping.ping("www.goog32143234114le.com")){
#ifdef DEBUG
Serial.println(Ping.averageTime());
Serial.print("Success! ");
Serial.print(minuteBetweenCheck);
Serial.println(" minutes");
#endif
vpnFails=0; // if the ping is OK , the we reset the vpn and google fails counter
googleFails=0;
}

Serial :

Success! Will try ping again in 1 minutes
Pinging vpn Server www.google.com
1
Success! Will try ping again in 1 minutes
Pinging vpn Server www.google.com
2
Success! Will try ping again in 1 minutes
Pinging vpn Server www.google.com
1
Success! Will try ping again in 1 minutes
Pinging vpn Server www.google.com
6
Success! Will try ping again in 1 minutes
Pinging vpn Server www.google.com
2
Success! Will try ping again in 1 minutes
Pinging vpn Server www.google.com
1

MAC address?

Is it possible to get the remote device MAC address in local network using ping?

Timo

'INT_MAX' was not declared in this scope

ESP8266Ping-master\src/ESP8266Ping.impl.h:30:17: error: 'INT_MAX' was not declared in this scope
     _min_time = INT_MAX;
                 ^
exit status 1

Hello,

I tried to use the library, but got above error. Do I have to declare INT_MAX myself?

Best Regards

unable to use "Ping.ping" method, doesn't compile.

any suggestions? the output of compilation error:

sketch/SimplePing.ino.cpp.o: In function `PingClass::_ping_recv_cb(void*, void*)':
/home/user/Arduino/libraries/ESP8266Ping-master/src/ESP8266Ping.impl.h:65: undefined reference to `ping_start'
sketch/SimplePing.ino.cpp.o: In function `PingClass::ping(IPAddress, unsigned char)':
/home/user/Arduino/libraries/ESP8266Ping-master/src/ESP8266Ping.impl.h:65: undefined reference to `ping_start'
collect2: error: ld returned 1 exit status
exit status 1
Error compiling for board Generic ESP8266 Module.

Facing issues when ping count > 250 in SimplePing.ino

Thanks for the nice library dancol90.

Upon checking I observed that the number of ping requests are not initiated based on the ping count that I configured.

********* CODE ***
#include <ESP8266WiFi.h>
#include <ESP8266Ping.h>
#include <Streaming.h>

const int ping_count = 1100;
const IPAddress remote_ip(8, 8, 8, 8);

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

// We start by connecting to a WiFi network

Serial.println();
Serial.println("Connecting to WiFi");

WiFi.begin(ssid, password);

while (WiFi.status() != WL_CONNECTED) {
delay(100);
Serial.print(".");
}

Serial.println();
Serial.print("WiFi connected with ip ");
Serial.println(WiFi.localIP());

Serial << "Ping count configured : " << ping_count << "," << " Pinging ip : " << remote_ip <<endl;

if(Ping.ping(remote_ip, ping_count)) {
Serial.println("Success!!");
} else {
Serial.println("Error :(");
}
}

void loop() { }


When configured the ping count = 300, the ping requests are initiated only up to 44 times. The expected behavior is 300 times. I've listed the log details below.


WiFi connected with ip 192.168.31.178
Ping count configured : 300, Pinging ip : 8.8.8.8
Reply from: total_count = 0 resp_time = 48ms seqno = 1 timeout_count = 0 bytes = 32 total_bytes = 0 total_time = 0 ping_err = 0
.....

Reply from: total_count = 0 resp_time = 48ms seqno = 44 timeout_count = 0 bytes = 32 total_bytes = 0 total_time = 0 ping_err = 0
Avg resp time 49 ms
Success!!


When configured for 400

WiFi connected with ip 192.168.31.178
Ping count configured : 400, Pinging ip : 8.8.8.8
Reply from: total_count = 0 resp_time = 49ms seqno = 1 timeout_count = 0 bytes = 32 total_bytes = 0 total_time = 0 ping_err = 0
......
Reply from: total_count = 0 resp_time = 58ms seqno = 144 timeout_count = 0 bytes = 32 total_bytes = 0 total_time = 0 ping_err = 0
Avg resp time 55 ms
Success!!


When configured for 1000.

Reply from: total_count = 0 resp_time = 55ms seqno = 231 timeout_count = 0 bytes = 32 total_bytes = 0 total_time = 0 ping_err = 0
Reply from: total_count = 0 resp_time = 50ms seqno = 232 timeout_count = 0 bytes = 32 total_bytes = 0 total_time = 0 ping_err = 0
Avg resp time 114 ms
Success!!


Note that I am facing this issue only when I set the ping count to be > 250. The above conditions were simulated thrice and observed the same result.

Average Time, Debug Infos ?

How can one enable the debug function
of this lib
ENABLE_DEBUG_PING
without having to make changes to the lib itself ?
How can one print aditional info like number of errors, average time etc. ?
Nothing about that in the Demos.

Thanks ! I'm a newby, so excuse my questions ;-)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.