plus_plugins icon indicating copy to clipboard operation
plus_plugins copied to clipboard

[Request]: Get WiFi frequency info: 2.4 Ghz or 5 Ghz?

Open dJani97 opened this issue 2 years ago • 6 comments

Plugin

network_info_plus

Use case

We're working on provisioning ESP devices, and it is crucial that these devices are only compatible with 2.4 GHz networks. We have to prevent the user from attempting to provision such devices on 5 GHz networks because it will fail.

Currently, I couldn't find any official way in Flutter to check if the device is connected to a 2.4 GHz or 5 GHz network.

Proposal

This feature could be added to the network_info_plus package.

For example:

final frequency = await NetworkInfo().getWifiFrequency();

print('WiFi frequency: $frequency);

dJani97 avatar May 29 '23 09:05 dJani97

I'm working on this. @dJani97

Umar1312 avatar Jun 03 '23 14:06 Umar1312

I'm working on this. @dJani97

@Umar1312 any update on this? Can i somehow make sure 2 users are in the same wifi, when the wifi has the same ssid name for 5ghz and 2.4ghz, if i compare the bssids and remove the last 2 chars? 😅

I have a wifi like that and only the last 2 characters are different, do you know if this is normally the case? This is very hard to Google..

bettysteger avatar Sep 23 '23 16:09 bettysteger

I got this feature working on android, but couldn't get it to work on iOS owing to some elevated permission it requires to get those details. Have not been able to get it working on iOS, and I don't think my PR will be approved having only Android Compatibility.

@bettysteger Also I don't think that's a reliable way to match networks-matching BSSIDs. A lot of routers allow having completely separate names for 2.4 and 5 Ghz connections

Umar1312 avatar Sep 23 '23 19:09 Umar1312

Understandable. Since this feature is blocked because of platform restrictions, would it make sense to design the API of the package in such a way that it accommodates both platforms? For example, the network info class could have a field frequency of type enum WifiNetworkFrequency with three options: ghz24, ghz5, unknown, and we return unknown by default on iOS.

Wdyt?

jeroenbloom avatar Oct 09 '23 16:10 jeroenbloom

@jeroenbloom I'll try doing the above this weekend.

Umar1312 avatar Oct 10 '23 18:10 Umar1312

any update?

tony123S avatar Mar 15 '24 07:03 tony123S