Chat here about code rewrites, mods, etc... with respect to the github project https://github.com/esp8266/Arduino

Moderator: igrr

User avatar
By danbicks
#20630 Guys,

Is it possible to create a routine that pings a server and returns a response if server is UP?

This would be brilliant before trying to upload data to a given site. For example WIFI router and IP for esp may be up but no internet access.

Any examples for use with the Arduino IDE?

Cheers Dans
User avatar
By FlyingHacker
#20633 Couldn't you just try to connect to your intended target server and try again (with a backoff perhaps) if it failed?

Not sure it is useful to know if you can access site X, when all you really care about is can you post data to site Y.

Make sense? Or perhaps I am missing something?
User avatar
By danbicks
#20634 Hi Thanks for input.

No the problem I have is that when network is reconnecting and ip establishing but no internet access as yet trying to then connect to MQTT server causes WDT reset. This happens if if network is UP and IP assigned.

I have now nailed down a reliable network routine that if router unplugged and re connected does not cause WDT crash anymore. Just need to ensure there is internet connection before I try to connect to MQTT services and re subscribe.

I hope this makes sense.

Dans
User avatar
By FlyingHacker
#20640 Makes sense. The crashing reset bug sounds like something that should be reported as that should never happen. (May related to a bug I have been running into that the developer is working on. Mine had to do with top error handling)

As far as you idea goes could you maybe try a DNS lookup to see if the network is up?