The Raspberry Pi computer comes without Wi-Fi initially, but it’s true freedom is reached when you connect it wirelessly.  There are a number of options for this, but I’d recommend using the Edimax Nano USB, it’s easy to setup your Raspberry Pi to work with this – just follow this guide.

First you need the Wi-Fi dongle (others may work with this guide, as long as they have drivers for the Raspberry Pi).  Link to the product is below from Amazon UK.
 Once you have the dongle just plug it into your Raspberry Pi, plug it into one of the direct USB ports, not via a Hub (sometimes problems can occur going through a hub, the Raspberry Pi has enough power for this little networking tool).

Check to ensure it’s been recognised by the Raspberry Pi lsusb this lists the USB devices detected and you should see your device similar to the screenshot below – if you don’t see it try unplugging and plugging it back in again!  To make things easy I sudo su, remember this gives you root access, so once your done exit out from this level.

sudo su

lsusb

The line with Edimax shows your device is detected and your ready to configure it.

If you have configured your WiFi before (for another adaptor) it may well have already connected – type in iwconfig – if it says “unassociated” then you can continue – if it’s associated (like the screenshot below) your done and don’t need to do anything

iwconfig

(the topline ESSID indicates that my WiFi is configured and working).

If you cannot see wlan0 or wlan1 then your device is not working yet  – try unplugging it or rebooting your Raspberry Pi

Configuration Steps – Network Interfaces

Make sure the wlan interface is setup for hot-plugging and setup the filepath for the configuration.  Make sure the following lines are present (some are probably already there).  Edit /etc/network/interfaces

nano /etc/network/interfaces

 

auto wlan0

allow-hotplug wlan0

iface wlan0 inet manual

wpa-roam /etc/wpa_supplicate/wpa_supplicant.conf

If you find a wlan1 you may want to do this as well (happens if you switch the ports sometimes) just to ensure any wireless interface connects (or you can point to a different configuration file to connect to different networks.

Network Interfaces

Configuration Steps – WiFi security details

edit the supplicant file and put in your details

If the fields are missing add them in – put your ssid and the password in with quotes in-between

nano /etc/wpa_supplicate/wpa_supplicant.conf

network={

ssid=”YOUR SSID HERE

psk=”YOURKEYHERE

proto=RSN

key_mgmt=WPA-PSK

pairwise=CCMP TKIP

group=CCMP TKIP

}

wpa_supplicant

Once done you can bring up the interface:

ifup wlan0

You may get some errors, it is usually safe to ignore them.  To see if it has worked run ifconfig and you should see an IP address,

ifconfig wlan0

ifconfig wlan0

 

Any problems I’d recommend rebooting your Raspberry Pi, this will startup the Wireless Interface as it boots up.