How often to poll wifi signal strength?

纵饮孤独 提交于 2020-01-03 16:45:01

问题


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?


回答1:


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.




回答2:


For most cases where you want to monitor anything a reasonable guideline is to work out what is as seldom as possible to fulfil your purpose, then increase the frequency a bit beyond that to catch delays and unexpected spikes.

If for example you were going to display this to a user, then much more than once per half a second is going to mean changes too quick for the user to meaningfully make sense of, so around a quarter of a second should be more than enough to be sure you're catching everything you need.

If you are logging, then it depends on how long your log period will be for. Once every few minutes is likely to catch any serious problem times, so once a minute should do fine.

In all, while there is often some practical maximum frequency, its not worth considering unless the maximum useful frequency is higher, and that depends on your purposes.



来源:https://stackoverflow.com/questions/3855206/how-often-to-poll-wifi-signal-strength

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!