Let's say that there are multiple found access points (AP) with the same name (SSID). How can I choose to which one to connect?
Asked
Active
Viewed 519 times
1 Answers
0
Behind a SSID there is a BSSID/MAC of the AP.
First find the BSSID/MAC of the AP from the duplicate SSIDs.
For example if you are using a route visit its configuration page:
There are many ways that it can be found.
Then just set it:
//C4 : 48 : FA : 41 : 26 : 99
//196 72 250 65 38 153
const uint8_t bssid[6] = {196, 72, 250, 65, 38, 153};
String ssid = "Java4Ever";
String password = "XXX";
WiFi.begin(ssid.c_str(), password.c_str(), 0, bssid, true);
Note that in my case it is not necessary to set the BSSID, because the ESP32 can receive only in 2.4Ghz thus the other AP is not visible to it.

Georgi Peev
- 912
- 1
- 14
- 25