BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Connect to Mult-Wifi (Hidden SSID) using Blynk on esp8266

Hey ,

I wanted to connect my esp8266 (Nodemcu using Arduino IDE) to Multiple available Access points using Blynk . Searched for it and came across this. It has exactly what i need that is connecting to multi-wifi using blynk ,but the problem is the I’ve kept 2 of SSID’s as hidden and 1 as visible. The tutorial mentioned can connect to non-hidden SSID’s easliy but doesn’t work with hidden SSID’s.I’ve tried giving overload function WiFi.scanNetworks(async, show_hidden) like the one mentioned in this doc https://arduino-esp8266.readthedocs.io/en/latest/esp8266wifi/scan-class.html but still it doesn’t connect .it always loops in a wifi search . tried commenting on that tutorial but never got any solutions for it.All i want is that the esp8266 gets connected to the SSID which has the best signal,incase if anyone of them fails.also a bit confused on using Wifi.begin() for using Multi-wifi library when i’m using Blynk.begin(). :confused:
It’ll be very helpful if somebody can show me how it can be achieved.
Also this is my first Post here,kindly bear with me. :smile:

It’s good that you’ve done some research before posting. You can sharpen the most powerful tool in learning (searching, researching) by using the correct search topics. For example in this forum you can see MultiWiFi MultiBlynk topics:

and many many more discussing similar things.

RE: Hidden WiFi SSID, there are many limitations as you can’t scan and show hidden SSID (that’s the main purpose). You have to know exactly the hidden SSID/PW to input.

Hey,

Sorry for the late reply . Thank you for the insight. :raised_hands: I went through the two above mentioned links and found out that both do not meet the requirements. The second one only works for ESP32 !!
Btw,I exactly know my SSID/PW (hidden) :stuck_out_tongue:

My only requirement is that it should connect to any one of the hidden SSID’s that i’ve pre-configured in sketch,not passing it through some GUI ,as it is for remote home automation .
Could anyone please Help me find the solution to this :confused:

What makes you think that?

If you want to connect to the hidden SSID with the best signal strength then you’ll need to connect to them in turn and check the RSSI readings. If the one you are currently connected to is better than the first one you tried then continue with that, otherwise disconnect and re-connect to the first one.

Personally, I’d give both hidden networks the same SSID and password and just connect to it. The ESP will take care of connecting to the strongest access point.

Pete.

What makes you think that?

Because I saw this as the first line in examples.

#ifndef ESP32
#error This code is intended to run on the ESP32 platform! Please check your Tools->Board setting.
#endif

Personally, I’d give both hidden networks the same SSID and password and just connect to it

I’ve tried that too, but unfortunately I’m ending up in a network loop (maybe my router doesn’t allow multiple access points with the same name, I know ideally it shouldn’t happen but that’s what I’ve observed). That’s why i had to give different names to my access points but now i don’t have redundancy if any access point breaks down. Forget connecting to the best signal strength ,i just want it to connect it to any available SSID that I’ve preconfigured in the sketch.

Yes, in the ESP32 examples. But if you look at the ESP8266 examples you’ll see:

#ifndef ESP8266
#error This code is intended to run on the ESP8266 platform! Please check your Tools->Board setting.
#endif

Is your second access point set-up as a DCHP server?

There’s quite a few topics on hard-coding multiple SSIDs, maybe this is the simplest to run with…

Pete.

Yes, in the ESP32 examples. But if you look at the ESP8266 examples you’ll see:

Sorry very neglectful of me :sweat_smile:

Is your second access point set-up as a DCHP server?

Initially upon first encountering the issue , I found out that indeed it was ,but upon removing the DHCP function from the one of the access points still I’m face Network Loop issue If i have the same SSID/pw for all my access points.Went on a google spree trying to find a solution for it but couldn’t find a thing for my particular setup, so ended up giving different credentials to the access points and now have no redundancy :grimacing:

There’s quite a few topics on hard-coding multiple SSIDs, maybe this is the simplest to run with…

I’ll try this with my test setup and see if it works (particularly with hidden SSID) :sweat_smile:

I guess it depends on the type of WAP. I have 4 wired WAPs in addition to my router, all using the same SSID and password, to provide total coverage for the house and garden.
Wireless repeater WAPs tend to be more difficult to configure to work on a single SSID, although some of the Netgear Nighthawk routers do allow ‘single SSID’ usage, but I’m not sure if this applies to hidden SSIDs.

Pete.

Ok , I tried this on my test sketch and I’m happy to report that this indeed works, with hidden SSID’s too !! :raised_hands:

My only gripe is this :sweat_smile:

while (!Blynk.connected() && ssid_count<ssid_mas_size);
if (!Blynk.connected() && ssid_count==ssid_mas_size) {
Serial.println("I could not connect to blynk =( Ignore and move on. but still I will try to connect to wi-fi " + String(ssid[ssid_count-1]));
}

with this,even if it doesn’t connect to Blynk Servers it stays connected to that Access point (“Ignore and move on. but still I will try to connect to wi-fi”) . Somewhat defeating the whole purpose of redundancy (Connect to the access point that has internet connectivity or else try the next one ).Any ideas for this ?

You could use Blynk.connected to see if you are connected to Blynk:

If not, then do a wifi disconnect and re-connect to the other SSID.

Or, you could ping a website (the Blynk server or google.com maybe) to see if you are connected to the internet and if not then switch to your alternate WiFi connection.

As I said, the code I linked to was a starting point for you to run with.

Pete.

Can Someone please help me with this? :sweat_smile: