WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: wifi.tcz  (Read 43377 times)

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
wifi.tcz
« on: July 02, 2011, 12:54:28 AM »
Posted v0.2 of wifi.sh

* Major rewrite to Ash/Awk
* More robust detection of wireless devices.
* Better handling of slow to configure devices.
* Better integration with base functions.
* Auto mode is supported in /opt/bootlocal.sh or /opt/bootsync.sh
* Default (Menu) mode / Icon can display connection and optionally remove and re-scan/configure.
« Last Edit: July 02, 2011, 01:13:11 AM by roberts »
10+ Years Contributing to Linux Open Source Projects.

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: wifi.tcz
« Reply #1 on: July 02, 2011, 08:11:39 PM »
cool  thanks, am gonna try it right now
:)

Offline andrewb

  • Full Member
  • ***
  • Posts: 121
Re: wifi.tcz
« Reply #2 on: July 05, 2011, 08:10:54 PM »
A small bug when using wpa passwords that may contain characters that are parsed by the shell. It is explained at:
http://lists.shmoo.com/pipermail/hostap/2006-February/012731.html .

I have the same setup described in the above link with a network set up via windows, in which there aren't the same restrictions on characters as in *nix.  The WPA passphrase contains characters that are parsed by the shell when the wpa_passphrase command is executed in the wifi.sh script. I guess the solution is simple, but at the present time it's beyond my awk / bash scripting abilities.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11576
Re: wifi.tcz
« Reply #3 on: July 06, 2011, 03:23:08 AM »
Hi andrewb
If possible, your best bet is to stick to characters that are acceptable in both environments.

Offline andrewb

  • Full Member
  • ***
  • Posts: 121
Re: wifi.tcz
« Reply #4 on: July 06, 2011, 07:17:59 AM »
In an ideal world this would be good advice, but we don't live in one!! :-)

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: wifi.tcz
« Reply #5 on: July 06, 2011, 05:27:34 PM »
I will look at it for v0.3. At the moment I am busy readying Core v3.8rc1.
10+ Years Contributing to Linux Open Source Projects.

Offline andrewb

  • Full Member
  • ***
  • Posts: 121
Re: wifi.tcz
« Reply #6 on: July 07, 2011, 10:26:54 PM »
OK, one step forward: I have solved the problem for passwords with special characters. The function device_setup should be changed to :

Code: [Select]
function device_setup(t,d,s,p,c) {
  if (t == "WPA") {
    print p > "/tmp/wpa_ptmp"
    system("wpa_passphrase " s " <  /tmp/wpa_ptmp  > /etc/wpa_supplicant.conf")
    system("rm /tmp/wpa_ptmp")
    system("wpa_supplicant -i " d " -c /etc/wpa_supplicant.conf -B")
  } else {
    system("iwconfig " d " essid " s " key " p" channel " c)
  }
}

The stdin redirection is the only way to pass special characters to wpa_passphrase with out them being parsed by the shell. Putting the variable 'p' instead allows the shell to parse the password. I have tested this with many combinations of special characters, including those of significance to awk, and it seems to work every time. Even spaces, including those at the start & end of a password are acceptable.

The only problem now is that if the character used as a field separator in wifi.db is used in the password  or ESSID it will cause problems. This can be dealt with by using a non-printing character (e.g. <BEL>) as the field separator in wifi.db. To enable this the following changes need to be made:

Change the line:
Code: [Select]
   FS=":"to
Code: [Select]
   FS="\7"and:
Code: [Select]
print( sid[selection] ":" password ":" type[selection] ) >> dbfileto:
Code: [Select]
print( sid[selection] "\7" password "\7" type[selection] ) >> dbfile
Now to move on to the problems of non-broadcast SSIDs........
« Last Edit: July 08, 2011, 12:15:06 AM by andrewb »

Offline andrewb

  • Full Member
  • ***
  • Posts: 121
Re: wifi.tcz
« Reply #7 on: July 08, 2011, 06:07:19 AM »
I've now found that the above of course is for the original wifi.sh script, not the current one.

Back to the drawing board....

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: wifi.tcz
« Reply #8 on: July 08, 2011, 08:28:21 AM »
See: http://forum.tinycorelinux.net/index.php?topic=5287.0
You seem to want to commandeer my extension.
I should be afforded the same respect as any other extension maker.
10+ Years Contributing to Linux Open Source Projects.

Offline andrewb

  • Full Member
  • ***
  • Posts: 121
Re: wifi.tcz
« Reply #9 on: July 08, 2011, 10:01:36 AM »
Robert,

Sorry, no offence meant. Just got carried away.

Will put brain in gear before typing next time.




Offline nick65go

  • Hero Member
  • *****
  • Posts: 832
Re: wifi.tcz
« Reply #10 on: July 08, 2011, 11:08:11 AM »
Hi Robert,

