Sming - Open Source framework for high efficiency native ESP8266 development

User avatar
By danbicks
#16030 How can I use this method? StationClass::checkConnection()

I want to setup a timer and check connection to wireless router to see if connection has dropped. I believe it raises to callbacks: ConnectionCallback call = onConnectOk; and ConnectionCallback call = onConnectFail;

This is to help with tracking the MQTT failure, I think it is a router thing.

Can you give me a simple example of how I add this to the MQTT program, I am cool with timers, so will config the timer to check lets say every ten seconds and call the checkConnection() function.

Big thanks

Dans
User avatar
By anakod
#16119
How can I use this method? StationClass::checkConnection()

At first you can set timer and check connection status on every timer call.

Also I want to make some tests about network connection lost and router disconnection, after that I will provide some ideas or, may be automatic server restarting solution (if needed).