GithubHelp home page GithubHelp logo

Comments (5)

easytarget avatar easytarget commented on August 20, 2024

Interesting.. I assume it shows both AP's as 'known' in the serial console list. But connects to the weaker signal?

Currently the code just notes the SSID name of the strongest signal and then the actual connection is established with a WiFi.begin(ssid,passwd);. So if Wifi.begin() simply takes the 'first' match it finds (and dosnt look for signal strength etc) it may well prefer the wrong AP.
[I believe it has some logic for 'fast connecting' that may be making it use internally and complicating things too.. but I'm not really sure.. 😦 ]

Anyway... I think I can see a way to aleviate some of this pain by Connecting to BSSID instead. This isn't the same as doing a full ESS enterprise multi AP support thing (which is not well supported in the Arduino esp32 libs).

I'll look into the code later, but just as a proof maybe you could replace line 230 in esp32-cam-webserver.ino with the following two lines:

                String thisBSSID = WiFi.BSSIDstr(i);
                Serial.printf("%3i : [%s] %s (%i)", i + 1, thisBSSID.c_str(), thisSSID.c_str(), thisRSSI);

You should see both AP's listed in the 'Found Networks' serial output. With different BSSID's.
the esp32 implementation of WiFi.begin() is extended to allow specifying the bssid (hurrah 🎉 ) but I need to think further on the logic for this, since I need to cater for AP mode too.
Also, I'd like to allow specifying the BSSID in place of SSID in the actual station list.. which could be handy.

from esp32-cam-webserver.

TungstenE2 avatar TungstenE2 commented on August 20, 2024

hm, seems like today cam switched the AP by itself. This morning it started with the weak AP an now it is connected to the strong AP. strange...

from esp32-cam-webserver.

easytarget avatar easytarget commented on August 20, 2024

I'm not that surprised, this is what I mean by the begin() not caring about relative strengths, it's probably just selecting on a randomish 'order of discovery'. The BSSID stuff i have in progress should make it default to the strongest bssid.

from esp32-cam-webserver.

easytarget avatar easytarget commented on August 20, 2024

Hokay; I just committed a fix for this to the master branch, it will be in 3.0, it records both the SSID and BSSID when scanning for the strongest network; and then connects with both parameters supplied, if two SSID's have the same name it will now chose the strongest regardless of scan order.. It also allows you to specify a BSSID in place of the SSID in the array so you can force a specific AP if desired.

Also; I took the opportunity to split the definition for the station list, to make it a little less confusing.

from esp32-cam-webserver.

TungstenE2 avatar TungstenE2 commented on August 20, 2024

great, thanks!

from esp32-cam-webserver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.