Tell me more ×
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.

I have my network setting stored in /etc/wpa_supplicant.conf and my /etc/network/interfaces looks like this:

auto lo, eth0, wlan0
iface lo inet loopback
iface eth0 inet dhcp
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant.conf

To connect to the network I have to run sudo ifconfig wlan0 up followed by sudo ifup wlan0 after every boot. Not ideal as im running raspbmc

How can I get wlan0 up and connect on boot, I have tried added the commands to /etc/rc.local but that didn't work.

share|improve this question
Shouldn't wpa-conf /etc/wpa.conf be wpa-conf /etc/wpa_supplicant.conf to point to your wireless network settings? I just got WiFi working on raspbmc last night. When I get home today I'll test how my setup behaves across reboots. – HeatfanJohn Oct 15 '12 at 19:06
Opps was a typo in the question not in my settings however. /etc/network/interfaces points to the /etc/wpa_supplicant.conf – sudo_O Oct 15 '12 at 19:11
Not related to your problem, but I also suspect that iface iface lo inet loopback is also a typo, should be iface lo inet loopback. Loopback interface configuration. – HeatfanJohn Oct 16 '12 at 2:00
Damn my lack of proof reading skills – sudo_O Oct 16 '12 at 7:17

1 Answer

up vote 5 down vote accepted

I changed auto to allow-hotplug for wlan0 in my /etc/network/interfaces, see below:

pi@raspbmc:~$ cat /etc/network/interfaces
#auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

That worked for me!

I'm really not sure why this worked. The Debian documentation at this link is confusing to me because this is all new to me, however the ifquery command shown below now returns wlan0 and this command is used by /etc/init.d/networking to determine which interfaces to bring up. Previously with wlan0 as auto, ifquery --list --alow=hotplug didn't return anything.

pi@raspbmc:~$ ifquery --list --allow=hotplug
wlan0
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.