-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Connection Speed Problem with WIFI_RESUME #7876
Comments
Thanks for investigating this ! Did you achieve this test by replacing the |
No. I think it was simply a lack of time. If it's really working with the AP's bssid, then we should automate this and automatically store it in the structure before deepsleep is called. |
I just changed // state->state.fwconfig.bssid is not real bssid (it's what user may have provided when bssid_set==1)
auto beginResult = WiFi.begin((const char*)state->state.fwconfig.ssid,
(const char*)state->state.fwconfig.password,
state->state.channel,
nullptr/*(const uint8_t*)state->state.fwconfig.bssid*/, // <- try with gw's mac address?
true); to // state->state.fwconfig.bssid is not real bssid (it's what user may have provided when bssid_set==1)
auto beginResult = WiFi.begin((const char*)state->state.fwconfig.ssid,
(const char*)state->state.fwconfig.password,
state->state.channel,
state->state.fwconfig.bssid,
true); Even though the comment above states, that Arduino/libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp Lines 745 to 746 in 483519f
As far as I understand, the BSSID can be something other than the mac address of the AP, so trying to fill that in during initial connect may not work. However using the value set by |
I tried your change and your example shows that this API works, nice !
I don't think this matters. This API is meant to wake up faster when possible. If the chip has physically moved and another bssid with the same ssid is around, then it will take longer to connect. This API is useful for the general case, where the same AP is always around. |
Will create a PR. |
@d-a-v shouldn't the WiFiShutdown expample be in the |
Should I try to add some documentation for WIFI_SHUTDOWN / WIFI_RESUME? |
This will be welcome ! |
Basic Infos
Platform
Settings in IDE
Problem Description
With below sketch on my WEMOS D1 mini Lite reconnecting to the WiFi after a deepSleep takes about 3.9 seconds. Changing the following line in
ESP8266WiFiGenericClass::resumeFromShutdown
to pass in the BSSID reduces the connection time to about 1.2 seconds.Arduino/libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp
Line 833 in 483519f
I guess the idea here was to avoid connection problems, if there are multiple access points with the same SSID and the original access point is not available or another access point is closer to the station. However, this adds a huge performance penalty on WIFI_RESUME.
If always passing the BSSID to
WiFi.begin
is not an option, then some kind of API would be great for the user to decide which of the stored parameters should be used.E.g. something like:
MCVE Sketch
Debug Messages
Before Change
After Change
The text was updated successfully, but these errors were encountered: