ESP 01 + Arduino Checking connection

First I,m sorry for my bad English, I’m still learning this.
My hardware is: Arduino Nano and ESP01 with AT firmware. I use hardware serial.
I control a Remote Control Lawnmower. My problem is, if the connection between the lawnmower and the phone or the server is lost, do not stop the lawnmower. It stays in the previous state and sometimes get away, and I’m running to turn it off :smiley:
I tried this:
if ( !Blynk.connected() ) {“motors off”};
it worked but there was too much time to stop. (10s+).

What solution can this be for?

I suspect that the 10+ second delay is because that is about how long it takes for BLYNK to recognize that it has lost connection to the device.


I believe this can be changed, but I am not certain if this can be done when using the BLYNK server, and may only be if using a local server.

I don’t have any issues with the default setting, and I am using the BLYNK server, so I don’t have much to offer in terms of help. Maybe someone with more experience in dealing with the Heartbeat timing will chime in.

+1 for a video of your lawnmower in action with Blynk!!! :wink:

1 Like

@Fredy12335 +10 for video of you chasing it to shut it off :rofl:

1 Like

It’s still a prototype, but it’s already working. I’ll upload a video this weekend, but later I’ll be able to publish the whole process.

1 Like

As for your issue… there have been a few topics about things like Fail Safe routines and connection checks… basically a necessity for anything that has potential to run amok once off it’s leash.

The key is to write your code so that the default state is do nothing, stop motors, or otherwise safe action… then ONLY proceed if certain conditions are correct i.e. confirmed connection, confirmed reception of control commands, even a built in timer saying “if nothing has said otherwise in the last 5-10 seconds, then shut down!”… and so on.

Look at the various ways Blynk offers for connection management here…

And here is one way of keeping your code running (and thus able to apply the fail safe logic) even after disconnection from Blynk…