Comments (10)
Hi, that's strange!
Try adding a #define ENABLE_DEBUG_PING
a the top of the sketch and paste here what gets printed on the serial monitor.
from esp8266ping.
Thank you for answer but I don't know how to print debug. Im sorry for stupid question, but may I write something more into my code? Something like Serial.println(debug);?
Right now it prints nothing in serial monitor.
from esp8266ping.
Just add #define ENABLE_DEBUG_PING
before the line #include <ESP8266Ping.h>
at the top of your sketch, upload it as usual and then look at the Serial Monitor, just like you did for the screenshot in your message.
from esp8266ping.
Oh, I put it after all #define lines. My bad. This is what wemos spits on me right now.
Cable disconected, Internet don't work:
Pinging host
DEBUG: ping reply
total_count = 0
resp_time = 1
seqno = 31
timeout_count = 0
bytes = 32
total_bytes = 0
total_time = 0
ping_err = 0
DEBUG: ping reply
total_count = 0
resp_time = 1
seqno = 32
timeout_count = 0
bytes = 32
total_bytes = 0
total_time = 0
ping_err = 0
DEBUG: ping reply
total_count = 0
resp_time = 1
seqno = 33
timeout_count = 0
bytes = 32
total_bytes = 0
total_time = 0
ping_err = 0
DEBUG: ping reply
total_count = 0
resp_time = 1
seqno = 34
timeout_count = 0
bytes = 32
total_bytes = 0
total_time = 0
ping_err = 0
DEBUG: ping reply
total_count = 0
resp_time = 1
seqno = 35
timeout_count = 0
bytes = 32
total_bytes = 0
total_time = 0
ping_err = 0
Avg resp time 1 ms
bool ret = 1
Success ping to www.google.com - 1ms
Cable connected, internet work:
Pinging host
DEBUG: ping reply
total_count = 0
resp_time = 17
seqno = 36
timeout_count = 0
bytes = 32
total_bytes = 0
total_time = 0
ping_err = 0
DEBUG: ping reply
total_count = 0
resp_time = 17
seqno = 37
timeout_count = 0
bytes = 32
total_bytes = 0
total_time = 0
ping_err = 0
DEBUG: ping reply
total_count = 0
resp_time = 20
seqno = 38
timeout_count = 0
bytes = 32
total_bytes = 0
total_time = 0
ping_err = 0
DEBUG: ping reply
total_count = 0
resp_time = 17
seqno = 39
timeout_count = 0
bytes = 32
total_bytes = 0
total_time = 0
ping_err = 0
DEBUG: ping reply
total_count = 0
resp_time = 17
seqno = 40
timeout_count = 0
bytes = 32
total_bytes = 0
total_time = 0
ping_err = 0
Avg resp time 17 ms
bool ret = 1
Success ping to www.google.com - 17ms
from esp8266ping.
That's strange, are you using the last esp8266 package? Maybe something changed in the official SDK (that this library uses).
from esp8266ping.
Im using IDE 1.8.1. built in library ESP8266Wifi ver. 1.0.0.
Im thinking about check if wemos can get time from NTP server instead of ping if we can't get this work.
from esp8266ping.
I can not reproduce the problem with the current trunk code.
- generic clone wemos D1 mini board (not pro)
- IDE 1.8.2
- Netgear 7000
- CenturyLink (C1000A) in bridge mode
- Using 2.4G on the guest network
- ESP8266Wifi contrib 1.0.0
I know that (at least in the previous firmware version) the netgear router would return its own IP address when DNS lookups failed, presumably as a magic autoconf feature. This resulted in successful pings even with the modem unplugged. Could this be the issue?
I have in fact just made my own "WIFI ResetPlug" type device, because the OTS reset plug device was fooled by this behavior and never reset my link. :) You have to do both IP and DNS-based pings to test connectivity: sometimes DNS lookups fail, sometimes the router can trick you into pinging the wrong IP. I'll be posting the code here shortly.
In any case, can not reproduce.
from esp8266ping.
Im not sure why this happen, but I rather use NTP instead of ping now. Anyway Im using NTP for syncing my arduino clock connected via my NRF net.
@tekhedd My Tenda F300 shows his own setup page in browser if internet dont work. Perhaps it is main cause of my problem.
from esp8266ping.
Yeah, it most surely is the cause of the problem. Try pinging a remote IP instead of a host name!
from esp8266ping.
FYI: https://github.com/tekhedd/ResetFlake It's pretty minimal but works, has friendly console output, and pings by both DNS and IP. Might be useful for a quick test to see if this is the issue, well, for other people who find this issue by searching. Uses ESP8266Ping, of course. :)
(I'm running this code for real at my house now, so everybody now knows they can DOS my internet uplink simply by turning off centurylink's primary DNS resolvers for the western US.)
from esp8266ping.
Related Issues (20)
- Average Time, Debug Infos ? HOT 2
- [Feature Request] Timeout for ping
- Add to the Arduino Library Manager HOT 1
- Average ping time giving strange results
- Please make ping async HOT 8
- There may be problems with USING the IPAddress library for ESP8266 HOT 1
- 'INT_MAX' was not declared in this scope HOT 1
- Pinging made up domain names also working? HOT 1
- Cannot be used across multiple TUs
- ESP8266 board manager cersion 3.0.0 breaks ESP8266Ping
- If count > 1 does ping return HOT 1
- ping library for ESP32? HOT 3
- Curious problem
- Ping Library fails in main branch, works in 3.0.2 and 2.7.4 #8555
- Can't ping self.
- Pinging ip, but return false HOT 1
- Ping Fail ESP8266 + Platformio Core 6.1.11 / Home 3.4.4 HOT 1
- Disabling send ping data on the serial port HOT 7
- missing wifi.json
- Thank you for this library! If we have the range of all IPs in the network and try to sequentially ping all of them, it will take a long time. Would it be possible to thread the process to speed it up?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esp8266ping.