Wondering if the WiFi.connect() blocks the loop? I want to use my device when there is not wifi but automatically connect when I get into range of wifi.
Thanks
Wondering if the WiFi.connect() blocks the loop? I want to use my device when there is not wifi but automatically connect when I get into range of wifi.
Thanks
I currently use spark.connect but this is blocking I was wondering if I call wifi.connect would block the loop too if not I would call wifi connect wait for the connection them connect to the cloud
This would also answer some of your question
http://docs.spark.io/firmware/#wifi-connect
and from @BulldogLowell 's suggestion to this
http://docs.spark.io/firmware/#system-modes-semi-automatic-mode
Especially this part might be of interest for you
How much “blocking” are you prepared to accept?
Neither way will come without delay/blocking of your active code.
I also found that WiFi.connect() blocked, preventing loop() processing. In my case I had a button which when long pressed would turn power off and I discovered that when I lost the WiFi connection and attempted to connect, I could not turn off the power!
In my case I moved much of my non-network related tasks into a timer callback since timers continue to run fine when the loop is blocked in WiFi.connect(). I would suggest augmenting the documentation to indicate it’s a blocking call.