x
This website is using cookies. We use cookies to ensure that we give you the best experience on our website. More info. That's Fine
HPC:Factor Logo 
 
Latest Forum Activity

Jornada 720 Linux WPA Write-up v1

weblacky Page Icon Posted 2006-07-09 7:19 PM
#
Avatar image of weblacky
Factorite (Senior)

Posts:
91
Location:
Seattle
Status:
Hi All,
Sorry for now being around….I just got a 40 hour/week job and it does not leave too much time :-) I expect that there will be revisions and comments. I'll see about have a running copy...

Please note that in the instructions for kernel recompilation I refer you to my .config file please use the attached config file on this post (look at very the very bottom of the post).

In regards to WPA I have confirmed that debian has back-tracked with wpasupplicant so it will be different to load but not too bad. They had it in a service before (however the service would have to be restarted if the device wasn’t present (then became present) or was reinserted. So I guess they just figured it was not worth it and went back to the old way…

The basics are as follows:

For prism-based cards:

Use the hostap driver (Found here), this driver support prism 1, 2, 2.5, 3 cards and is made by the same person that makes WPA_supplicant. I use a Linksys WPC11 v3 and a couple of Seano cards with this driver.

To build the driver you will need a cross compilation environment (which I haven’t yet had to time to research in detail but prior posts between myself and others on the “720degrees Linux for the Jornada 720 “ thread will get you to where I am in regards to setting up an arm gcc)

The kernel…do you need a new one?

(If you have not compiled your own kernel yet you may need to (unless you have the configured headers and they support wlan for your current kernel image then you still need the compiler but point the make toward your headers just that same) to recompile the kernel you need to do these things:

You need the kernel patch from the j720 kernel archive: http://wwwcip.informatik.uni-erlangen.de/~simigern/jornada-7xx/ <the most recent one>

Get the exact kernel version source from kernel.org and apply the patch.

Either copy my config file and do a “make oldconfig” or copy my config file and then do a make xconfig (or make menuconfig) and alter settings based on my file (believe me you don’t want to go through the entire kernel without a base file in place because you may miss many more options)

make ARCH=arm CROSS_COMPILE="arm-linux-" menuconfig

make ARCH=arm CROSS_COMPILE="arm-linux-" zImage

make ARCH=arm CROSS_COMPILE="arm-linux-" modules


#this will install to /lib/modules/<exact_kernel_version>
make ARCH=arm CROSS_COMPILE="arm-linux-" modules_install

Also just for coolness/convenience you might want to mount your wince boot partition under /boot on your j720…suggestion…not required :-)

Copy the <kernel_source>/arch/i386/boot/bzImage to your CF card (name it something like vmlinuz24)
And do a mkinitrd –o <wince boot CF partition>initrd24.img <exact_kernel_version>

Also DO NOT forget to copy up your /lib/modules/<exact_kernel_version> and put it on you Linux CF partition under the exact same place! Else your kernel will not have ANY modules! :-)

Ok now you have a kernel…try booting the j720 and make sure you actually get a prompt :-) took me about 5 times before I found out how to get a booting kernel on my j720 :-)

WPA support? Yes, please!!!

You will need wireless-tools so before anything do “apt-get install wireless-tools

The pcmcia suspend does not work because the rapid events don't give the driver enough time. So deactivate the pcmcia suspend with:

echo disable > /proc/j720_hacks/pcmcia

(I tried the boot arguments version of this and my keyboard froze instantly upon boot up so use the above command) Use the power-off commands to shutdown the card without ejecting it or unloading the driver (but you can eject if want to remove the card)

Ok in order to get WPA support on your prism-based card you need two things: the full HOSTAP driver (which ONLY works with Prism based cards) and WPA_SUPPLICANT (apt-get install wpasupplicant). WPASUPPLICANT loads the hostap_crypt_* drivers on demand so you
do not need to load them manually (but I do anyway by putting them in my /etc/modules and then doing an update-modules. However if you are not using wpa_supplicant and need wep then you MIGHT need load the hostap_crypt_wep module for the hostap driver..again I always use WPA supplicant unless I’m doing no encryption...then I just use iwconfig.

In order to compile hostap you need to have a cross-compiler setup.

Compile your kernel as normal (or at least have accurate headers for your kernel to compile against).

Download the stable host-driver and untar it.

Inside the host-driver directory do a (where “arm-linux-“ is the prefix to your arm compiler…change as needed)

make ARCH=arm CROSS_COMPILE=”arm-linux-“ KERNEL_PATH=<path to kernel source,
include files>


**I do not think the PREFIX path variable works in this make file so it will install
to the /lib/modules/ for the kernel version in the KERNEL_PATH**

make ARCH=arm CROSS_COMPILE=”arm-linux-“ KENEL_PATH=<path to kernel source> install

now the modules will be in your /lib/modules/<kernel version>

make sure you copy the new /lib/modules/ to your jornada Linux CF partition

you also need to find the hostap.conf file in the hostap-driver directory and
put it in the /etc/pcmcia/ in the jornada Linux CF partition (you should just have to restart the pcmcia services but I found I had to reboot to get them to do their job)


For non-prism based cards (not tested, I only own prism cards):

If your card already works with 720Degree (i.e. you can use WEP) then all you SHOULD need is wpasupplicant. I am not totally sure as I always load the hostap_crypt_ccmp/wep/tkip modules to support encryption but those come with the hostap driver. Since you don’t use the hostap system I assume the modules aren’t needed.

So that means you get your drivers another way (or they already are in the kernel image) either way I cannot offer any more advice at this stage…continue to WPA_Supplicant…


WPA_SUPPLICANT

The debian package may not include the wpa_supplicant.conf (but when I did an upgrade it turned up) so be aware about that. Go and download the wpasupplicant source to get a .conf file if you don’t get one. Debian also recently changed the way wpa_supplicant is
started, I’ll cover both!

When I last installed wpa_supplicant from debian these instructions worked. Read 4 lines down to see if you get this wpa_supplicant implementation in debian…if not go to next heading

Either way you will be doing this! -> apt-get install wpasupplicant

Read the wpa_supplicant documentation for info on how to define your network options/profiles in /etc/wpa_supplicant.conf

For the wpa_supplicant as a service (if you find you have a file in /etc/init.d/ named wpasupplicant then you do this!!! If not do the next section named “WPA_SUPPLICANT the old way “instead):

go to /etc/default/wpasupplicant. This file controls the startup and will
be the service you start when you want WPA. The basics of the command (options)
should look like this:

#for people who are using HOSTAP drivers do this!
-D hostap -i wlan0 -c /etc/wpa_supplicant.conf -w

#for people NOT using hostap drivers do this!
-D wext –i eth0 –c /etc/wpa_supplicant.conf -w

Then to start simply say:

invoke-rc.d wpasupplicant start


(your led should blink on your card and then go solid once a connection occurs). if your LED keeps blinking then you are not connected and need to run WPASUPPLICANT in debug mode to see what errors are in your network profile. After that just get an IP (pump doesn't work on my PDA but dhclient works fine). If during the dhcp request your NIC LED starts blinking it means the request caused it to disassociate, stop the dhclient, and try it again once your led goes solid.


To stop the network (do NOT remove the card because in my experience the slot is finicky on re-insertions of any card (pcmcia software issues in the kernel not hardware problems):

/etc/init.d/wpasupplicant stop

You may then eject the card USING THE COMMAND “cardctl eject 0”
Now remove your card :-)


WPA_SUPPLICANT the old way (which I guess is now the current debian way).
If you have not already:
apt-get install wpasupplicant

Now you will need to run the wpa_supplicant directly as a userland application. Normally I run it with output info to see what is going on and simply run it an another terminal. However wpa_supplicant has several background options. I’ll show you the command to start it in the foreground (will take control of the terminal) and the background, which will not take control but it becomes invisible so you can’t see anything!

Foreground command (to watch AP detection and authentication):

wpa_supplicant –D hostap –i wlan0 –c /etc/wpa_supplicant.conf


To background that start it like this:

wpa_supplicant –B –D hostap –i wlan0 –c /etc/wpa_supplicant.conf

To more data put in –k option (add more k’s behind the first k i.e. –kk to see more output).

Scripts
For my home I actually run a script (because I connect/disconnect a lot):

#to connect

iwconfig wlan0 auto #turn hardware back on

ifconfig wlan0 up #bring the wlan interface up

/etc/init.d/wpasupplicant start
#start wpasupplicant

#to disconnect

#turns off the radio on the pcmcia card but be aware that I have
#found the drive brings the power back in about 1 minute…so
#not good permanent solution. I need a solution that REALLY
#disables the wifi radio so we can leave the card in but not
#have it powered.
iwconfig wlan0 txpower off

ifconfig wlan0 down #turns off interface

/etc/init.d/wpasupplicant stop #stops wpasupplicant


To scan for networks:

wpa_supplicant can be running or not...as far as I have tested it should work
OK.

(if wpa_supplicant is turned off you'll need to do "ifconfig wlan0 up" before
you can scan)

iwlist wlan0 scan

Then you get a list of APs, you might want to “| more” it.


Comments
I recommend that people start posting their results in this thread. We all help each other sharing information (not hording it). To that end I'll try to keep things up here and I'd like to see others either confirming these instructions, posting their issues (please not issues about how to define a network profile in wpa_supplicant...that's on the site and it even comes with simple samples. We need this to be for Linux issues...

Please feel free to email me if you have other tricks, found quirks in your card or driver that do cool or not-so-cool things. Please note that I don't have any additional GUI stuff that what ever body else has. I'm hoping that some cool person gets GPE up so we can start writing little taskbar applets to do some of this stuff.

Hope to hear positive results :-)

-Weblacky

Edited by C:Amie
 Top of the page
sophisticatedleaf Page Icon Posted 2006-07-09 7:54 PM
#
Avatar image of sophisticatedleaf
H/PC Elder

Posts:
2,294
Location:
Sunny California
Status:
Bravo! That is impressive!

EDIT: Oh, I hope you know that you pasted that twice...please edit and remove that so it will not be twice as long. Also, you can already make standard windowmaker-compatible applets for the 720, and it will work in all the standards-compliant window managers. That is how shadowmaster made battlet.

Edited by ProgramSynthesiser 2006-07-09 7:58 PM
 Top of the page
weblacky Page Icon Posted 2006-07-09 7:57 PM
#
Avatar image of weblacky
Factorite (Senior)

Posts:
91
Location:
Seattle
Status:
Thanks, I actually work as a Technical Writer (one of my recent, shiny degrees :-)

Hopefully it shows,

-Weblacky

Edited by weblacky 2006-07-09 7:57 PM
 Top of the page
weblacky Page Icon Posted 2006-07-09 11:20 PM
#
Avatar image of weblacky
Factorite (Senior)

Posts:
91
Location:
Seattle
Status:
Yeah, I have no idea how that double...paste happened...Oh well...

I don't see a way to fix it...

Could a moderator correct it?

-Weblacky

Edited by weblacky 2006-07-09 11:43 PM
 Top of the page
sophisticatedleaf Page Icon Posted 2006-07-10 5:32 PM
#
Avatar image of sophisticatedleaf
H/PC Elder

Posts:
2,294
Location:
Sunny California
Status:
C:Amie took care of the duplicate. For further changes, you need to PM him the revised copy.

Edited by ProgramSynthesiser 2006-07-10 5:34 PM
 Top of the page
ramoncio Page Icon Posted 2006-07-17 3:59 AM
#
Avatar image of ramoncio
Factorite (Junior)

Posts:
25
Status:
Very nice write-up about WPA!!
Thank you very much!!!!
I'll try soon and give you my feedback.
At the moment there's something wrong with apt, and I can't install wpasupplicant.
By the way, I have a Enterasys Roamabout and I think it uses hermes, orinoco and orinoco_cs modules.
Is this prism based? I don't think so.
 Top of the page
weblacky Page Icon Posted 2006-07-17 11:32 AM
#
Avatar image of weblacky
Factorite (Senior)

Posts:
91
Location:
Seattle
Status:
I think Enterasys use Orinocco chipsets...try the card using the non-prism-based instructions and let me know. I just upgraded my 720 with the newest apt stuff and it still worked but it removed the service /etc/init.d/ file so you have to do it the old way (manual startup).

I also have the debian apt repository in my sources.lst file. I do not have my PDA with me so I cannot tell you right now but you might not have a source for the offical debian archives? Try making sure you have a debian archive (a big one) and then it should find the arm versions of the packages. I'll see about posting my apt sources soon.

-Weblacky

Edited by weblacky 2006-07-17 11:34 AM
 Top of the page
weblacky Page Icon Posted 2006-07-18 10:30 PM
#
Avatar image of weblacky
Factorite (Senior)

Posts:
91
Location:
Seattle
Status:
Ok, here is my /etc/apt/sources.list file:


deb http://stevenwiki.homedns.org/720/apt/ testing main

deb http://stevenwiki.homedns.org/720/apt/ stable main

deb http://debian.oregonstate.edu/debian/ stable main

deb http://debian.oregonstate.edu/debian/ testing main

deb http://debian.oregonstate.edu/debian/ unstable main

deb http://security.debian.org/ stable/updates main contrib

deb http://core.eti.br/~coredump/apt/ stable main



Hope that gets you going :-)

-Weblacky
 Top of the page
sophisticatedleaf Page Icon Posted 2006-09-15 8:02 PM
#
Avatar image of sophisticatedleaf
H/PC Elder

Posts:
2,294
Location:
Sunny California
Status:
That is one heck of a sources list...

I'll work on getting this tutorial on the 720degrees domain.
 Top of the page
Jump to forum:
Seconds to generate: 0.186 - Cached queries : 67 - Executed queries : 9