Wi-Fi Scanning and excluding 802.11n 5Ghz networks

lil_spli
Posts: 18
Joined: Wed May 31, 2017 9:56 am

Wi-Fi Scanning and excluding 802.11n 5Ghz networks

Postby lil_spli » Fri Mar 23, 2018 11:02 am

Hi

Our app scans for wi-fi networks to connect to (which a user than then tell the ESP32 to connect to using an app on their phone). When the scan returns, the ap records will contain 802.11n 5Ghz APs that the ESP32 can then not connect to. Is there anyway to exclude or filter out 5GHz APs? I can't seem to find an obvious way in the API. I was wondering if it's possible to filter based on channel, but that doesn't feel necessarily explicit that it's a 5Ghz network.

Thanks

Simon

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Wi-Fi Scanning and excluding 802.11n 5Ghz networks

Postby WiFive » Fri Mar 23, 2018 11:35 pm

Do the scan on the esp32 and send the results to the app. That way you can show actual signal strength and user can know whether to move device for better signal.

lil_spli
Posts: 18
Joined: Wed May 31, 2017 9:56 am

Re: Wi-Fi Scanning and excluding 802.11n 5Ghz networks

Postby lil_spli » Mon Mar 26, 2018 4:09 pm

The problem isn't do with RSSI as such, it's to do with the fact that the ESP doesn't support 5Ghz and therefore these APs should be filtered out of the scan if possible.

Thanks


Simon

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Wi-Fi Scanning and excluding 802.11n 5Ghz networks

Postby WiFive » Mon Mar 26, 2018 8:48 pm

If the esp32 is doing the scan it won't return a 5ghz network. That would only happen if the phone is doing the scan. And it's not a good idea for the phone to do the scan because it doesn't represent the signal strength seen by esp32.

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: Wi-Fi Scanning and excluding 802.11n 5Ghz networks

Postby ESP_Angus » Mon Mar 26, 2018 10:32 pm

Hi Simon,

As WiFive mentions, if the ESP32 and the phone are in different places then it may be more helpful to scan on the ESP32 (which will only see 2.4GHz APs) and push the result to the phone.

If this not viable, you may still be able to scan for 2.4GHz APs on a phone. You haven't mentioned what phone platform your app is for. Android returns the frequency in MHz as part of the scan result:
https://developer.android.com/reference ... #frequency
If the frequency is less than 2500000, it's a 2.4GHz AP.

AFAIK iOS doesn't provide any WiFi scan API at all, without jailbreaking & using a private API and restricted entitlement. That could be wrong, I'm not an app developer. :)

lil_spli
Posts: 18
Joined: Wed May 31, 2017 9:56 am

Re: Wi-Fi Scanning and excluding 802.11n 5Ghz networks

Postby lil_spli » Tue Mar 27, 2018 9:24 am

Hi

I am scanning on the ESP32 (returning these results to the app over BLE), and the scan is returning 5Ghz networks that the ESP then fails to connect to. The 5Ghz APs have the same SSID as the 2.4Ghz as well which makes it very confusing. Now that I think of it, it's not consistent across all routers, but it's happened on the majority we've tested with. I would admit to not being an expert in Wifi beacon advertisement, so maybe there's something else going on here.

Thanks


Simon

lil_spli
Posts: 18
Joined: Wed May 31, 2017 9:56 am

Re: Wi-Fi Scanning and excluding 802.11n 5Ghz networks

Postby lil_spli » Wed Apr 18, 2018 10:50 am

So I've found some time to do some more research on this. It would seem that some dual-band routers advertise the same SSID on the same channel but with the different BSSID. I'm not an expert on the dual band aspect. But if I do a scan on the ESP, I get:

I (2692) wifi: Ap record: ssid: MyAP, bssid: c8bcc8ffd76b, channel: 6
I (2752) wifi: Ap record: ssid: MyAP, bssid: 00236cbf2cb0, channel: 6

I've renamed the wifi SSID for security's sake, but it's the same SSID. If I do a scan using my laptop (using a scanning tool, but my wifi connection settings), I get three records: the above two and third one (with the latter BSSID) for the 5GHZ network (with a different SSID, in this case MyAP-5Ghz).

The ESP can't connect to the second AP, as it's a 5GHz network. My mac show's the correct networks to connect to in the Wifi preferences as I believe it can filter out the second AP, as it can see the 5GHz record.

The problem is that if I just do a connect using SSID, it could fail as it may connect to the wrong one.

How can I get the ESP to manage this and connect to the right one?

Thanks


Simon

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Wi-Fi Scanning and excluding 802.11n 5Ghz networks

Postby WiFive » Wed Apr 18, 2018 11:34 am

Are you sure the first one is not a repeater (airport express, time capsule)? Have you actually tried to connect the esp32 to the second one by specifying the bssid? As you can see the 2.4ghz and 5ghz networks are not supposed to share the same bssid aka Mac address, but they are usually similar. https://support.apple.com/en-us/HT202640

lil_spli
Posts: 18
Joined: Wed May 31, 2017 9:56 am

Re: Wi-Fi Scanning and excluding 802.11n 5Ghz networks

Postby lil_spli » Wed Apr 18, 2018 12:49 pm

Of course. Thanks. That'll be it! We've had it on a few networks, and I just made the assumption that it was something to do with 5Ghz.

Now I need to work out a way to mitigate that.

Thanks again


Si

lil_spli
Posts: 18
Joined: Wed May 31, 2017 9:56 am

Re: Wi-Fi Scanning and excluding 802.11n 5Ghz networks

Postby lil_spli » Wed Apr 18, 2018 4:00 pm

So I have a question which someone from the ESP team should be able to answer (or someone else knowledgable on the subject).

In the case where you have an extended network, with two devices with the same SSID on the same channel, if I just connect using SSID and passphrase in the the config struct, which BSSID will the ESP connect to? Also, if I move the ESP closer to the repeater, will it then connect to this one or the original master AP on a reconnect?

Thanks


Simon

Who is online

Users browsing this forum: Google [Bot], NevynSelby and 81 guests