I need the information about the access-points/devices of the connected Wifi network

Hey,

I need the information about the access-points/devices of the connected Wifi network, I repeat only of the **connected Wifi network ** My use caes is about the indoor positioning of a user connect the network and for that I need the information of all the access points (e.g. ssid, bssid, rssi etc.) but till now I am unable to find any starting point/solution for this. Any help regarding this will be highly appreciated.

Regards, Aqeel Ahmed

The apps I'm most familiar with that do this are associated with Ubiquiti networking equipment, and those apps draw the network client data directly from the access points, in conjunction with the associated switch topology, combined with camera- and LIDAR-based room scanning.

Apple exited the Wi-Fi router and access point business a while back, so you'll want to look into whatever is available from your particular mix of vendors' routers, APs, and switches. That's probably going to involve some mix of SNMP, ICMP, CDP, OSPF, and BGP, among other protocols.

Other options seem to include SolarWinds Network Topology Mapper, or such. Pretty much any mid- or upper-range networking equipment vendor will have some options available for network mapping, too.

You didn’t mention your target platform but I suspect that you’re talking about iOS. Given that, the APIs you have available are listed in TN3111 iOS Wi-Fi API overview.

Also, check out iOS Network Signal Strength.

My use [case] is about the indoor positioning

It’s very unlikely that any of these will meet that goal. The Location tracking section has a short but honest summary of Apple’s position here.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Hello Eskimo,

Thanks for the reply. Apologies for not mentioning the platform but yes I am talking about iOS.

