Users online right now: 91 - Login  » search  » forum index  

step by step wpa_supplicant wireless tutorial

jayflood
wrote 3 years ago


reply
I have created a package and script that automatically does this all for you. see this thread:

http://www.slax.org/forum.php?action=view&parentID=47476

If it doesn't work for you, or you just want to learn the process step by step ... here it is.

I used a computer with an internet connection to download all the required modules and source code. Bold sections are code you type into the konsole.

Firstly here is my system info

Acer TM 4220 with Intel wireless 3945abg

# uname -m
i686
# uname -r
2.6.27.27

----------------------------------
This part done on working internet
----------------------------------
Download these modules and put on a blank USB stick

# cairomm-1.4.8-i486-1-sbo.lzm
# gtkmm-2.12.5-i486-1-sbo.lzm
# wpa_supplicant-0.6.9.tar.gz*
# devel-2008.lzm
# jack-audio-connection-kit-0.109.2.lzm
# glibmm-2.14.2-i486-1-sbo.lzm
# libsigc-2.0.18-i486-1-sbo.lzm*

Download the wpa_supplicant source code and add to USB stick with dev module

http://hostap.epitest.fi/releases/wpa_supplicant-0.6.9.tar.gz

----------------------------------
This part done on no internet slax machine
----------------------------------

Copy the files you just downloaded onto the machine running slax that you want to use wireless on.

First create a folder to work in.
# mkdir /root/temp

Copy the module and source code to the working folder. (replace sda1 for your USB device)
# cp /mnt/sda1/* /root/temp

change to the temp folder
# cd /root/temp

Activate all the modules. You can just double click on them all if you like, or enter some cool command that activates them all together.
# activate devel* etc ....

Unpack the tar file source code
# tar xvf wpa_supp*

Change to the unpacked directory
# cd wpa_supp*

List whats in the directory
# ls
Chould show the following
COPYING* README* patches/ src/ wpa_supplicant/

Change to wpa_supplicant directory
# cd wpa_supplicant

At this stage it is a good idea to read the README file. Thats how i was able to continue
#cat README

The configure-for-slax command does not run because of the lack of a config file. The file called defconfig is a default config file and inside it you can read that support for ASCII characters is intact. They havn't disabled it.

Rename the defconfig file
# mv defconfig .config

Use the autoconf
# autoconf .config

Make
# make

Create a folder and install to the created folder
# make install DESTDIR=tmp/

Create your module from the newly created folder and give the module a name (whatever you like as long as it ends in .lzm)
# dir2lzm tmp/ wpa_supplicant-1.0-jay-i686.lzm NB:note space between tmp/ wpa_supp

Copy your newly created module to the desktop (or put it in your slax/modules folder)
# cp wpa_supplicant-1.0-jay-i686.lzm /root/Desktop/

Clean up by going back 2 folders and removing the entire wpa_supp folder recursively
# cd ../../
# rm -r wpa_supplicant-0.6.9


Now you need to create your wpa_supplicant.conf file
# kwrite /etc/wpa_supplicant.conf

Add the following info to the file, save it, close it. Edit the bold parts to suit your situation.

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
eapol_version=1
#ap_scan=0
#fast_reauth=1
network={
ssid=yourSSIDhere
key_mgmt=WPA-PSK
proto=WPA
pairwise=TKIP
group=TKIP
psk=yourWPAkeyHere
}


---------------------------
FINAL STEP
---------------------------
Open a konsole and enter this
#wpa_supplicant -d -iwlan0 -c/etc/wpa_supplicant.conf -Dwext

Now open up another konsole and enter
# dhcpcd -nd wlan0

You should be able to browse the internet now. If things go belly up then simply delete this file. It can happen when a session is terminated prematurely.

#/var/run/wpa_supplicant/wlan0*
go back to FINAL STEP

You may prefer to use wlassistant to get yourself an address instead of the konsole .

Don't close the original konsole window or you will lose your connection. I made a few scripts that make it easier, and you just have to open a konsole and type: wifi.sh

If you want those let me know and i will send em.
 
klang
wrote 3 years ago


reply
remember a

activate wpa_supplicant-1.0-jay-i686.lzm

somewhere

(also missing from the install script)

As I have a different wifi card; AR5212 (ibm a/b/g, thinkpad x40) .. ok, retracing. Thanks for all your work and persistence, though!
 
jayflood
wrote 3 years ago


reply
Thanks, will edit this when i get time. Of course once the module is in the modules folder this is not required.
The script also assumes that you have drivers for your card already sorted. Is this the case with you klang?
 
klang
wrote 3 years ago


reply
That is probably not the case with me and that was one of the first preconditions you stated :-)
 
jayflood
wrote 3 years ago


reply
OK so check whether your driver gets loaded with slax.

$ lsmod |grep ath

If you get no answer then try to load it.

$ modprobe ath5k

Try the first command again to verify and iwconfig should show your details. Then run the script.
 
klang
wrote 3 years ago


reply
Realizing that the name of my wlan0 connection was not wifi0 (though this is interface is in the list reported by ifconfig) and simply selecting the correct name (ath0 as reported by iwconfig) helped a lot.

I simply did a

cd /usr/bin
perl -p -i -e 's|wifi0|ath0|' wifi.sh resetwifi.sh resetdhcp.sh dhcp.sh


Of course, this could have been done in wpa-install.sh initially (I did, but selected the wrong interface)

Your last post here saved me a lot of time, as I was connected 5 minutes after reading it.

