Page 1 of 1

Wireless Connection Issues

Posted: Sun Mar 10, 2013 2:56 pm
by screech1987
Hello World.

THis is my first post on these forums and unsuprisingly its about a problem I am having.

Currently I am trying to set up my raspberry pi headless with a wi-fi connection. This is connecting through my Sky Router, which is WPA2-PSK secured.

Working through the process I have sucessfully got the pi to do the following:
-Autoboot and Login to startx
-set up eth0 as a static IP and access the WWW
-Tested my wireless dongle (TP Link WN723N) wherein I sucessfully connected to the WWW using the WIFI Config Tool

However this all comes unstuck when I have tried to connect automatically to my network on boot. I have tried it with both DHPC and Static assigned IP addresses. But for now I am just trying to get the DHCP method working.

For this I have been modifying /etc/network/interfaces and /etc/wpa_supplicant/wpa_supplicant.conf only. Trying to use the supplicant method so I can set up a few wireless profiles in future.
Up to now the router and pi automatically assign an IP address, that is confirmed by both the router and ifconfig. In additon to the blue light on the dongle flashing happily. However there is no connection to the WWW and neither can I ping the pi from another device on the network.

Can anyone offer any advice or working configuration of the two files above? I have been follwoing the instructions on multitues of threads and websites to get this sorted but nothing seems to work even after /etc/init.d/network restarts and full system reboots.

currently /etc/network/interfaces is:

Code: Select all

auto lo
iface lo inet dhcp
auto eth0
iface eth0 inet static
address 192.168.0.22
netmask 255.255.255.0
gateway 192.168.0.1
auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface sky1 inet dhpc 
and /etc/wpa_supplicant/wpa_supplicant.conf is:

Code: Select all

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
ssid="SKYAB123"
psk="ABCDEFGH"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP
auth_alg=OPEN
id_str="sky1"
}
(NB: there might be unietentional typos in the above due to compying this manually from the pi)

Thanks in Advance,

Martin

Re: Wireless Connection Issues

Posted: Mon Mar 11, 2013 9:31 am
by DBryant
I'm confused because you say you're concentrating on DHCP where your interfaces file clearly shows that you're not. Also it's not useful it you can't present your files without typos, they're the very things that will stop this working!

These are my files do the job:

Code: Select all

cat /etc/network/interfaces
auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
Insert your own ssid and psk!

Code: Select all

sudo cat /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
	ssid="***yours***"
	proto=RSN
	key_mgmt=WPA-PSK
	pairwise=CCMP TKIP
	group=CCMP TKIP
	psk="***yours***"
}
This points to my router, so update the IP to match your system

Code: Select all

more /etc/resolv.conf 
domain home
search home
nameserver 192.168.1.254
And restart the network or reboot.

Hope this helps. Good luck.

Re: Wireless Connection Issues

Posted: Mon Mar 11, 2013 10:02 pm
by screech1987
Cheers!

I noticed two things about my set up:

-I had put DHPC instead of DHCP in a line on my interface (a typo which I actually "correctly" copied across to my post)

- And the omission of the auto wlan0 and auto eth0 lines seemed to get the wireless working in both static and DHPC mode.

So I think from copying multiple sources I wrongly included the auto statements.
Now I thought that just got things configured automatically during boot. However I was wrong in that assumption.

Can anyone explain to me what the function of those statements are?

Cheers,

Martin

Re: Wireless Connection Issues

Posted: Mon Mar 11, 2013 10:25 pm
by DBryant
From 'man 5 interfaces'
Lines beginning with the word "auto" are used to identify the physical
interfaces to be brought up when ifup is run with the -a option. (This
option is used by the system boot scripts.) Physical interface names
should follow the word "auto" on the same line. There can be multiple
"auto" stanzas. ifup brings the named interfaces up in the order
listed.
See http://www.unix.com/man-page/Linux/5/interfaces/

You'd probably find that physically (dis)connecting the cable and add/remove of a wireless adapter may also trigger an ifup/down call.