Your Wi-Fi might be terrible because of Dynamic Frequency Selection (DFS)
For a few months, I had issues with my Wi-Fi network. The 2.4 GHz network would be fine, but the 5 GHz one would suddenly stop working and completely disappear from the available Wi-Fi networks. OpenWRT upgrades also didn’t improve the situation. This was very annoying.
After some discussions with a friend, I learned about Dynamic Frequency Selection (DFS). Apparently some channels on the 5 GHz Wi-Fi spectrum are also used by weather and military radars, and those take priority. If such interference is detected, your Wi-Fi access point should switch to a different channel.
It turns out that some implementations are buggy and mine is one of them.
One quick but permanent fix is to manually select a Wi-Fi channel to operate in.
With OpenWRT, you can get a list of all the available Wi-Fi channels using this command:
iw list | grep dBm
Example output:
* 2412 MHz [1] (20.0 dBm)
* 2417 MHz [2] (20.0 dBm)
* 2422 MHz [3] (20.0 dBm)
* 2427 MHz [4] (20.0 dBm)
* 2432 MHz [5] (20.0 dBm)
* 2437 MHz [6] (20.0 dBm)
* 2442 MHz [7] (20.0 dBm)
* 2447 MHz [8] (20.0 dBm)
* 2452 MHz [9] (20.0 dBm)
* 2457 MHz [10] (20.0 dBm)
* 2462 MHz [11] (20.0 dBm)
* 2467 MHz [12] (20.0 dBm)
* 2472 MHz [13] (20.0 dBm)
* 5180 MHz [36] (23.0 dBm)
* 5200 MHz [40] (23.0 dBm)
* 5220 MHz [44] (23.0 dBm)
* 5240 MHz [48] (23.0 dBm)
* 5260 MHz [52] (20.0 dBm) (radar detection)
* 5280 MHz [56] (20.0 dBm) (radar detection)
* 5300 MHz [60] (20.0 dBm) (radar detection)
* 5320 MHz [64] (20.0 dBm) (radar detection)
* 5500 MHz [100] (26.0 dBm) (radar detection)
* 5520 MHz [104] (26.0 dBm) (radar detection)
* 5540 MHz [108] (26.0 dBm) (radar detection)
* 5560 MHz [112] (26.0 dBm) (radar detection)
* 5580 MHz [116] (26.0 dBm) (radar detection)
* 5600 MHz [120] (26.0 dBm) (radar detection)
* 5620 MHz [124] (26.0 dBm) (radar detection)
* 5640 MHz [128] (26.0 dBm) (radar detection)
* 5660 MHz [132] (26.0 dBm) (radar detection)
* 5680 MHz [136] (26.0 dBm) (radar detection)
* 5700 MHz [140] (26.0 dBm) (radar detection)
* 5720 MHz [144] (13.0 dBm) (radar detection)
* 5745 MHz [149] (13.0 dBm)
* 5765 MHz [153] (13.0 dBm)
* 5785 MHz [157] (13.0 dBm)
* 5805 MHz [161] (13.0 dBm)
* 5825 MHz [165] (13.0 dBm)
* 5845 MHz [169] (13.0 dBm)
* 5865 MHz [173] (13.0 dBm)
Notice the ones with (radar detection)
at the end? Those are the potentially problematic channels. We’re going to
avoid them from now on by picking a specific channel to use.
When it comes to the choice of the channels themselves, you’ll also have to consider the channel width. If you pick a channel next to one of the radar detection ones and with a large channel width, you might still run into issues.
Choosing a specific channel also comes with bandwidth and range trade-offs. If you don’t care much for those, go for the lowest one and with 40 MHz width. Picking the optimal Wi-Fi channel and channel width configuration for your specific needs is better explained by other resources.
I recommend getting a Wi-Fi spectrum analysis app that shows you the channels that are least populated by neighboring Wi-Fi access points.
It is also possible to define the list of channels that the Wi-Fi AP can automatically choose from using the channels
option for the wireless interface. We can use this setting to avoid the radar detection channels completely. This
setting doesn’t seem to be configurable via the graphical interface (LuCI), but you can change it
in /etc/config/wireless
using the command line and vi
, over SSH.
More information about this option and others can be found in OpenWRT documentation.
Based on our example, a configuration that avoids radar detection frequencies can look something like this:
config wifi-device 'radio0'
option type 'mac80211'
option path 'pci0000:00/0000:00:00.0'
option channel 'auto'
option channels '36 40 44 48 149 153 157 161 165 169 173'
option band '5g'
option htmode 'VHT40'
option country 'EE'
option cell_density '0'
Using a manually specified channel has resulted in no Wi-Fi related issues for over half a year.
I consider this a permanent fix.
If you’re using a PC and don’t want to mess with Wi-Fi issues ever again, then just run some Ethernet cables. It’s worth it.
Subscribe to new posts via the RSS feed.
Not sure what RSS is, or how to get started? Check this guide!
You can reach me via e-mail or LinkedIn.
If you liked this post, consider sharing it!