I'm trying to query other websites from my MKR1010 connected to the IOT cloud, when doing this, via a new WiFiClient (but existing wifi connection) it breaks the connection to IOT cloud.
I would like to be able to call the reconnect method, but apologies it's a long time since I've done any serious coding.
I'm starting the connection (working fine) with
ArduinoCloud.begin(ArduinoIoTPreferredConnection);
and can test the connection status ok with
if (ArduinoCloud.connected() == 0) {
but if there is no connection (true from the if above) I'd like to call
ArduinoCloud.reconnect(Client&)
Apologies for my noobiness but I'm looking for where the Client variable is defined so I can grab the name and call reconnect after making the call to the web elsewhere in code, something like:
if (ArduinoCloud.connected() == 0) {
Serial.println("Not connected to Arduino Cloud.");
ArduinoCloud.reconnect(**VARHERE**);
} else {
//we are connected
ArduinoCloud.update();
}
Or - should I not use connection manager?
Thanks for pointers