I have some code in my project that shouldn't execute until we are completely connected to the IoT Cloud. How can I do this?
I want to do something like:
//the usual cloud startup stuff: initProperties(); ArduinoCloud.begin(ArduinoIoTPreferredConnection); setDebugMessageLevel(2); ArduinoCloud.printDebugInfo(); //My added code: //1) while not connected to cloud, wait. //2) finally finish setup functions and start loop
What I find is that it might seem like things have started up but execution during the loop gets interrupted about the same time that I get a Serial message about "Connected to: [my wifi network]" This leads me to believe I need to wait for connections to be established that may be running on another thread somewhere.