Friday, November 16, 2012

My Raspberry Pi has gone wireless - part 2

I found more info that answers my own questions from my previous post My Raspberry Pi has gone wireless.

Related to the first question I don't really have an answer: for some reason, it doesn't work on my home network but it does at work. Not sure why. A suggestion on github was to clean the cookies but that didn't help. I'll try more stuff when I get to it.

More important is the answer to the second question. Between this Debian and this RaspberryPi forum posts, I found out that I can have more than one network configured in the /etc/wpa_supplicant.conf file. Most of the time this works fine, I get an IP using the Wifi adapter; sometimes though I need to run "sudo ifup wlan1" (even in the Debian forum post it says I shouldn't). It may be something that I did wrong or maybe my adapter is not working quite right.

In the Debian forum it says that you can use either auto or allow-hotplug for the wlan configuration so I commented out the auto line. Maybe I'll try putting it back in to see if this fixes the times when I don't get an IP.

I plan to get a second Pi some day and at that time I will buy another Wifi adapter, either this one from Adafruit or if that one is not in stock then this one from Amazon (it seems in the reviews that lots of people were able to easily make it work with their Pi's and it is pretty fast).

Just for reference, the config files on my Pi now look like:

/etc/wpa_supplicant.conf
network={
        ssid="SSID_work"
        psk=abc123
        id_str="work"
        priority=5
}

network={
        ssid="SSID_home"
        psk=abc123
        id_str="home"
        priority=10
}

network={
        key_mgmt=NONE
}
/etc/network/interface
#auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
   wpa-driver wext
   wpa-roam /etc/wpa_supplicant.conf

#auto wlan1
allow-hotplug wlan1
iface wlan1 inet manual
   wpa-driver wext
   wpa-roam /etc/wpa_supplicant.conf

iface home inet dhcp
iface work inet dhcp
iface default inet dhcp

No comments: