Search code examples
c#wifisignal-strength

How often to poll wifi signal strength?


Ideally I would like to monitor the signal strength of a wireless network in near real-time, say every 100ms, but such a high frequency is probably overkill.

I'm using the Managed Wifi library to poll RSSI. I instantiate a WlanClient client = new WlanClient(); once and re-use that client to measure signal strengths every second or so (but I'd like to do it more often):

foreach (WlanClient.WlanInterface wlanInterface in _client.Interfaces)
{
    Wlan.WlanBssEntry[] wlanBssEntries = wlanInterface.GetNetworkBssList();
    foreach (Wlan.WlanBssEntry wlanBssEntry in wlanBssEntries)
    {
        int sigStr = wlanBssEntry.rssi; // signal strength in dBm
        // ...
    }
}

What is the fastest practical polling delay and is this the best way to measure signal strength?


Solution

  • I'm afraid the smallest polling delay will vary, with your driver stack but I suspect also with the number of Access Points around. WiFi is a protocol based on time slots.

    From my (limited) experience a 1 sec interval is about right, you will already see that the list of stations isn't always complete (ie stations missing on 1 scan, back on the next).

    is this the best way to measure signal strength?

    Depends, but how fast do you expect it to change? When walking around, the signal won't vary much over a second.