Multiple AP with same SSID #424
-
|
I have a setup with multiple access points, all having the same SSID and password. Signal strength varies due to weather and changing position of the ESP32-device, which should connect via your library. (Scan shows signal strength between 30-50%) I understand that I can have the environment scanned for SSID instead of the specific AP‘s BSSID (https://hieromon.github.io/AutoConnect/adconnection.html#match-with-known-access-points-by-ssid), but… It seems not to be working very well with multiple SSIDs of the same name being present at the same time. My goal would be to have the device connected to the strongest AP at all times. Any suggestions? Thanks a lot in advance! :) |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 2 replies
-
|
It is not an issue. Because AutoConnect::begin doesn't use BSSID with WiFi.begin. It is not used even if the AutoConnectConfig::principle setting is AC_PRINCIPLE_RSSI. BSSID will be the priority in your desired situation, but in other use cases, WiFi.begin with BSSID will be a stumbling block. It is common for multiple remote locations to have the same SSID (of course, different BSSIDs). Such infrastructure eliminates the need to reconfigure the WiFi connection configuration as clients move. Use AutoConnectConfig::autoReconnect, and intentionally execute WiFi.disconnect before AutoConnect::begin to clear the recent setting of SDK. Of course, AutoConnectConfig::principle must be set properly. NOTE: |
Beta Was this translation helpful? Give feedback.
-
|
I don’t think I understand… so the wifi credentials on matching SSIDs will always connect but if a (by BSSID) already known AP is present, the connection will be made to this one even if the RSSI is not the best of all networks? What would be the „proper“ setting for principle? All APs are in the same network segment and are controlled by the „main router“, FritzBox Mesh (if that helps). currently I deal with connection losses all 1 or 2 days even with autoReconnect there is no reconnection. I have to manually reset the esp to restore the connection. is there a „minimum“ quality for the esp to connect? Quality is show in ranges from 20-40% |
Beta Was this translation helpful? Give feedback.
-
|
The following parameters with accurate values are required for AC_PRINCIPLE_RSSI can find the strongest RSSI beacon and either SSID or BSSID is used to detect it, depending on the definition of AUTOCONNECT_APKEY_SSID. AC_PRINCIPLE_RSSI will find the strongest RSSI but does not use the BSSID and channels that are essential to connect to that AP. That is because of the following reasons.
Generally, BSSID is generated from the MAC address of the device. However, there was a security issue with that immobilization method, and iOS and Android decided to randomize the MAC address. Cisco is starting to follow it. Refs.: https://datatracker.ietf.org/doc/html/draft-lee-randomized-macaddr-ps-00 This means that BSSID will not be able for WiFi connection negotiations in the future. Some AutoConnect users are already experiencing the inability to reconnect to iPhone mobile hotspots by BSSID matching. Because the BSSID changes every time you launch a mobile hotspot on your iPhone.
The channels that carry that BSSID are not always the same. It depends on the AP specifications. This means that you will be forced to try to connect to a different channel than the original channel, which can fail. Also, SoftAP and STA share the same channel. In other words, if you try to connect to the network from the captive portal, the password will be authenticated but the WiFi will be disconnected. After all, even in this scene, AutoConnect can not aim for the target AP using BSSID and channel.
Because to enable connections to hidden SSIDs. The SSID field of the AP beacon for the hidden SSID is blank. In other words, it can only be found by BSSID. (However, there is a risk that this strategy will be invalidated in the future. The reason is as mentioned above) AC_PRINCIPLE_RSSI does not work well when the following conditions are met: Something similar to this is happening in your network environment. AutoConnect scans by BSSID to enable reconnection to hidden SSIDs, while
That's the first thing I researched prior to implementing AutoConnect. The ESP-IDF station configuration API has it, but it's not implemented in the Arduino core. Instead, AutoConnect itself is discarding less than min RSSI. Use AutoConnectConfig::minRSSI setting with AC_PRINCIPLE_RSSI. However, in the end, AutoConnect doesn't use BSSID with |
Beta Was this translation helpful? Give feedback.
-
|
@laserir This topic will continue in the Discussions as it allows for enhancements. |
Beta Was this translation helpful? Give feedback.
-
|
Okay, this is much more complex (for me) than I thought! My sketch restarts the ESP every two hours, just to keep things fresh. Second topic... Strangely sometimes when the connection is successful, the mode stays in AP_STA, sometimes it switches to STA... I Think this started with the AC_OTA_BUILTIN config, which I added later for convenient updating, may I be correct? Here are the relevant code fragments, maybe this will help... The loop of course has the .handleClient() |
Beta Was this translation helpful? Give feedback.
The following parameters with accurate values are required for
WiFi.beginto succeed to match a beacon from an access point with the same SSID. We can see it in the ESP32's WiFi library.https://github.com/espressif/arduino-esp32/blob/5de09a9a4964961385f919eec12249dda5726a31/libraries/WiFi/src/WiFiSTA.h#L42
AC_PRINCIPLE_RSSI can find the strongest RSSI beacon and either SSID or BSSID is used to detect it, depending on the definition of AUTOCONNECT_APKEY_SSID.
Having discovered the strongest RSSI; That said, it's just the signal strength at that point. The WiFi signal is constantly changing due to radio wave interference from the external environment. Even if it is the strongest at a certa…