-->
Page 1 of 2

Ping?

PostPosted: Thu Sep 15, 2016 6:00 am
by bugs
When my programs start they connect to the network and retry if there is a problem.
What I would like, is access to the Ping command so that I can set the timer to ping the router or access point every 10 seconds so that I can recover from a network component having a short failure e.g.

Code: Select allip$ = "192.168.0.1"
timer 10000, [time4ping]
tries = 0

[connloop]
 tries = tries+1
 if tries > 5 then reboot
 ok = wifi.connect(.........)
 if not ok then goto [connloop]

[mainloop]
do
 if not pingok then goto [connloop]

'the main program

loop until 0

[time4ping]
 pingok = ping(ip$)
return



I have not used the AT+ping command but think it might return a ping time in ms - not sure how difficult it would be to add Ping to BASIC?

Re: Ping?

PostPosted: Thu Sep 15, 2016 6:08 am
by Mmiscool
If there is a ping example in arduino land it can ve added prety easly.

Re: Ping?

PostPosted: Thu Sep 15, 2016 6:41 am
by Oldbod
Came across this a while back, may be helpfulhttp://www.esp8266.com/viewtopic ... 26&start=4

Re: Ping?

PostPosted: Thu Sep 15, 2016 6:47 am
by bugs
Wow - that was quick response!

I don't know if this is what you need but it looks hopeful to me...

https://github.com/dancol90/ESP8266Ping