ESP32 doesn't get out from Blynk.begin() function

Dear sir,

Whenever I try to connect with blynk cloud without or wrong AUTH TOKEN, it get stucked/hanged inside the Blynk.begin() function. In that situation, what will do to get out of Blynk.begin() function.

And also need to know the possibilities of esp32 not connect to cloud means it will reattempt the connection process only 3 to 5 times only.

The simple solution is to stop leaving the Auth token blank, and stop using the wrong auth token.
As the auth token is provided for you in the firmware configuration section of the device info screen it should be a simple task for you to copy these three lines of code directly into your sketch, preferably at the beginning so that they can be easily updated.

Blynk.begin is a blocking function, so if it is unable to connect to WiFi and the Blynk server - either because they are unavailable or because you’ve provided the wrong credentials - then all code execution will stop at that point.

If you used Blynk.config() and Blynk.connect() instead then you could avoid this blocking behaviour, provided you did a Blynk.connected() logical test before executing Blynk.run(), but there doesn’t seem much point in do8ng this as you won’t have Blynk connectivity.

Another solution was discussed here, but that also seems to be unnecessary if you take simple precautions to stop using blank or invalid Auth tokens…

I don’t really understand the question here. If you’re saying that you’re suffering from multiple disconnection/reconnection issues then the first culprit is usually bad coding, but could be multiple other issues including power supply issues or WiFi or internet connectivity issues.

Pete.

1 Like