So, in summary, Running Slax off a pendrive on an IBM X40 with the original AR5212 wifi card works!

I am a happy camper! :-)
 
jayflood
wrote 3 years ago


reply
Good stuff. Glad you're up and running.
 
mzbaig
wrote 3 years ago


reply
Hi,

I am absolutely novice and using Tenda W311U wifi usb adapter. It works in XP and Windows7. I have followed your step by step script, I am not clear as to when and where to load Tenda drivers. I think that is the reason Slax is not detecting wifi adapter. How to I do that ?

I am running Slax on old COMPAQ Evo N410c machine. Thanks for your help.
 
jayflood
wrote 3 years ago


reply
I can't find any linuix drivers for this device. Can you please find out the chipset that the Tenda W311U uses ... most probably a ralink RT2870 chipset. After finding this the next step would be to find and compile the correct drivers for it.

http://www.ralinktech.com/support.php?s=2

Can you please plug the device in and post the output from:

lspci
lsusb
dmesg
cat /var/log/messages
 
Bill Gayds
wrote 3 years ago


reply
i think theres an important detail missing in your wpa_supplicant.conf:

psk=yourWPAkeyHere

should be

psk=$(wpa_passprase yourWPAkeyHere)
(get the output of "wpa_passprase yourWPAkeyHere" from the commandline and put it after the equal-sign)

btw.
http://www.slax.org/modules/559/dl/wpa-supplicant-0.5.10.lzm
the 0.5.10 works fine for me using WPA2, no need for 0.6.9
 
Bill Gayds
wrote 3 years ago


reply
sorry, i ment:

psk=$(wpa_passprase yourSSIDhere yourWPAkeyHere)

get the output of "wpa_passprase yourSSIDhere yourWPAkeyHere | grep psk=[a-f,0-9]" from the commandline and put it into the config file
 
jayflood
wrote 3 years ago


reply
Bill you mean the instructions are wrong? I just use the script and havn't looked back at this thread for a long time.
 
Bill Gayds
wrote 3 years ago


reply
jayflood wrote:
Bill you mean the instructions are wrong? I just use the script and havn't looked back at this thread for a long time.


@jayflood
no not really,
"wpa_passphrase" returns a 32Byte Hex-String that works with "wpa-supplicant-0.5.10"
and some older versions, maybe "wpa_supplicant-0.6.9" also accepts it as plain-text,
but however its an easier solution then compiling wpa_supplicant and it also provides
some protection of the passphrase
 
jayflood
wrote 3 years ago


reply
OK i see. A much more elegant way of creating the config file. Thanks.
 
Bill Gayds
wrote 3 years ago


reply
jayflood wrote:
Bill you mean the instructions are wrong? I just use the script and havn't looked back at this thread for a long time.


may also be that "wpa_passphrase" is just required for WPA2

network={
ssid=yourSSIDhere
key_mgmt=WPA-PSK
proto=WPA2
pairwise=CCMP
group=CCMP
psk=***
}

***get the output of "wpa_passphrase yourSSIDhere yourWPAkeyHere | grep psk=[a-f,0-9]" from the commandline and put it into the config file
 
fanthom
wrote 3 years ago


reply
from my experience i can say that wpa_supplicant-0.7.1 requires password stored in quotes "" . Otherwise it didn't work for me.
Could anybody confirm this?
 
Le_Youj
wrote 2 years ago


reply
Hi every body...
I try and i try to connect my Slax (on HDD) to my WPA2-PSK protected wifi.
I finaly find a simple way...
if Wifiyouj is the SSID and PassYouj is the pass phrase
I install wpasupplicant and wlassistant (last version)
I open a terminal and type:

root@slax:~# wpa_passphrase WifiYouj PassYouj >> /etc/wpa_supplicant.conf
root@slax:~# wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -d &
root@slax:~# dhcpcd Wlan0

a tool box tell me "connected to WifiYouj"
I close the terminal
thanks for all great help
BelgianYouj
 
vincentzpf
wrote 2 years ago


reply
thanks a lot
 
Bicephale
wrote 2 years ago


reply
Ouch, look at that CLI magic spell!... I don't remember
my own phone number, i guess i'll have to pass playing
with WiFi: i tought it might be fun but not anymore...

A router will work as a self-managed acces point, right?
 
Bicephale
wrote 2 years ago


reply
It seems this one is for you:

A router will work as a self-managed acces point, right?

Honestly, i'm looking forward for WiFi use under 'Slax',
euh... But not like this!...
 
Vince @ MagicGPS
wrote 1 year ago


reply
Hi,
We are looking for some help to make a few changes to WPA Supplicant. Just need to find out how to break out when it keeps trying to connect after an AP is out of range. Would you or anyone you know or any place to find suggest answers?

I want to Thank you in advance for any help here!

vince@MagicGPS.com
 
jayflood
wrote 1 year ago


reply
killall dhcpcd
killall wpa_supplicant
rm -r /var/run/wpa_supplicant/wlan0*
rm /etc/dhcpc/dhcpcd-wlan0.pid
wpa_supplicant -c /etc/wpa_supplicant.conf -iwlan0 -Dwext &
sleep 1
dhcpcd wlan0
 

  » search  » forum index  

Post your reply

Your name (Login):

Message:

These HTML tags are allowed: <quote>, <b>, <u>, <i>, <pre>, <code>, <small>, <h1>, <h2>, <h3>, <li>



Slax is generously supported by: P&P Software GmbH and wisol technologie GmbH