Results 1 to 5 of 5

Thread: A built-in wifi scanning command you can add to Knoppix

  1. #1
    Senior Member registered user
    Join Date
    May 2006
    Location
    Columbia, Maryland USA
    Posts
    1,631

    A built-in wifi scanning command you can add to Knoppix

    .
    If you would like to know what the wifi environment looks like where you are,
    here's a little command-line way to display who's on which channel and how strong
    they are relative to your own wifi.

    You can easily try this out _temporarily_ by typing in the following line into
    a Knoppix lxterminal:
    Code:
    alias wifi.scan='nmcli -p dev wifi list'
    And, <enter>, of course. Then when you <enter> 'wifi.scan',
    what you get may look like the following if you have a lot of yuppies with Ipads
    and Kindles and Window computers and wireless printers in your neighborhood:
    Code:
    ====================================================================================
                                  Wi-Fi scan list (wlan0)
    ====================================================================================
    *  SSID                            MODE   CHAN  RATE       SIGNAL  BARS  SECURITY  
    ------------------------------------------------------------------------------------
       WARnet                          Infra  11    54 Mbit/s  25      ▂___  WPA1 WPA2 
       --                              Infra  6     54 Mbit/s  24      ▂___  WPA2      
       xfinitywifi                     Infra  6     54 Mbit/s  25      ▂___  --        
       LivingBrook                     Infra  6     54 Mbit/s  25      ▂___  WPA2      
       HOME-B0C2                       Infra  6     54 Mbit/s  27      ▂___  WPA1 WPA2 
       LivingBrook-Guest               Infra  6     54 Mbit/s  27      ▂___  --        
       --                              Infra  6     54 Mbit/s  22      ▂___  WPA1 WPA2 
       xfinitywifi                     Infra  6     54 Mbit/s  20      ▂___  --        
       walters                         Infra  6     54 Mbit/s  19      ▂___  WPA1 WPA2 
       H89L2                           Infra  6     54 Mbit/s  19      ▂___  WPA2      
       WARnet                          Infra  1     54 Mbit/s  25      ▂___  WPA1 WPA2 
    *  MyWiFi                          Infra  6     54 Mbit/s  62      ▂▄▆_  WPA2      
       FiOS-9IX5R                      Infra  11    54 Mbit/s  20      ▂___  WPA2      
       FiOS-JHVGZ                      Infra  1     54 Mbit/s  25      ▂___  WPA2      
       FiOS-E9IHZ                      Infra  11    54 Mbit/s  17      ▂___  WPA2      
       HP-Print-57-Officejet Pro 8600  Infra  11    54 Mbit/s  20      ▂___  --        
       STRIPES                         Infra  11    54 Mbit/s  25      ▂___  WPA1 WPA2 
       snarfle                         Infra  11    54 Mbit/s  19      ▂___  WPA2      
       Basement                        Infra  11    54 Mbit/s  20      ▂___  WPA1 WPA2 
       87CX5                           Infra  3     54 Mbit/s  22      ▂___  WEP
    I add the one line, wifi.scan='nmcli -p dev wifi list', to my executable .bashrc
    file to make wifi.scan a _permanent_ built-in capability.
    If you don't already have a .bashrc file, then make one and do chmod +x
    to make it executable. Try it, you may like it.

    This all presumes your wifi supports scanning. My wifi is a $20 replacement unit,
    so this capability my very well be present in other inexpensive computers like mine.

  2. #2
    Junior Member
    Join Date
    Mar 2016
    Posts
    1
    This is brilliant utu. I just tried this and it works great. What do the Channels mean though?

  3. #3
    Administrator Site Admin-
    Join Date
    Apr 2003
    Location
    USA
    Posts
    5,441
    Channels indicate the actual frequency that a wifi device is using, This is not really Knoppix or even Linux related, you can study wifi a bit more to understands it. There are a number of channels (differs by country) but they overlap significantly, so there isn't really as much space as it might seem. Knowing what channels are in use in your location may help you set up a new router or access point on a less crowded frequency, but it is not critical for the average user to understand channels to use wifi.
    ---
    Verifying of md5 checksum and burning a CD at slow speed are important.

  4. #4
    Senior Member registered user
    Join Date
    May 2006
    Location
    Columbia, Maryland USA
    Posts
    1,631

    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.

  5. #5
    Senior Member registered user
    Join Date
    May 2006
    Location
    Columbia, Maryland USA
    Posts
    1,631

    My apologies.

    .
    In the excerpted .bashrc in post 4, there is an unfortunate omission.

    You will either need to change the grepx reference to grep,
    or add the missing alias for grepx which is:

    alias grepx='grep -i --color'.

    Either correction should suffice, but grepx is a little more interesting, IMO.
    Also, there's already a convenient spot for this alias on the line which now reads:

    alias nl="echo -e '\r'" ;

    which includes an otherwise unnecessary semi-colon.
    In any event, don't omit the semi-colon if the two aliases are on the same line.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


XDHXT DELL PERC H710P 6Gbps 1GB PCI RAID CONTROLLER 0XDHXT picture

XDHXT DELL PERC H710P 6Gbps 1GB PCI RAID CONTROLLER 0XDHXT

$59.00



IBM LSI SAS9220-8i M1015 46M0861 SAS/SATA PCI-e RAID Controller Both brackets picture

IBM LSI SAS9220-8i M1015 46M0861 SAS/SATA PCI-e RAID Controller Both brackets

$139.00



LSI 9305-16i SATA SAS 12Gbs RAID Controller PCIe 3.0 x8 IT-Mode 4* 8643 SATA picture

LSI 9305-16i SATA SAS 12Gbs RAID Controller PCIe 3.0 x8 IT-Mode 4* 8643 SATA

$229.99



Lot of 4 - Genuine Dell (62P9H) PERC H710 512MB Mini Blade 6Gbps SAS Raid picture

Lot of 4 - Genuine Dell (62P9H) PERC H710 512MB Mini Blade 6Gbps SAS Raid

$49.99



Inspur LSI 9300-8i Raid Card 12Gbps HBA HDD Controller High Profile IT MODE picture

Inspur LSI 9300-8i Raid Card 12Gbps HBA HDD Controller High Profile IT MODE

$15.98



ORICO Multi Bay RAID Hard Drive Enclosure USB 3.0/ Type-C For 2.5/3.5'' HDD SSDs picture

ORICO Multi Bay RAID Hard Drive Enclosure USB 3.0/ Type-C For 2.5/3.5'' HDD SSDs

$86.99



LSI MegaRAID 9361-8i 12Gb PCIe 8-Port SAS/SATA RAID 1Gb w/BBU/CacheVault/License picture

LSI MegaRAID 9361-8i 12Gb PCIe 8-Port SAS/SATA RAID 1Gb w/BBU/CacheVault/License

$35.96



LSI MegaRAID 9361-8i 12Gbps PCIe 3 x8 SATA SAS 3 8 Port RAID + BBU & CacheVault picture

LSI MegaRAID 9361-8i 12Gbps PCIe 3 x8 SATA SAS 3 8 Port RAID + BBU & CacheVault

$39.00



Yottamaster 5 Bay RAID Hard Drive Enclosure USB3.1 Type C 2.5

Yottamaster 5 Bay RAID Hard Drive Enclosure USB3.1 Type C 2.5"/3.5" SATA HDD SSD

$142.49



Dell PCIe M.2 Boss S1 RAID Controller Card 7HYY4 with 2x 240GB SSD picture

Dell PCIe M.2 Boss S1 RAID Controller Card 7HYY4 with 2x 240GB SSD

$94.99