Calling WiFi.setCredentials blocks user code for a little over 1600ms.
This would normally not be a problem but our product has a STM6321RWY6F watchdog. We chose this particular one as it has one of the longest timeouts available of 1.6 seconds. At a minimum we pet it every 500ms
We can disable the watchdog when setting the WiFi Credentials but that sort of defeats the purpose. Granted this is a short period of time and setting credentials is a rare occurrence in the products lifetime but setting credentials shouldn’t take that long. I’m also thinking that if it takes 1.6 seconds, how much is it doing and what are the chances it hangs in this process?
I’m using a P1, Firmware 1.4.4. I am running SYSTEM_THREAD(ENABLED).
Not a show stopper, just looking for some education or a way to shorten this time
If you are not providing fully qualified credentials (including WLAN cipher) then the device has to request the missing data from the network and that can take some time.
How does the timing look when you use the four-parameter overload of WiFi.setCredentials()?
Thank you for letting me know what it’s actually doing, I can see that taking time. I suppose if the SSID you are configuring isn’t active at the time, that there is some sort of timeout which is even longer than the 1.6 seconds. I will try the four-parameter method tonight and see what the numbers are.