Page 1 of 1

Struggling with WPA connection

Posted: Sat Jun 27, 2009 12:34 pm
by parsnip
I have run out of guesses on how to get wireless working with WPA. Below is my config, in addition to below I have tried with out the ' marks, tried wpa instead of psk and tried wan instead of lan. Anybody with any guesses or help would be greatly appreciated.

Code: Select all

config wifi-device  wl0
	option type     broadcom
	option channel 1

 config wifi-iface
	 option device wl0
	 option network lan
	 option mode sta
	 option 'ssid' 'MYSSID'
	 option 'encryption' 'psk'
	 option 'key' '1234567890'

Re: Struggling with WPA connection

Posted: Sun Jun 28, 2009 7:43 am
by NelsonPJ
I just started on this project yesterday and it took me a while to figure this part out. I've got an Apple Airport Extreme (the white round "UFO shaped" model, not the newer sqaure model) that's running WPA encryption. The Airport Utility reports "WPA/WPA2 Personal" encryption. My config looks very similar to yours - so I'm not sure if it will help you. I noticed you put single quotes around some of your entries - that wasn't required for me (although I never tried it with the quotes). I also typed in my WPA password in plain alphanumeric characters, not the hex version.

config wifi-device wl0
option type broadcom
option channel 6 #that's the channel number I'm running

config wifi-iface
option device wl0
option network lan
option mode sta
option ssid Nelson #that's my SSID name
option encryption psk #this is for my Airport WPA encryption
option key MyPassword #I typed in my alphanumeric password, not the hex version

Re: Struggling with WPA connection

Posted: Mon Jun 29, 2009 4:43 am
by parsnip
Thanks NelsonPJ,

It turns out something strange is going on. If I do:

Code: Select all

iwconfig wl0 essid Myssid
/etc/init.d/network restart
.. it connects and works. However it does not allow me to ssh in for some reason. Not sure what to make of this, I guess I could put the above in a shell script and run it again, but that shouldn't be necessary. Anybody got any ideas?

Re: Struggling with WPA connection

Posted: Mon Jun 29, 2009 7:49 am
by NelsonPJ
Did you look at Part 9 yet? There's a few "odds and ends" in there, including a section to enable SSH. I haven't used SSH, so I can't tell you if it works with my setup.

Re: Struggling with WPA connection

Posted: Mon Jun 29, 2009 5:39 pm
by mightyohm
NelsonPJ is right. To get incoming ssh connections working you need to do two things:

1. set a password
2. make sure /etc/config/firewall is set up to ALLOW incoming connections on the WAN port (by default it's set to REJECT) Oh, and this means that the wifi interface should be set to wan instead of lan in your config, and the ethernet interface should be lan (with bridge commented out). These sections are shown in parts 8 and 9.

I haven't tried using the router on a WPA network, but I know it can be done. Sorry I can't help much with the settings, I do know that the single quotes are not necessary.

Re: Struggling with WPA connection

Posted: Mon Jun 29, 2009 6:05 pm
by parsnip
Thanks for the help NelsonPJ and Jeff. After finding the firewall stuff in section 9 (just a thought Jeff, maybe put that in the section about setting up networking initially in section 4) I am able to ssh to my wireless connection, but I still manually have to restart networking in order for it to work. I will try to put a startup program that waits until everything is booted and then restarts networking and starts mpd etc. That should work but in case anyone has a better solution here is what I have:

my /etc/config/wireless:

Code: Select all

config wifi-device  wl0
	option type broadcom
	option channel 1

 config wifi-iface
	 option device wl0
	 option network wan
	 option mode sta
	 option ssid Myessid
	 option encryption psk
	 option key 1234567890
And the following is fresh after a reboot:

Code: Select all

root@OpenWrt:/# iwconfig
lo        no wireless extensions.

eth0      no wireless extensions.

eth0.0    no wireless extensions.

eth0.1    no wireless extensions.

br-lan    no wireless extensions.

wl0       IEEE 802.11-DS  ESSID:""  
          Mode:Managed  Frequency:2.412 GHz  Access Point: Not-Associated   
          Bit Rate:54 Mb/s   Tx-Power:32 dBm   
          Retry min limit:7   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality:5  Signal level:0  Noise level:0
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

root@OpenWrt:/# /etc/init.d/network restart
interface not found.
udhcpc (v1.11.2) started
root@OpenWrt:/# Sending discover...
Sending discover...
Sending select for 192.168.0.110...
Lease of 192.168.0.110 obtained, lease time 604800
adding router 192.168.0.1
deleting old routes
adding dns 192.168.0.1

root@OpenWrt:/# iwconfig
lo        no wireless extensions.

eth0      no wireless extensions.

eth0.0    no wireless extensions.

eth0.1    no wireless extensions.

br-lan    no wireless extensions.

wl0       IEEE 802.11-DS  ESSID:"Myessid"  
          Mode:Managed  Frequency:2.412 GHz  Access Point: 00:17:9A:46:20:77   
          Bit Rate=54 Mb/s   Tx-Power:32 dBm   
          Retry min limit:7   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=4/5  Signal level=-59 dBm  Noise level=-92 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

root@OpenWrt:/# 
It works great if I restart the network. It is like it is ignoring the config file until I restart.

Re: Struggling with WPA connection

Posted: Tue Jun 30, 2009 8:36 am
by mightyohm
That is really strange! I dug through the comments and found this one from Crizo in response to part 8 of the tutorial. The only problem is that it looks almost identical to your config, so I don't see any issues assuming your wifi channel is set correctly. Maybe I missed something, take a look:

"Here’s my wpa2-psk config. Not much different from yours. I don’t think there’s any magic going on. It took a while to get it right, but now it just works when I power it up. I don’t think I’m using NAS or any supplicant."

Code: Select all

config wifi-device wl0
option type broadcom
option channel 6

config wifi-iface
option device wl0
option network lan
option mode sta
option ssid xxxxx
option encryption psk2
option key yyyyy

Re: Struggling with WPA connection

Posted: Thu Jul 02, 2009 9:29 am
by parsnip
Well it seems to be working with a startup script that restarts networking. Not sure what is going on but honestly not sure it is worth the trouble to figure out since I can do what I need to now.

By the way, I am trying to take a different approach to the control and display hardware, I am using a usb numeric keypad as a control (this is at least sort of working right now) and planning to try to use an old palm pilot as a display (haven't started this yet). I would like to share my final results with this community, is this forum the right place to do that?

Re: Struggling with WPA connection

Posted: Fri Jul 03, 2009 1:34 pm
by mightyohm
parsnip wrote:Well it seems to be working with a startup script that restarts networking. Not sure what is going on but honestly not sure it is worth the trouble to figure out since I can do what I need to now.

By the way, I am trying to take a different approach to the control and display hardware, I am using a usb numeric keypad as a control (this is at least sort of working right now) and planning to try to use an old palm pilot as a display (haven't started this yet). I would like to share my final results with this community, is this forum the right place to do that?
Absolutely! One of the reasons I documented my approach so well was because I was hoping other people would do something completely different, using my notes as a starting point. I would love to see other projects that take the hardware in a different direction. Please share your results here!