Hi all,
I have searched around and tried for a few days to include multiple SSID’s in my Blynk code. The idea is that if the device is at my uni house or home it will still connect.
This is an example of one of the methods I have tried. The project uses an esp8266 which is used as a wifi shield with an arduino mega.
The code gets stuck after the first Blynk.begin and the serial monitor says “failed to connect to wifi”
Thanks for any help.
void setup()
{
ucg.begin(UCG_FONT_MODE_SOLID);
ucg.clearScreen();
//ucg.setFont(ucg_font_inr38_mr);
ucg.setFont(ucg_font_inr16_mr);
ucg.setRotate270();
Serial.begin(115200);
EspSerial.begin(115200);
delay(5000);
connection();
flash=0;
buttonvalue = digitalRead(button);
timer.setInterval(1000L, myTimerEvent);
}
BLYNK_CONNECTED() {
Serial.println("connected");
ReCnctCount = 0;
}
void connection()
{
Blynk.begin(auth, wifi, "SSID", "pswd");
while (Blynk.connect() == false) {
Blynk.begin(auth, wifi, "SSID2", "pswd2");
}
}