WifiScanner

So you have written that new, must have program. Let us see it here.
Post Reply
User avatar
stevedee
Posts: 518
Joined: Monday 20th March 2017 6:06pm

WifiScanner

Post by stevedee »

I was looking through my applications for a suitable program to use as a Gambas Script example, and decided to strip down my Gambas WifiScanner from 2009. I've found this program to be very useful over the years, and having a light-weight, CLI version makes it even better for deploying in systems like my headless Raspberry Pi bird box.

This scanner displays details for local wifi access points and helps you to select the most favourable channels, not only for the machine you are operating, but also for remote devices which may suffer interference from APs closest to them.
WifiScanner.png
WifiScanner.png (60.5 KiB) Viewed 5784 times
This example also demonstrates how to implement a Timer in a CLI, and uses a couple of Pipes.

To view/edit the script WifiScanner.gbs just open in a text editor.

To run the script, set permissions to execute, and then open a terminal at the scripts directory and type:-

Code: Select all

sudo ./WifiScanner.gbs
If necessary, make the terminal window large enough to fully display all APs.
WifiScanner.gbs.zip
(1.7 KiB) Downloaded 470 times
User avatar
cogier
Site Admin
Posts: 1118
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: WifiScanner

Post by cogier »

Hi Steve,

I tried testing this at work but realised that my computer only had wired Ethernet - Doh!

Works like a charm but just wondered why there is a difference in signal strength readings? My laptop is less than 50mm away from my Asus RTN66U router when this image was taken. Cinnamon says 100% which seems about right.

Image
User avatar
stevedee
Posts: 518
Joined: Monday 20th March 2017 6:06pm

Re: WifiScanner

Post by stevedee »

cogier wrote: Sunday 29th December 2019 12:08pm ...Cinnamon says 100% which seems about right...
Yes, you are right. I'd forgotten about this.

When I first wrote this program 10 years ago, I seemed to have a variety of wifi drivers that evaluated & expressed Quality in different ways. As Quality is mainly concerned with data packet corruption, the result is a kind of figure-of-merit.

On your system, if you run in terminal:-
iwconfig

you will probably see in the output something like this:-

Link Quality=70/70

So maybe my code should be re-written to calculate a percentage based upon this fraction, or simply display the fraction. But before I do that, I will retest as many of my laptops & USB wifi dongles as I can to see if they all now present Quality the same consistent way. The other issue with this is that you will never get a 0% figure because you must get some kind of readability to establish that you have found a readable Access Point.

However this figure is presented, it does at least rate Access Points correctly (i.e. the better the quality, the higher the figure) ...although that sounds like a feeble defence of my code.

I think there is a similar problem with signal Strength, in that it can be presented differently by different wifi drivers. Although Strength has a use, it is not as useful as Quality. More on that in the next wifi project I'll post when time permits.


Oh, and I have a question for you. Are you the only person on Guernsey that has wifi?
I've never seen this program only report just 1 access point. I usually see a list with between 8-20 access points. Maybe you live on a ranch!
User avatar
cogier
Site Admin
Posts: 1118
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: WifiScanner

Post by cogier »

Oh, and I have a question for you. Are you the only person on Guernsey that has wifi?
I've never seen this program only report just 1 access point. I usually see a list with between 8-20 access points. Maybe you live on a ranch!
No there is lots of WiFi here. It's just that the castle is so far from my neighbours. :lol:
Post Reply