I want to reset my mobile wifi router if it hangs(it often happens for me).
For this I want to get a trigger from the cloud once in few minutes to my device and if I miss it I will reset the wifi router and try to connect again.
So, can i get a timer event from cloud with out user intervention.
So you would like to use this event to check the connection and if you didn’t receive the message you will reset the router manually right ?
Are you using blynk IOT or legacy ?
I think I’d just do a Blynk.connected() test.
Be aware though that if your router takes a couple of minutes to get connected then there is a danger that you’ll constantly keep rebooting it, so you need to wait a while before you do this check.
Of course, depending on your device either seeing a ‘ping’ from the Blynk server or being connected will mean that your router keeps rebooting if the Blynk server is down.
My personal approach is to use a device to regularly ping a series of URLs including Google, Amazon and Microsoft. If all the URLs fail to respond multiple times then I reboot the router.
Thanks Pete. I shall try these
It is possible to create a keep-alive socket in C# in order I see my device Online in the Blynk.Console?. I am sending data just with the API instructions (no Arduino, etc.) and it works, but in the console the device is always Offline. Is there any example of how to do this keep alive in C# using the Blynk Auth. Token, etc?
Not aware of any C# libraries.
Any reason why you can’t use C++ ?
No reason. I have made the App in C# but if C++ is suitable to do the keep-alive socket, I will try of course.
Do you have any example?.
Every example in the sketch builder and in the examples included with the 1.0.1 version of the C++ library use a keep-alive connection.
It is initiated using Blynk.begin (which is a blocking function) or bu establishing an internet connection then using Blynk.config and Blynk.connect (which are non-blocking).
This is something we gonna improve at some point. We’ll add the ability to hide status in the template settings as it’s not always required.
Regarding own keep-alive connection - yes, it’s possible in theory, but we don’t have docs at the moment.
I will try the connection with a very basic program in C#, what should be the url and port name to use in the TcpClient?.
It would be great if we could hide the status in the template (web and App) because as you said, if we send the info with the HTTP API instructions it is no necessary that information and could cause confusion.