Take the 2-minute tour ×
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It's 100% free, no registration required.

With the great help in WLAN using Netgear WNA1000M fails - what am I doing wrong? I managed to get my wireless network working on Raspbian running on my RPi.

But - I need to manually run the wpa_supplicant command

wpa_supplicant -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf -Dwext

in order to connect to the wireless network. Once I run this command, an IP address is automatically received via DHCP and everything is fine.

It's just not working automatically when I boot.

How do I change this?

My /etc/network/interfaces file looks like this:

auto lo

iface lo inet loopback
iface eth0 inet dhcp

auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

iface default inet dhcp

Am I missing something in here?

share|improve this question

4 Answers 4

up vote 3 down vote accepted

I got it.

I had to replace wpa-roam by wpa-conf.

If anyone could explain why, I'd be happy ;-)

share|improve this answer
    
wpa-roam uses a different config file which is used for WiFi roaming. You can define sever SSID in there and if one dies it connects to the other. It also means that if you only have 1 then it will reconnect to that one if it disconnects for what ever reason. Using wpa conf you need to restart the interface manually for it to reconnect. –  ppumkin Feb 4 at 19:58

I am not sure why you needed to replace wpa-roam with wpa-conf. I have a wireless lan adapter (as I assume you do too -- wlan0 implies as much).

My setup checks for and connects to a configured network when booting. I am attaching the file below for your consideration.

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

Regards, Jeremy

share|improve this answer
    
As far as I found out so far roam does not work with DHCP, only with manual IP assignment. And this is exactly where our configurations differ. –  Golo Roden Dec 8 '12 at 8:25
    
An easier (and more straight forward configuration would be –  Jeremy Harrison Dec 21 '12 at 14:21
    
This [linux-magazine.com/Online/Blogs/Productivity-Sauce/… provides a much more straight forward configuration. –  Jeremy Harrison Dec 21 '12 at 15:13
    
@JeremyHarrison Your link appears to be broken. –  starbeamrainbowlabs Apr 8 at 14:29

I found this "outdated" tutorial on the Ubuntu forums: How To: set up wpa_supplicant roaming mode and automatically start at boot, and it works just fine. The id_str is optional, but allows you to use different /etc/network/interfaces entries with different wireless networks.

network={
ssid="MyNetwork"
#psk="text passphrase"
psk=(a huge long number here)
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
id_str="home"
}

and then match that up with a corresponding entry in /etc/network/interfaces:

# This entry is used for any wireless networks without an id_str property
iface default inet dhcp

# This is for wireless networks with an id_str="home"
iface home inet dhcp

and that will cause the wireless network to connect at boot time. My testing didn't work at first, but it turned out that my router wasn't answering the DCHPDISCOVER requests. Editing /etc/network/interfaces to look like this:

allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
wpa-debug-level 3

and then running

ifup wlan0 && tail -f /var/log/syslog

allowed me to watch the loading process and find the issue with DHCP.

share|improve this answer

As per this advice, I've installed wicd and configured my wifi connection through wicd-curses. And never looked back since.

sudo apt-get install wicd
sudo apt-get install wicd-curses

And then setup by running:

wicd-curses
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.