ESP32 hangs when booting without wifi

Hello everyone. At the moment I want to build a new project on ESP32. This project requires high stability regardless of the availability of the Internet or wifi.
This code works fine if the wifi router online:

№1. Blynk.connectWiFi(ssid, pass);
№2. Blynk.config(auth, server ,port);
№3. Blynk.connect(timeout);
However, if the router is offline the ESP32 hangs on the line №1.
If I use instead of the first line: WiFi.begin(ssid, pass);, the code always hangs on the line №3 regardless of the connection status and timeout.

I also find a topic on the forum, but no one found a solution there and it has already died.


ESP32 via wifi
Arduino Blynk Library version [v0.6.1]

The answer is in the link you provided. Although the OP never returned to share if it worked or not. I suspect it did since he never reported it didn’t (if that makes sense).

  WiFi.begin(ssid, pass);  // Non-blocking if no WiFi available
  Blynk.config(auth);
  Blynk.connect();

and additional connection management as needed, with an example provided here:

I do believe that Blynk.connect(); is blocking though, as it is trying to establish a connection to the server. Default timeout is 30 seconds (according to the docs).

This is discussed a little in this topic:

Thanks, but this code does not work under certain circumstances. Read more carefully my post I described everything in detail.

I’m getting the same issue on my esp32
When WiFi comeback, esp32 hangs until i press reset button.
Same sketch on Nodemcu works fine.