I have a problem that is similar to furby_goulag.
I have an Arduino Mega connected to an ESP-01 module. I have the wifi connection and Blynk working fine. Non-technical people will be using my device in various locations, on various wifi networks. I have a touch screen interface on the Arduino that allows the user to enter the ssid and password for whatever network they intend to use. This system works fine assuming:
- The user enters the ssid correctly
- The user enters the password correctly
- The wifi signal is sufficiently strong
- There are no firewalls blocking the exchange with the Blynk server
The problem I have is that the Mega+ESP will freeze if there is a problem with any of the conditions above. I do not get a timeout. For example, when the wifi setup is correct, everything works fine, and my serial monitor looks like this:
Blynk.begin starting  ___ __ __ / _ )/ /_ _____ / /__ / _ / / // / _ \/ '_/ /____/_/\_, /_//_/_/\_\ /___/ v0.5.0 on Arduino Mega  Connecting to VR Guest  AT version:220.127.116.11(May 11 2016 18:09:56) SDK version:1.5.4(baaeaebb) Ai-Thinker Technology Co. Ltd. Jun 13 2016 11:29:20 OK  +CIFSR:STAIP,"192.168.31.29" +CIFSR:STAMAC,"5c:cf:7f:56:40:ef"  Connected to WiFi  Ready (ping: 11ms). Blynk.begin finished
BUT… if I enter the incorrect password, the Mega+ESP seems to freeze, and my serial monitor looks like this:
Blynk.begin starting  ___ __ __ / _ )/ /_ _____ / /__ / _ / / // / _ \/ '_/ /____/_/\_, /_//_/_/\_\ /___/ v0.5.0 on Arduino Mega  Connecting to VR Guest  AT version:18.104.22.168(May 11 2016 18:09:56) SDK version:1.5.4(baaeaebb) Ai-Thinker Technology Co. Ltd. Jun 13 2016 11:29:20 OK  Failed to connect WiFi
No matter how long I wait, I do not get a timeout, and in this state, the Arduino does not act on any interrupts; the timers in the Arduino code do not run. Everything just stops. What I need is for the Arduino to bail out of the Blynk.begin routine so that I can send a message to the user saying, “Wifi connection failed, check your wifi settings”.
I have read through a lot of threads on this board that deal with timeout issues. I have tried a lot of the suggested coding solutions. Nothing seems to do the trick.
About 10 months ago, furby_goulag seemed to be having the same problem. The discussion here seemed to indicate there is an inherent problem with timeouts when we use the Mega+ESP on wifi. Is that still the case? Is there any workaround?