Hi everyone, I need some help for my coding. Is it possible to program this and how to do it?
When ESP32 power is ON, I want to check the wifi connection, if the connection is successful, then wifi be used to send data to Blynk. But, if the wifi connection is unsuccessful, will switch to using GSM to send data to BLYNK.
And during the power on, it can also switch the connection itself(so put it in loop and always check connection?).
void loop()
{
Blynk.run();
timer.run();
if (WiFi.status() == WL_CONNECTED)
{
Blynk.begin(auth, ssid, pass2);
}
else {
Blynk.begin(auth, client, apn, user, pass);
}
}
```