getting WPA to work

Anything regarding the Operating System itself: accounts, boot, desktop, control panel, system utilities and file explorer

getting WPA to work

Postby ripper » Wed Aug 19, 2009 2:44 pm

*****EDIT ... THIS DOES NOT WORK IN OS REVISION B *********

type the following into a console:
Code: Select all
sudo -s
ifconfig ra0 down
ifconfig ra0 up
iwconfig ra0 essid “ESSID_IN_QUOTES”
iwpriv ra0 set AuthMode=WPAPSK
iwpriv ra0 set EncrypType=TKIP
iwpriv ra0 set WPAPSK=”YOUR_WPA_PSK_KEY”
dhcpcd ra0

to get your WPA PSK KEY for the above command
Code: Select all
wpa_passphrase YOUR_ESSID

after you run the above it will prompt you to type in your password for the WPA

This is a quick fix untill they add WPA to thier network GUI. I will write up a little script later today and post it here for people to use. But all and all, WPA is working fine for me.

Ripper
Last edited by ripper on Mon Aug 31, 2009 12:13 am, edited 1 time in total.
ripper
 
Posts: 50
Joined: Tue Aug 11, 2009 12:41 pm

Re: getting WPA to work

Postby SteveNYC » Wed Aug 19, 2009 7:30 pm

Thanks. I know this is beta software, but I'm a little surprised that it's *this* beta. Your solution worked. Too bad it has to be done every single time the computer is restarted. But I've already received an email from AI stating that they intend to have a new image up shortly. My expectation is that it is designed to address this issue. At least, I certainly HOPE it will permanently address this issue.
SteveNYC
 
Posts: 1
Joined: Wed Aug 19, 2009 7:26 pm

Re: getting WPA to work

Postby ripper » Wed Aug 19, 2009 9:16 pm

Here is the dirty little script I have been using for WPA. To use it create a file named WPA_wifi.sh
Code: Select all
touch WPA_wifi.sh

Change the permissions
Code: Select all
chmod 755 WPA_wifi.sh

open wifi.sh with your favorite editor
Code: Select all
vi WPA_wifi.sh

cut and paste the following code into the file and save
Code: Select all
#!/bin/sh                                                                       
if [ $1 == "start" ]                                                           
then                                                                           
        psk=`echo $3 | wpa_passphrase $2 |grep '\spsk='|cut -b 6-69`           
        rmmod rt3070sta                                                         
        modprobe rt3070sta                                                     
        ifconfig ra0 up                                                         
        iwconfig ra0 essid $2                                                   
        iwpriv ra0 set AuthMode=WPAPSK                                         
        iwpriv ra0 set EncrypType=TKIP                                         
        iwpriv ra0 set WPAPSK=$psk                                             
        dhcpcd ra0                                                             
elif [ $1 == "stop" ]                                                           
then                                                                           
        killall dhcpcd                                                         
else                                                                           
        echo "USEAGE FOR WPA_WIFI.SH"                                           
        echo "#### To start your connection: ####"                             
        echo "./WPA_wifi.sh start YOUR_AP_NAME YOUR_AP_PASSWORD"               
        echo "#### To stop your connection: ####"                               
        echo "./WPA_wifi.sh stop"                                               
fi                         

to use it change to root
Code: Select all
sudo -s

then run it with your access points name and your WPA password in plane text
Code: Select all
./WPA_wifi.sh start AP_NAME WPA_PASSWORD

There is still a problem with the shutdown command of this script. So you must restart your computer to connect to a new access point at the moment. If I get around to figuring it out I'll edit this post and script. I need to figure out why it gives the error "SIOCSIFFLAGS operation not permitted" when you disconnect and then try to reconnect again. But anyways, it works for now and connects you to WPA
ripper
 
Posts: 50
Joined: Tue Aug 11, 2009 12:41 pm

Re: getting WPA to work

Postby GregoireGentil » Wed Aug 19, 2009 10:12 pm

Great tips! Many thanks. If you want to help one step beyond, you can try to patch /usr/bin/ai/networking/network_base.py. There is some WPA code there but it was not working and we didn't have time to fix it.
GregoireGentil
Site Admin
 
Posts: 114
Joined: Sun Jul 12, 2009 5:20 pm

