Working on a small project using an ESP8266 that is trying to connect to a local SSID and failing. I have 3 separate APs all using the same SSID so I can roam around and always get a solid connection. I'll use WIFILOCAL as the SSID in this example.
Using the ESP8266WiFi.h header library I enter the SSID and password and try to connect. I get an error code 7 returned to the sketch. I believe this is because the ESP8266 is seeing multiple APs advertising the SSID WIFILOCAL. So, I want to force connection to a specific AP that is closest to where the ESP8266 will be located.
According to the ESP doco the WiFi.begin method supports attaching to a specific AP using it's MAC address. The listed format is:
WiFi.begin(ssid, password, channel, bssid, connect)
Where the meaning of parameters is as follows:
ssid- a character string containing the SSID of Access Point we would like to connect to, may have up to 32 characterspasswordto the access point, a character string that should be minimum 8 characters long and not longer than 64 characterschannelof AP, if we like to operate using specific channel, otherwise this parameter may be omittedbssid- mac address of AP, this parameter is also optionalconnect- abooleanparameter that if set tofalse, will instruct module just to save the other parameters without actually establishing connection to the access point
I've added the following code line to my set up...
const byte bssid[] = {0xE8, 0x9C, 0x25, 0x71, 0x85, 0x70};
which is the MAC address for the AP, and then I use the following command to initiate the wifi connection...
WiFi.begin(ssid, password, 0, bssid);
But I get error code 7 returned.
So I am obviously not implementing the call properly.
The ESP8266 doco says that bssid is defined as "const uint8_t * bssid = 0".
HELP!