I'm working in a project with a ESP8266 with Arduino Cloud that's control some RGB Leds. I made a physical panel for the control without Internet. But my problem is that if the Wifi goes wrong, I want to switch into a "offline mode" to only use the physical panel.
If I'm not wrong the "ArduinoCloud.begin()" function begin the conection with the servers of Arduino, so there's any parameter or function itself that's turns the conection off? There's a way to "wake up" the conection then?
I don't know of any manual method to disconnect from the Cloud, but you could detect when the Cloud is disconnected and make the switch to the manual control automatically.
You could use the ArduinoCloud.connected() function to detect whether or not the Cloud connection is good and adjust your sketch behaviour accordingly.
I don't know the specifics of your design or requirements, but I think I would be looking to make manual and Cloud controls both active when the Cloud is connected. Then if the Cloud disconnects, manual controls would be available by default.
I believe that the statement
ArduinoIoTPreferredConnection.disconnect();
will disconnect from the IOT cloud and from the wifi.
To reconnect again you use again the statement
ArduinoCloud.begin(ArduinoIoTPreferredConnection);
I never tested this but just give it a try.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.