Actually, I only need the information (e.g. ssid, bssid, rssi etc.) of the access points of my connected Wifi only (don't need the information of other devices.) because signal strength of different APs installed on the same floor for the same Wifi network e.g. "MyWifi" is of my concern.

Till now I have tried to use the NWBrowser(for: .bonjour(type: "_http._tcp", domain: "local."), using: browseParameters) and I am able to identify two devices (which are printers) on my network but that's not required. May be I am using the wrong service "_http._tcp" but not sure about it. It would be great if someone can help me regarding that.

Looking forward to hearing from you.

Regards,

I only need the information (e.g. ssid, bssid, rssi etc.) of the access points of my connected Wi-Fi only

You can get SSID and BSSID of the current Wi-Fi. See the Current Wi-Fi network section of TN3111.

You can’t get the signal strength, per my iOS Network Signal Strength link above.

Till now I have tried to use the NWBrowser

That’s a very different question but…

It would be great if someone can help me regarding that.

I’m not actually sure what the question is. Bonjour lets you browse for services, not devices. You’re seeing two HTTP services because those printers advertise themselves as such (for a printer this is typically its admin interface). If you want to use this for some sort of location tracking, you’ll need to either advertise a specific service on each network or piggyback on some existing service that’s not going to change.

This will require the local network privilege. See Local Network Privacy FAQ for more on that.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

You can get the SSID and BSSID of the current Wi-Fi. See the Current Wi-Fi network section of TN3111.

Yes, I can get it but let me try to explain the scenario in detail.

I have a Wi-Fi network in a large building, let's assume on a large floor we have one router and two access points of the same wifi network e.g. "Wifi-1":

  • router: SSID --> "Wifi-1", BSSID --> f0:88:98:81:11:e1
  • access point 1: SSID --> "Wifi-1", BSSID --> f0:88:98:81:12:e2
  • access point 2: SSID --> "Wifi-1", BSSID --> f0:88:98:81:13:e3

Now when a user enters the building and connects with the "Wifi-1" using the password e.g. "Password1" and starts using it, assuming the user is currently close to the router and connected to it, I am able to get the info of "router" but couldn't get the info of "access point 1" & "access point 2". I used the SystemConfiguration.CaptiveNetwork and able to fetch the SSID & BSSID of router only which is:

  • SSID --> "Wifi-1", BSSID --> f0:88:98:81:11:e1

but at the same time, I need to get the SSID, BSSID, and RSSI (which will be calculated) of both access points too which are access point 1 and access point 2 because these are just the access points of the same Wifi.

Assuming the user starts moving towards access point 1 and reaches very close to it, now the signal strength of router is very weak or vanishes but the signal strength of access point 1 is good so the user will be connected to it seamlessly so that he can continue using the internet services. This is the point where I am able to fetch the information (SSID, BSSID & RSSI (calculated)) of access point 1 which will be:

  • SSID --> "Wifi-1", BSSID --> f0:88:98:81:12:e2

Now, when the user starts moving towards access point 2 and reaches closer to it the user will be connected to it, and in my app now I am able to fetch the info of it, which is:

  • SSID --> "Wifi-1", BSSID --> f0:88:98:81:13:e3

I am still unable to understand why the information of all these three is not being provided to me at the same time when I am connected with either of these, in my app when all are on the same network.

Below mentioned is my code snipped to get the SSID and BSSID:

import SystemConfiguration.CaptiveNetwork

struct ScanResult {
    
    let ssid: String
    let bssid: String
    let capabilities: String
    let level: Int
    let rssi: Int
}

func getWiFiInfo() -> ScanResult? {
        
        guard let interfaces = CNCopySupportedInterfaces() as? [String] else {
            return nil
        }
        
        var scanResult: ScanResult? = nil
        for interface in interfaces {
            
            guard let interfaceInfo = CNCopyCurrentNetworkInfo(interface as CFString) as NSDictionary? else {
                return nil
            }
            
            guard let ssid = interfaceInfo[kCNNetworkInfoKeySSID as String] as? String else {
                return nil
            }
            
            guard let bssid = interfaceInfo[kCNNetworkInfoKeyBSSID as String] as? String else {
                return nil
            }
            
            llet rssi: Int = 0 // Replace it with actual value
            
            scanResult = ScanResult(ssid: ssid, bssid: bssid, capabilities: "", level: rssi, rssi: rssi)
            
            break
        }
        
        return scanResult
    }

I have tried to explain the scenario in detail.

Here is the example of an applicationn available on the AppStore named: Wifi Analyzer Network Analyze When I connect to Wifi "Wifi-1" and tap scan option in the application it staart giving me the list of SSID and BSSID of my corruntly connnected device as well as of all the other Access points just like access point 1 & access point 1 even if I am connected to router either of these three.

Just like above application, I want to identify the other access points of my network along with SSID, BSSID and RSSI so that I can get my use cass fulfilled.

Regards, Aqeel Ahmed

I am still unable to understand why the information of all these three is not being provided to me at the same time when I am connected with either of these, in my app when all are on the same network.

I’m not sure why you think that’d happen. At the Wi-Fi level these are three separate networks, they just happen to have the same SSID. Our Wi-Fi driver can only join one network, and it that’s network’s details that are returned by CNCopyCurrentNetworkInfo.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

In that case, I have a question in mind:

  • Does getting a Network extension entitlement will help me out regarding this use case? Does the NetworkExtension framework can help me get this info somehow?
  • As I mentioned an application earlier: Wifi Analyzer Network Analyze I am a bit confused about how this is getting the information about all the connected devices on my Wifi Network along with BSSID (Mac Addresses) of those devices. This application is officially available on AppStore which means they are not violating any Apple policy, that's why I can't get this thing out of my mind that there must be an official way for it.

I am just sharing my thoughts to have your comments about it and the answer to my first question for my knowledge.

Looking forward to hearing from you.

Regards, Aqeel Ahmed

Does getting a Network extension entitlement will help me out regarding this use case?

My guess is that you’re talking about the entitlement required to use the Hotspot Helper API. If so, that API is not relevant here. To quote the docs:

NEHotspotHelper is only useful for hotspot integration [1]. There are both technical and business restrictions that prevent it from being used for other tasks, such as accessory integration or Wi-Fi based location.

As I mentioned an application earlier

I’m not able to comment on other developer’s apps.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

[1] In this context hotspots are defined as Wi-Fi networks where the user must interact with the network to gain access to the wider Internet.

I need the information about the access-points/devices of the connected Wifi network
 
 
Q