The Blynk Legacy cloud servers were de-commissioned at the end of 2022.
The only way to use Blynk Legacy is to either run your own Legacy server, or to connect to someone else’s unofficial Legacy server.
The YouTube video you’ve linked to is about Blynk IoT (otherwise know as Blynk 2.0 or “New Blynk”), not Blynk Legacy.
I assume therefore that you are using Blynk IoT, not the discontinued Blynk Legacy.
The Edgent sketch used in the YouTube video does indeed restart the ESP device if it is unable to connect to the stored WiFi after a certain amount of time.
Unfortunately, the program files for the YouTube project haven’t been updated for two years, so are using extremely outdated versions of the Edgent example sketch. They also make the mistake of not un-commenting one of the board types in the .ino file, so using the custom board configuration, which isn’t appropriate for any ESP8266 board that I’m aware of.
I’d suggest that you ensure you have the latest Blynk library (version 1.2.0) installed, and create a new project from the File > Examples > Blynk > Edgent menu, then update this with the custom pieces of code from the YouTube example. You’ll need to un-comment the most appropriate board type and add your two line of firmware configuration from the Template you created.
You can then solve your relay issue by adding this line to your void setup, immediately after the pinMode statement…
Virtualwrite(2, LOW);
You may also want to read the documentation about the use of BLYNK_CONNECTED()
and Blynk.syncVirtual(vPin)
to synchronise your relay with the widget in your dashboard.
Pete.