So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By rooooki
#74982 Hello everyone,

I am trying to use wifiMulti function to store multiple wifi credentials and connect to them. The question is there are a few wifi extender in my place. Therefore the ESP8266 will treat my router and 2 extenders as three different wifi signals even they have the same SSID and password. If I use wifiMulti.addAP() to add those SSID, it seems I add three sets of same SSID and password which does not make too much sense to me. Is there a way to resolve this issue? I am using esp-12 and the code is the example code for wifiMulti.
*************************************************************
#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>

ESP8266WiFiMulti wifiMulti;

void setup() {
Serial.begin(115200);
delay(10);

WiFi.mode(WIFI_STA);
wifiMulti.addAP("ssid_from_AP_1", "your_password_for_AP_1");
wifiMulti.addAP("ssid_from_AP_2", "your_password_for_AP_2");
wifiMulti.addAP("ssid_from_AP_3", "your_password_for_AP_3");

Serial.println("Connecting Wifi...");
if (wifiMulti.run() == WL_CONNECTED) {
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
}
}

void loop() {
if (wifiMulti.run() != WL_CONNECTED) {
Serial.println("WiFi not connected!");
delay(1000);
}
}
User avatar
By rudy
#74993 I think you will need to connect to a router/extender using the BSSID of that device. Have a look in https://github.com/esp8266/Arduino/blob ... -class.rst

You may have to manage the different devices yourself. Do a scan and find the different devices, their signal strength, the BSSID. Decide which you want to connect to based on the results.

https://github.com/esp8266/Arduino/blob ... A.cpp#L100
User avatar
By rooooki
#75085
rudy wrote:I think you will need to connect to a router/extender using the BSSID of that device. Have a look in https://github.com/esp8266/Arduino/blob ... -class.rst

You may have to manage the different devices yourself. Do a scan and find the different devices, their signal strength, the BSSID. Decide which you want to connect to based on the results.

https://github.com/esp8266/Arduino/blob ... A.cpp#L100


Thanks. The BSSID is very useful when deal with different wifi signal with same SSID. The only annoy thing is I had to write a function to compare the signal strength as wifiMulti function doesn't have the ability to handle BSSID. :)