Closed
Description
Hello,
The timeout in use when calling Wifi.begin
is hardcoded and set to 10000 ms (see code below).
That makes it difficult to handle reconnection is some cases, because loop execution will be locked for 10s if no WiFi is available.
// ArduinoCore-renesas/libraries/WiFiS3/src/WiFi.cpp
/* -------------------------------------------------------------------------- */
int CWifi::begin(const char* ssid, const char *passphrase) {
/* -------------------------------------------------------------------------- */
...
unsigned long start_time = millis();
while(millis() - start_time < 10000){
if(status() == WL_CONNECTED) {
return WL_CONNECTED;
}
}
return WL_CONNECT_FAILED;
}
User should be able to set his own timeout value.
So Is there any way to perform a non-blocking reconnection ? If not, is it possible to update the interface to something like this?:
int CWifi::begin(const char* ssid, const char *passphrase, unsigned int timeout = 10000)