emoacht / ManagedNativeWifi

A managed implementation of Native Wifi API
MIT License
139 stars 41 forks source link

No Information about WIFI6E Access Points in EnumerateBssNetworks #54

Closed P-Faust closed 6 months ago

P-Faust commented 7 months ago

I try to build a little script to gather the RSSI Value to the connected Access Point. I found out that i dont see netwoks which are in the 6GHz Frequency band. Any Idea how to gather the information about the 6GHz Networks?

EDIT: The Profilename in EnumerateInterfaceConnections is correct shown and the 6E network card is also shown correctly

emoacht commented 7 months ago

Which method are you talking about? Please be specific.

P-Faust commented 7 months ago

The EnumerateBssNetworks Method. The following function i use to debug and print out the information of the BssNetworks.

static void GetEnumNetworks(IEnumerable<BssNetworkPack> bssNetworks)
{
    foreach (var i in bssNetworks)
    {
        Console.WriteLine($"SSID={i.Ssid}");
                Console.WriteLine($"BSSID{i.Bssid}");
        Console.WriteLine($"RSSI={i.SignalStrength}");
        Console.WriteLine($"INTERFACE={i.Interface}");
        Console.WriteLine($"CHANNEL={i.Channel}");
        Console.WriteLine($"BAND={i.Band}");
        Console.WriteLine();
    }
}

The Output shows all 2,4 GHz and 5 GHz networks correctly but the 6GHz networks are not shown.

emoacht commented 7 months ago

Thank you for the clarificaion. Then, what is the value of BssNetworkPack.Frequency?

P-Faust commented 7 months ago

Sure i can show you some Outputs

Output of the NativeWifi.EnumerateInterfaces():

PS C:\Users\frank\Downloads\net6.0\net6.0> .\Rssi_Printer.exe -interfaces
ID=ab3856ff-eae7-40bf-80a6-8bfe8e10b016
STATE=Connected
DESCRIPTION=Intel(R) Wi-Fi 6E AX211 160MHz

Output of the NativeWifi.EnumerateInterfaceConnections():

PS C:\Users\frank\Downloads\net6.0\net6.0> .\Rssi_Printer.exe -interfacescon
ID=ab3856ff-eae7-40bf-80a6-8bfe8e10b016
PROFILENAME=9166.6g
DESCRIPTION=Intel(R) Wi-Fi 6E AX211 160MHz

Output of the NativeWifi.EnumerateBssNetworks():

PS C:\Users\frank\Downloads\net6.0\net6.0> .\Rssi_Printer.exe -networks
SSID=wa.lab.5g
BSSIDE8:ED:F3:CD:4D:4E
RSSI=-58
INTERFACE=Intel(R) Wi-Fi 6E AX211 160MHz
CHANNEL=36
BAND=5
FREQUENCY=5180000

SSID=9166.5g
BSSIDAC:2A:A1:2E:C2:8D
RSSI=-61
INTERFACE=Intel(R) Wi-Fi 6E AX211 160MHz
CHANNEL=36
BAND=5
FREQUENCY=5180000

SSID=wa.lab.psk
BSSIDE8:ED:F3:CD:4D:4D
RSSI=-58
INTERFACE=Intel(R) Wi-Fi 6E AX211 160MHz
CHANNEL=36
BAND=5
FREQUENCY=5180000

SSID=9166.2g
BSSIDAC:2A:A1:2E:C2:81
RSSI=-58
INTERFACE=Intel(R) Wi-Fi 6E AX211 160MHz
CHANNEL=1
BAND=2,4
FREQUENCY=2412000

SSID=wa.lab.psk
BSSIDE8:ED:F3:CD:4D:42
RSSI=-50
INTERFACE=Intel(R) Wi-Fi 6E AX211 160MHz
CHANNEL=1
BAND=2,4
FREQUENCY=2412000

And for clarification an output of netsh wlan show interfaces

Name                   : WLAN
    Beschreibung            : Intel(R) Wi-Fi 6E AX211 160MHz
    GUID                   : ab3856ff-eae7-40bf-80a6-8bfe8e10b016
    Physische Adresse       : d4:e9:8a:5b:d3:99
    Benutzeroberflächentyp         : Primär
    Status                  : Verbunden
    SSID                   : 9166.6g
    BSSID                  : ac:2a:a1:2e:c2:87
         Zusammengelegte APs:     : 2
            BSSID: ac:2a:a1:2e:c2:81,  Band: 2,4 GHz,  Kanal: 1
            BSSID: ac:2a:a1:2e:c2:8d,  Band: 5 GHz  ,  Kanal: 36
    Netzwerktyp            : Infrastruktur
    Funktyp                   : 802.11ax
    Authentifizierung   : WPA3-Personal  (H2E)
    Verschlüsselung                 : CCMP
    Verbindungsmodus        : Profil
    Band                   : 6 GHz
    Kanal                : 85
    Empfangsrate (MBit/s)  : 1081
    Übertragungsrate (MBit/s) : 1081
    Signal              : 85%
    Profil                 : 9166.6g

As you can see everything except the 6GHz Networks are shown. In the EnumerateBssNetworks Method. I hope this Output can help you, let me know if you need more specific logs!

emoacht commented 7 months ago

Thanks but I noticed that we need to skip the following lines temporarily to get the 6GHz networks.

https://github.com/emoacht/ManagedNativeWifi/blob/6763a1eafc1a679bfe5a40eef8c3bd72099942b6/Source/ManagedNativeWifi/NativeWifi.cs#L361-L362

Could you comment out the above line and try again?

P-Faust commented 7 months ago

Thank you i have commented out the lines you mentioned and had to set the band and channel variable to dummy values. https://github.com/emoacht/ManagedNativeWifi/blob/6763a1eafc1a679bfe5a40eef8c3bd72099942b6/Source/ManagedNativeWifi/NativeWifi.cs#L373-L374 Now there are the 6GHz Frequencies shown in my debugging function with rssi etc. I will later attach output to this comment.

P-Faust commented 6 months ago

Here's the output of the EnumerateBssNetworks Method with your mentioned lines commented out and insert Channel 0 and band 0.0f as Value in my mentioned lines of the NativeWifi.cs

SSID=ssid.eap.6g
BSSID38:91:B7:D6:40:E7
RSSI=-38
INTERFACE=Intel(R) Wi-Fi 6E AX211 160MHz
CHANNEL=0
BAND=0
FREQUENCY=6375000

SSID=9166.6g
BSSIDAC:2A:A1:2E:C2:87
RSSI=-40
INTERFACE=Intel(R) Wi-Fi 6E AX211 160MHz
CHANNEL=0
BAND=0
FREQUENCY=6375000
emoacht commented 6 months ago

Thank you for information. Let me make sure which channel you configured for the network? Is is 85?

emoacht commented 6 months ago

Added the function to detect 6GHz band and channels by db90c16fb9c9b0ccccb7e4451d531a8ccce72e87 for the time being.

P-Faust commented 6 months ago

Sorry for the late response. db90c16 solved the issue. Here's the Output


SSID=9166.6g
BSSIDAC:2A:A1:2E:C2:87
RSSI=-32
INTERFACE=Intel(R) Wi-Fi 6E AX211 160MHz
CHANNEL=85
BAND=6
FREQUENCY=6375000
´´´