Re: getting WPA to work

Postby ripper » Wed Aug 19, 2009 10:15 pm

lol good to hear from you ... Ill take a look at it tomorrow, I'm one too many pints down for the night.
ripper
 
Posts: 50
Joined: Tue Aug 11, 2009 12:41 pm

Re: getting WPA to work

Postby ripper » Thu Aug 20, 2009 2:43 pm

As I suspected, the problem with bringing the connection down and then back up again had to do with the version of dhcpcd installed on the touchbook. After installing dhcp-client instead everything works fine. I can connect to as many access points as I like without rebooting. Ill repost how to install this and the edited script later today. Also If I get time Ill see if I can edit the AI GUI to work along with this.
ripper
 
Posts: 50
Joined: Tue Aug 11, 2009 12:41 pm

Re: getting WPA to work

Postby ripper » Thu Aug 20, 2009 2:56 pm

To make this work without having to reboot after the end of each connection do the following:

change to root
Code: Select all
sudo -s

update ipkg
Code: Select all
ipkg update

install dhcp-client
Code: Select all
ipkg install dhcp-client

create a new script file
Code: Select all
touch WPA_wifi.sh

make it executable
Code: Select all
chmod 700 WPA_wifi.sh

open your favorite editor
Code: Select all
vi WPA_wifi.sh

copy the following into the script
Code: Select all
#!/bin/sh
if [ $1 == "start" ]
then
        psk=`echo $3 | wpa_passphrase $2 |grep '\spsk='|cut -b 6-69`
        rmmod rt3070sta
        modprobe rt3070sta
        ifconfig ra0 up
        iwconfig ra0 essid $2
        iwpriv ra0 set AuthMode=WPAPSK
        iwpriv ra0 set EncrypType=TKIP
        iwpriv ra0 set WPAPSK=$psk
        dhclient ra0
elif [ $1 == "stop" ]
then
        dhclient -r ra0
else
        echo "USEAGE FOR WPA_WIFI.SH"
        echo "#### To start your connection: ####"
        echo "./wpa_wifi.sh start YOUR_AP_NAME YOUR_AP_PASSWORD"
        echo "#### To stop your connection: ####"
        echo "./wpa_wifi.sh stop"
fi

Now, If you are currently connected with my old script you must restart one last time.
Now in order to run the script make sure you are root if not already
Code: Select all
sudo -s

To connect to a network type the following
Code: Select all
./WPA_wifi start YOUR_AP_NAME YOUR_CLEARTXT_WPA_PASSWORD

To disconnect type the following
Code: Select all
./WPA_wifi stop


Hope this helps. Ill try to get around to editing the operating systems network GUI for next time.

** EDITED ... I had a typo in the stop portion of this script***
Last edited by ripper on Thu Aug 20, 2009 6:40 pm, edited 1 time in total.
ripper
 
Posts: 50
Joined: Tue Aug 11, 2009 12:41 pm

Re: getting WPA to work

Postby hyc » Thu Aug 20, 2009 2:59 pm

Nice work. Too bad this RT3070 driver only supports WPA-PSK, I'm using WPA-EAP so it looks like I'm going to be offline for a long time. I'd like to try to rt2x00 driver from the wireless-testing branch but I need the specific kernel header tree to be able to build that.
hyc
 
Posts: 117
Joined: Thu Aug 20, 2009 2:50 pm

Re: getting WPA to work

Postby GregoireGentil » Sat Aug 22, 2009 12:41 pm

Kernel is published as well the rt3070 we are using. You are free to do any investigation you want! Read http://www.alwaysinnovating.com/wiki/index.php/Kernel.
GregoireGentil
Site Admin
 
Posts: 114
Joined: Sun Jul 12, 2009 5:20 pm

Re: getting WPA to work

Postby GregoireGentil » Sat Aug 22, 2009 12:43 pm

We would love to see some patches for /usr/bin/ai/networking/network_base.py at least to support WPA-PSK. WPA-EAP will be much more complex.
GregoireGentil
Site Admin
 
Posts: 114
Joined: Sun Jul 12, 2009 5:20 pm

Next

Return to Core

Who is online

Users browsing this forum: No registered users and 3 guests

cron