Ping?
Posted: Thu Sep 15, 2016 6:00 am
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.
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?
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 all
ip$ = "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?