You are not logged in.

#1 2012-03-05 02:59:38

Jonhoo
Member
Registered: 2009-05-23
Posts: 118

wifi.pl - Scan for and connect to wireless networks with netcfg

Connecting to wireless networks is a bit of a hassle at the moment with netcfg.
First, you have to run iwlist scan, then analyze its output, copy one of the /etc/network.d/examples/wireless-* files into /etc/network.d and then modify it to fit your connection.
This becomes cumbersome when you've done it a couple of times, so I've written a fairly simple Perl script that does all the heavy lifting for you.
It even shows a pretty list of all available networks, with signal level and authentication type.
No dependencies apart from perl and iwlist (and netcfg to do the connecting).

See the source at https://github.com/Jonhoo/netcfg-wifi-scan
It still needs some testing and probably some interface love.

Feedback is greatly appreciated!
Cheers,
Jon

Last edited by Jonhoo (2012-04-09 15:09:57)

Offline

#2 2012-03-05 13:22:01

Onyros
Member
From: Lisbon, Portugal
Registered: 2007-10-11
Posts: 307

Re: wifi.pl - Scan for and connect to wireless networks with netcfg

Gave it a try, I like it! Works as advertised. Particularly useful when you use with the option to edit the profile after the script has filled things in.

Though I do like the system you created for displaying signal strength - [+] over 80%, [=] between 80 and 30% and [-] for less than 30% - I do think that displaying the percentage could be a good option to have, too.

Nice work, Jon. It'll be useful for me, will save me some time whenever I have to connect somewhere new smile

Offline

#3 2012-03-05 17:05:27

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: wifi.pl - Scan for and connect to wireless networks with netcfg

Sounds like wifi-select...perhaps some collaboration?

Scott

Offline

#4 2012-03-05 19:27:09

el mariachi
Member
Registered: 2007-11-30
Posts: 595

Re: wifi.pl - Scan for and connect to wireless networks with netcfg

And wic...

Offline

#5 2012-03-06 01:34:13

Jonhoo
Member
Registered: 2009-05-23
Posts: 118

Re: wifi.pl - Scan for and connect to wireless networks with netcfg

I've never seen those before, but they do seem to do much of the same thing. The biggest difference is that they aim to manage wireless networks, whereas mine only aims to simplify first time connects. Connecting to the networks is the job of netcfg-wireless-auto and other such daemons. This allows me to simplify the code quite a bit. I also believe the code is quite a lot more readable since it is all written in pretty straightforward Perl.

@Onyros Displaying the percentage as well might be a good idea, I'll look into it next time I've got some spare time.

Offline

#6 2012-03-06 01:39:18

Earnestly
Member
Registered: 2011-08-18
Posts: 805

Re: wifi.pl - Scan for and connect to wireless networks with netcfg

...straightforward Perl...
Heh. big_smile

Offline

#7 2012-03-06 01:48:41

Jonhoo
Member
Registered: 2009-05-23
Posts: 118

Re: wifi.pl - Scan for and connect to wireless networks with netcfg

I'd say I've used quite straightforward Perl. If you look around the web you can find a lot worst. Most of it doesn't even look like the same language... tongue

Offline

#8 2012-03-06 06:33:58

Jonhoo
Member
Registered: 2009-05-23
Posts: 118

Re: wifi.pl - Scan for and connect to wireless networks with netcfg

@Onyro: Percentage is now printed smile

Offline

#9 2012-03-06 13:26:42

Earnestly
Member
Registered: 2011-08-18
Posts: 805

Re: wifi.pl - Scan for and connect to wireless networks with netcfg

Jonhoo wrote:

I'd say I've used quite straightforward Perl. If you look around the web you can find a lot worst. Most of it doesn't even look like the same language... tongue

Haha, no worries.
I guess that's why they use Perl for code obfuscation contests.

Offline

#10 2012-03-06 22:38:27

Onyros
Member
From: Lisbon, Portugal
Registered: 2007-10-11
Posts: 307

Re: wifi.pl - Scan for and connect to wireless networks with netcfg

Jonhoo wrote:

@Onyro: Percentage is now printed smile

Perfect smile As I said before, useful for me, too, so... thanks!

Offline

Board footer

Powered by FluxBB