ESP8266 Blynk with multiple SSID's

I have an arduino Sketch I’ve written to use the ESP826-01 and Blynk. The problem is when I take it somewhere an want to add an addition SSID or access point. I would like to be able to preprogram in multiple Access points/ SSID’s. I have 3 SSID’s I would like to use now. Just like my laptop automatically gets on all those networks I would like to give the code all the SSID’s and passwords and store them. Anyone know how to setup multiple SSID’s with the ESP8266-01 and the Blynk API?

Please search the forum. There is a topic about that

Have you checked out @tzapulica’s WiFi Manager?

1 Like

Tried a forum search and still can’t find anything on the subject. Do you have a topic name ? The wifi manager isn’t quiet what i’m looking for either. I have 4 pre known SSID’s I want to join. So when I’m at work i’m on the work SSID, home on my SSID, when i’m at a friends on there SSID , etc…

Is it ESP standalone or with an Arduino?

It’s a standalone ESP8266-01.

I only really have one access point here at the moment but the following looks like it works.

   Blynk.begin(auth, wifi, "ssid1", "pwd1");

   while (Blynk.connect() == false) {
      Blynk.begin(auth, wifi, "ssid2", "pwd2");
         while (Blynk.connect() == false) {
           Blynk.begin(auth, wifi, "ssid3", "pwd3");
             while (Blynk.connect() == false) {
               Blynk.begin(auth, wifi, "ssid4", "pwd4");
             } 
         }
   }

I actually tied that already. The sketch still just hangs on the first begin. the code never returns from Blynk.begin

This connected me to the second AP:

   unsigned long start_time = millis();
   unsigned long wait_time = 10000;
   unsigned long end_time = start_time + wait_time;

while (millis() < end_time) {
   Blynk.begin(auth, wifi, "ssid1", "pwd1");
}

   start_time = millis();
   end_time = start_time + wait_time;

while (millis() < end_time) {
   Blynk.begin(auth, wifi, "ssid2", "pwd2");
}

Should work for as many AP’s as you want to add but you may need to check the wait_time of 10 seconds on your system.

1 Like

Thats not working for me either. :confounded: Here is my code:
`
define BLYNK_PRINT Serial // Comment this out to disable prints and save space
define NEO_PIXEL_LED_PIN 2
define NUM_PIXELS 24

include <Adafruit_NeoPixel.h>
include <ESP8266WiFi.h>
include <BlynkSimpleEsp8266.h>

char auth[] = “03f…602”;

char ssid1[] = “WorkWifi”;
char password1[] = “password1”;
char ssid2[] = “HomeWifi”;
char password2[] = “password2”;

Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUM_PIXELS, NEO_PIXEL_LED_PIN, NEO_GRB + NEO_KHZ800);

void setup()
{
Serial.begin(115200);
pixels.begin(); // This initializes the NeoPixel library.
//Blynk.begin(auth, ssid2, password2);

unsigned long start_time = millis();
unsigned long wait_time = 5000;
unsigned long end_time = start_time + wait_time;

while (millis() < end_time) {
Blynk.begin(auth, ssid1, password1);
}

  start_time = millis();
  end_time = start_time + wait_time;

while (millis() < end_time) {
Blynk.begin(auth, ssid2, password2);
}
}

void loop()
{
Blynk.run();
centerpiece_logic(); //business logic
update_led_colors(); //update NEOPixels

}// end of void loop
`

1 Like

If it helps at all I’m running the ESP8266-01 standalone and I’m writing code for it on the Arduino. using 0.3.1 and neopixel 1.4 library.

Why not scan for ap’s at start up, and if you get a match, use it before any blynk attempt. Lots of code around for scanning, joining etc.

There s an example sketch in the esp8266 core called esp8266wifimulti, may be better for what you need
There s also a pull rewuest on wifimanager that gives it an array of pre known credential sets, you could try that as well

Also in the suggestions above, it would be better to use WiFi.begin instead of Blynk.begin and just do blynk.config after you are connected

I’ll try that. blink.config was exactly what i was looking for instead of blink.begin. That way I can do a traditional SSID scan using the ESP8266 libraries.

1 Like

I’m trying to implement multiple SSID to connect to some of those available in my project, none of the works equemas me, it is trying to connect to the first ssid.

Sincerely.