9

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?

4 Answers 4

8

I got it.

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

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

1
  • 2
    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.
    – Piotr Kula
    Commented Feb 4, 2014 at 19:58
2

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.

1

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
5
0

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
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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