-
Senior Member
registered user
Using nmcli to assess the wifi neighborhood
.
I ran across a very useful linux command with which to query NetworkManager
via command line to assess the situation in one's wifi neighborhood. This
command is nmcli. With only a few parameters nmcli will divulge a
whole lot about your wifi situation vis-a-vis your immediate wifi neighbors.
If your wifi is up and running, you don't even need to tell nmcli what your
own ESSID and channel number are; it already knows. The command nmcli dev wifi
tells you all you need to know in very short order.
Now, in the US, on the 2.4 GHz band, there are 11 adjacent wifi channels, but
it is assumed that a single user might best utilize only channels 1, 6 or 11;
and of these, choose that single channel which allows the maximum difference
in received signal relative to other users on this same channel.
A little sorting of the total environment result for each of the three
special channels may help in making your final selection from among Channels
1, 6 and 11. I have developed a small bash utility which will display your
signal situation relative to your wifi neighbors called skan*, with four
parameter choices: all, 1, 6 or 11. These choices should help you asses what
your best channel choice might be from among the three choices 1, 6 or 11.
*I use the name skan rather than scan to differentiate this utility from
the program /usr/bin/scan already a part of Knoppix 7.6.
If some neighbor uses another channel than 1, 6 or 11, the choice 'all'
will show his situation, but you probably still should choose from among
1, 6 and 11. Looking at these three channels individually may make it
easier to see what your best situation might be.
I find it convenient to group small bash programs together in /home/knoppix/.bashrc
rather than making individual 'crunch-bang' programs of them. The following
excerpts show how the function skan fits within the .bashrc that I use.
Code:
# Beginning of .bashrc utilities for Knoppix 7.6 LiveUSBs. 03/14/16
#
# Note: Save this file as /home/knoppix/.bashrc with its ownership
# chown knoppix:knoppix and make it executable with chmod +x.
#
# SNIP ( other aliases may go here )
#
############################## wifi scan utility start ##############################
alias nl="echo -e '\r'" ;
alias NMCLI='nmcli dev wifi' ; alias wterm='lxterminal --geometry=90x38'
alias ALL="NMCLI | grepx -v '*'" # Actually all but SSID & ESSID
alias heading="date +'at '%l:%M' '%P' '%Z' on '%x; nl; NMCLI | grep '*'"
skan() { # Shows local wifi situation; uses $1 to choose among Channels 1,6,11 & all.
clear; nl; case $1 in
all) echo -e "ESSID plus \c"; echo -e 'all-channel\c' ; \
echo -e ' wifi activity, \c'; heading; ALL ;;
1|6|11) echo -e "ESSID plus \c"; echo -e 'Channel-'$1'\c'; \
echo -e ' wifi activity, \c'; heading; ALL | grepx -w $1 ;;
*) echo -e "Expected input is 'skan Channel'
where Channel is 1, 6, 11 or all.
If a wider or taller terminal display is needed, use wterm." ;;
esac; nl
}
################################ wifi scan utility end ##############################
#
#SNIP ( other functions may go here )
#
# Copyright 2016 by TJ Hoye, License GPL Version 2
# End of .bashrc utilities for Knoppix 7.6 LiveUSBs.
Using this utility assumes that NetworkManager is installed and working, and that
your wifi has a scanning capability. My built-im $20 Broadcom wifi has this capability
so I assume this is not some exotic situation.
I hope some of you will try this out for yourselves and give me some feedback on this.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules

Apple Mac Pro 2019 1TB OEM SSD Kit-768GB +384GB - 656-0119/ 656-0120
$69.99

Samsung 2.5" 870 EVO SSD SATA III 250GB 500GB 1TB Internet Solid State Drive Lot
$155.00

External SSD 1TB 2TB 4TB Portable Hard Drive USB 3.0 Type-C High Speed PC Mac
$19.99

Dell Latitude 14" Laptop Computer Intel i5 Up To 32GB RAM 1TB SSD Windows 11 Pro
$545.25

1TB Kingston DataTraveler Max DTMAX/1TB USB Type-C Flash Drive
$86.95

SAMSUNG T7 Portable SSD 1TB Indigo Blue USB 3.2 Gen2 External MU-PC1T0H/AM
$159.99

Netac 2TB 1TB 500GB Internal SSD M.2 NVMe PCIe3.0 Solid State Drive lot
$129.99

Acer Predator Helios Neo 16S AI 16" i9 275HX 2S RTX 5070 Ti 32GB 1TB SSD Refurb
$1746.47

Dell Latitude 14" Laptop Computer Intel i7 Up To 32GB RAM 1TB SSD Windows 11 Pro
$330.73

1TB Portable External Hard Drive USB 3.0 Storage Backup for PC Mac Laptop
$29.99