-
Notifications
You must be signed in to change notification settings - Fork 13.3k
WiFi.begin half-ignoring BSSID parameter #3028
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi ... as you also seem to try to speed up connectivity just one thing I have encountered with two different ESP8266-01 (one the old, one the new -S Version). My sketch looks like that and thereby gives me two options to connect (all parameters like MAC-Addresses, SSID, Password are just dummy ones in this code) ` const char* ssid="mySSID";
What it also does is to read an Si7021 sensor, and submit the values to thingspeak. If I remove WiFi.begin(ssid, pwd) and replace it by the 'to be faster' version providing channel and ap_mac, the average total runtime raises to > 1.500ms. I tried a lot of combinations and finally came to the conclusion, that it is the fastest way to not provide channel and ap_mac. In my router, I have reserved the IP of the ESP8266-01 for it, to avoid this IP address is blocked or assigned to another device. This does not really help you with the encountered "bug", but maybe the version is still faster than yours. |
I must add some aspect: I did some extensive tests with my ESP8266-12F: In this case the connection with BSSID and channel is approx done in 50ms (using average timings of 30 rounds, and a delay of 20ms waiting to get WL_CONNECTED status. However: if I change the scenario to: Loop: It does not make any difference if I try to connect with BSSID, channel and SSID or only SSID and PWD. |
A long time ago in a repo far far away, I witnessed a conversation about the BSSID. If memory serves (don't assume it does), the described behavior is meant to cover the case where you have several APs with the same SSID/password covering an area. Of course, in that case each ap has its own mac. In that scenario, if the ESP's configured ap drops out for whatever reason, but another one is still in range, you don't want the connection to fail, but rather fallback to the default behavior, and succeed with a different ap. In other words, let the ESP take a bit longer, but don't fail. I find @schlaubstar findings most interesting, I hope it helps somebody to reduce wakeup/sleep cycles. I don't think there is an issue here. Closing. |
Hi |
@JonathanCaes I don't know why you re open this thread for you question but it's simple: you don't. As your AP will auto-configure the channel depending on the signals of other networks (that will dynamically change and can not be affected by you) so you can not use a connection setup where you transmit the channel. However: As mentioned: connecting with station name (SSID) and password can be as fast as connecting with a full set of parameters |
Basic Infos
Hardware
Hardware: Sparkfun Thing Dev ESP8266
Core Version: 2_3_0
Description
In order to speed up connection of my ESP8266 to my AP, I was trying to provide a known channel and BSSID configuration using the overloaded function
WiFi.begin(ssid, password, channel, bssid, connect)
instead ofWiFi.begin(ssid, password, channel)
.It actually does speed up the process when using the correct BSSID parameter (~1.5s instead of ~6s). However I observed a strange behaviour of this overloaded function when specifying wrong channel and BSSID parameters:
Expected result: Connection should never succeed with wrong channel or BSSID parameters.
Actual result: When specifying the wrong channel and/or BSSID parameter, connecting takes way longer (~16s) but does not fail if provided with proper SSID/password pair.
@kentaylor stated using this overloaded function without changing ssid nor password would not do anything. Reading the documentation of the station class and the code (ESP8266WiFiSTA.cpp if I understand correctly), I can't see anything that would skip calling
wifi_station_set_config(&conf)
.Reading "ESP8266EX SDK Programming Guide" did not help to understand this behaviour either.
I'm confused ! Is it a bug or a feature ? ;-)
Settings in IDE
Module: Sparkfun ESP8266 Thing Dev
CPU Frequency: 160Mhz
Upload Using: SERIAL
Reset Method: ?ck / nodemcu?
Sketch
Debug Messages
Using the correct BSSID:
Using the wrong one:
The text was updated successfully, but these errors were encountered: