Hi there, I need some help. I´m using an ESP32 and in my code I connect to the Wi-Fi with the classic “while” statement:
while (wifiMulti.run() != WL_CONNECTED) {
delay(250);
}
In my case even that the Wi-Fi connection is necessary it is not essential and the code needs to go ahead with the rest of lines, unfortunately it stops while it’s not able to find a such connection available. I’ll really appreciate if someone helps me how to modify my code for:
- to try to connect to Wi-Fi
- and if is not possible going ahead with the rest of the code.
Thanks in advance
Deva_Rishi from Arduino forum helped me already. It was very simple. If someone is interested this is the code correction:
uint32_t starttime=millis();
while ((wifiMulti.run() != WL_CONNECTED) && (millis()-starttime>TIME_OUT)) {
delay(250);
}