I would like to have more columns in the scanning table results, not only essid and wpa type. It is wide space enough, and maybe more default lines, like 25 lines/page (for use on a Dell mini 910).
Maybe chanel number and access point MAC address, because my neighborhoods fake the essid as BTOpenzone or BTFON, so MAC is very useful.

for your information, those two BTOpenzone or BTFON names are FREE wifi in UK, if you (or one of your friend) have an BT or FON account for broadband in UK (BT is partner with OPenzone etc). So if you travel in Spain, for example, you can use for free any wifi spot from BTOpenzone, no need to pay for hotel/airport/caffe wifi...

Thank you.
« Last Edit: July 08, 2011, 11:12:27 AM by nick65go »

Offline netnomad

  • Hero Member
  • *****
  • Posts: 1026
Re: wifi.tcz
« Reply #11 on: July 08, 2011, 04:30:20 PM »
hello friends,

i want to report my problems with the latest wifi.tcz, although the wifi-connection with cnetworkmanager works proberly.

sudo /usr/local/etc/init.d/dbus start
sudo /usr/local/etc/init.d/NetworkManager start
sudo cnetworkmanager --connect=<access-point-essid> --wpa-pass=<wpa2-password>

when i start wifi.tcz, all access-points are scanned and listed in my terminal.
after choosing my access-point f.e. "access-point-essid", the access-point is called "Desktop" or another file that is stored in my home-directory.
then the terminal asks me for the password twice (my password-input is masked), but there is no positive result or a connection at the end.
on the other side: if i use the network-starterpack, the access-point is named correctly, the password-input is only once and unmasked, and at the very end the setup of the wifi-connection succeeds.

does anyone confirm this behaviour?
is someone able to automate the start or restart of dbus and NetworkManager, that it just works?
sometimes i have to restart them a couple of times... does anyone know reasons?
« Last Edit: July 08, 2011, 04:40:47 PM by netnomad »

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: wifi.tcz
« Reply #12 on: July 08, 2011, 05:27:06 PM »
Hi Robert,

I would like to have more columns in the scanning table results, not only essid and wpa type. It is wide space enough, and maybe more default lines, like 25 lines/page (for use on a Dell mini 910).
Maybe chanel number and access point MAC address, because my neighborhoods fake the essid as BTOpenzone or BTFON, so MAC is very useful.

for your information, those two BTOpenzone or BTFON names are FREE wifi in UK, if you (or one of your friend) have an BT or FON account for broadband in UK (BT is partner with OPenzone etc). So if you travel in Spain, for example, you can use for free any wifi spot from BTOpenzone, no need to pay for hotel/airport/caffe wifi...

Thank you.
Interesting to note. I had channel in v0.1 and was told that it is not needed.
How would you know about a MAC address? That request seems odd to me.
10+ Years Contributing to Linux Open Source Projects.

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: wifi.tcz
« Reply #13 on: July 08, 2011, 05:35:01 PM »
hello friends,

i want to report my problems with the latest wifi.tcz, although the wifi-connection with cnetworkmanager works proberly.

sudo /usr/local/etc/init.d/dbus start
sudo /usr/local/etc/init.d/NetworkManager start
sudo cnetworkmanager --connect=<access-point-essid> --wpa-pass=<wpa2-password>

when i start wifi.tcz, all access-points are scanned and listed in my terminal.
after choosing my access-point f.e. "access-point-essid", the access-point is called "Desktop" or another file that is stored in my home-directory.
then the terminal asks me for the password twice (my password-input is masked), but there is no positive result or a connection at the end.
on the other side: if i use the network-starterpack, the access-point is named correctly, the password-input is only once and unmasked, and at the very end the setup of the wifi-connection succeeds.

does anyone confirm this behaviour?
is someone able to automate the start or restart of dbus and NetworkManager, that it just works?
sometimes i have to restart them a couple of times... does anyone know reasons?

The wifi.sh is not to be used with dbus, networkmanager, or any other. It is a stand-a-lone minimal scanning and auto connect wifi tool.

You are confusing v0.1 with v0.2. Some want channel number, so do not. Some want enter clear text passwords some do not. I know that I will never please all. But note, wifi.sh is only an option. You are free to use many wifi network managers in the repository.

My goal for wifi.sh is to have the smallest wifi tool to scan and provide auto connect at boot.
Obviously it works for me and friends that helped test it.

It is still in early development. Obviously I do not have access to a wide range of hardware to test.
I will take in ideas for v0.3 and you may wish to try that when available.

Please don't feel that there is any requirement to use wifi.sh and don't mix with exiting wicd, networkmanager or others that try to do the same thing.
10+ Years Contributing to Linux Open Source Projects.

Offline netnomad

  • Hero Member
  • *****
  • Posts: 1026
Re: wifi.tcz
« Reply #14 on: July 08, 2011, 06:31:01 PM »
thank you robert for your reply.

i will love to test the future versions...
now after some commands in the terminal i get my wifi-connection, so that's ok.
you have to know, i'm a heavy tester, i'm really happy to use tinycore in different situations and configurations,
so perhaps i can give some hints!?