[SOLVED] How to re-connect Wifi with a non-blocking fashion?
Posted: Sat Oct 21, 2017 4:00 pm
I am doing a project of a vending machine system on which the main task is obviously to count the coins, but whenever the wireless connection is lost, the system keep blocked in a closed loop. I'm using the standard template present at the Webserver sketch:
I've thinking of using I/O interrupt in order to provide a quick call to the counting routine, or even exit the loop and return again, skipping a new attempt to reconnect if it is done. I mean: To instantiate the WiFi.status() just once, but seems like wont work.
Does anyone have faced to a similar issue, or have some insight on how to solve that ?
Code: Select all
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print (".");
}
I've thinking of using I/O interrupt in order to provide a quick call to the counting routine, or even exit the loop and return again, skipping a new attempt to reconnect if it is done. I mean: To instantiate the WiFi.status() just once, but seems like wont work.
Does anyone have faced to a similar issue, or have some insight on how to solve that ?