I’m working with ESP8266/32 and I am stuck with something,
I build myself a “smartconnect” función that attempts to connect to wifi credentials savef on the spiff
If it fails, it host a website to enter ssid,pass, auth token, and after saving the credentials the esp restarts.
It works just fine, also if the ESP is connected to they wifi network, It host anothe website to change some parameters…
but this is the issue, if I enter a wrong token, the esp connects to the wifi network, and get stucks forever at “invalid token”… pseudo code as example…
The same problems hapens if by any reasone internet goes down and the esp dot get the heartbeat from blynk server.
the idea of the app is to be able to acces the website hosted on the ESP even if the token is invalid, or if the internet goes down.
I try to raise a flag as “invalid token” fllag, to try Blyk.disconnect() but, the issue is with the Blink.Beguin, it get stuck forever.
Is there any workarround? this is a pseudo code
Blynk.begin(auth, ssid, pass);
Serial.println(“this will never be printed if internet is down or if token is not valid”);
validTokenFlag = Blynk.isTokenInvalid();
firstboot = false;