Comments (5)
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.
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.
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.
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.
great, thanks!
from esp32-cam-webserver.
Related Issues (20)
- OV5640
- Flashing went well but no wifi network
- cam hangs after 2-3 days HOT 2
- Save and restore SSID and Passwd in config file
- Support mic and speaker
- Compiler warnings and errors in Arduino2.2.1
- started getting this HOT 5
- Error while compiling with Arduino IDE 1.8.19 HOT 1
- ssid issue
- init error
- Error when compiling for Xiao ESP32S3 HOT 1
- Internet access with Wifi-sta mode
- flash bin to device via ota
- Custom hostname not working
- how to get working with ov2640 HOT 1
- Streaming on Andorid Phone not possible HOT 1
- exit status 1 esp_int_wdt.h: No such file or directory HOT 8
- Start Recording and led on off issues HOT 1
- Stream Window is not rotated on port 81
- Sending data to Serial2 from the video stream.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esp32-cam-webserver.