π§Wi-Fi Channel Tool (wifichannel)
you can think of this as a warm up exercise
WLAN Pi comes with a small CLI tool called wifichannel
This tool began as a simple conversion utility, for switching between channel numbers and centre frequencies.
Channel maths
Query wifichannel with the command
wifichannel 7The output gives you information about channel 7
wifichannel 6Band: 2.4 GHz Channel: 6 Center freq: 2437 MHz`` Recommended: Yes
wifichannel 17Band: 6 GHz Channel: 17 Center freq: 6035 MHz`` PSC: No ``Lower 6 GHz
wifichannel 60Band: 5 GHz Channel: 60`` Center freq: 5300 ``MHz U-NII-2A
wifichannel 6055Band: 6 GHz`` Channel: 21 ``PSC: Yes Lower 6 GHz
List all channels
Display all 2.4 GHz channels:
wifichannel -2Display all 5 GHz channels:
wifichannel -5How would you display all 6 GHz channels?
This command will help you if you are ever in doubts:
Filter output with Linux filters (grep)
You can filter the output of most command line utilities to make the output more efficient.
Example
How many channels in the 2.4 GHz band are 'recommended'?
First, run the command to display all 2.4 GHz channels:
You could count the lines manually, but there is no need. Computers can already do that, really fast.
Using a linux utility called grep we can filter the output to only include lines that contain "a particular string or pattern":
Finally, we can simply count the number of lines returned by the command using word count, that command looks like this:
3
Last updated
Was this helpful?