I'm using the Arduino Wifi Nina Library to connect an Arduino Uno Wifi Rev2 to wifi and then using the Arduino HTTP Client library to make HTTP post calls to the internet.
To connect the Arduino to my home Wifi Network (WPA2 Personal), I use the WiFi.begin()
method. This method takes an excruciatingly long 4 seconds to connect to the Wifi. This seems to be a known issue. Since this methods is synchronous/blocking, my sketch is completely unresponsive during this time to any user input such as button-presses etc. I'm trying to create a proof-of-concept for a commercial-grade product. So having it go unresponsive to user-input for several seconds is unacceptable.
Is there any workaround to this? Is there a asynchronous library to achieve the same goal? Is there some other workaround? How do other people deal with this situation?
WiFi.setTimeout()
WiFi.status==WL_CONNECTED
which is taking four seconds. I just tested on my NodeMCU and WiFi.begin() typically completes in just 5 milliseconds.