Making WiFI optional

First you seem to be missing the last but one post in the thread you linked, which seemed to cure the issue for the last poster in the thread.

So go for SYSTEM_THREAD(ENABLED).
Next, you can avoid most hit and miss connections by emplying WiFi.scan() in conjunction with the stored WiFi networks available via WiFi.getCredentials().

Armed with these two functions (and their relatives found in the docs, especially WiFi.on()) you should be able to pull off what you intend to do.

3 Likes