Brigadoon - An Occasional Corner on the Internet
USB WiFi Adapter Set Up
Designed by Mark Little
Before starting to set up the USB WiFi adapter, you will need to know the SSID (Service Set Identifier) and the PSK (Pre-Shared Key). The SSID being the name of the WiFi network to which you want to connect and the PSK is the password that you need to access the system. It is assumed that the Raspberry Pi is being set up to connect to a home WiFi network, so both of these parameters should be known to you.

To set these WiFi device up, you will need to edit files as root. This can either be done by logging in as root using "su", or using "sudo" in front of each command to gain the privileges that you will need.

The first thing to do is to plug in your USB WiFi dongle. Once that has been done, check that it has been recognised by running the following command:

dmesg | grep Product:

You should get a list of devices that are attached to the Raspberry Pi. You are looking for something similar to this:

[     3.900275] usb 1-1.5: Product: 802.11 n WLAN
[   95.514884] usb 1-1.4: Product: 802.11n NIC

Ideally the product title should contain 802.11 or WLAN to indicate that a WiFi USB device has been recognised. It should be noted that that not all small USB dongles are actually WiFi dongles and there are similar looking Bluetooth dongles that are not suitable for this purpose.

One Bluetooth unit tested came up with the product name "Wireless Receiver". Unlike the WiFi units tested, it was not identified physically with "WiFi" or "802.11n" on the case.

Knowing that the USB dongle is suitable for WiFi on the Raspberry Pi may save you a lot of wasted time later!

nano /etc/network/interfaces

Go to the bottom of the file and add the following text, substituting your network's SSID and password. Once done, save the file:

allow-hotplug wlan0
auto wlan0

iface wlan0 inet dhcp

Once this file has been saved, it is time to bring down the WiFi device "wlan0" and then bring it up with its new configuration. To do this, enter the following commands:

ifdown wlan0
ifup wlan0

You should now a working WiFi device connected to your WiFi network. This can be check by running the following command:


The part of the message that you are interested in starts with "wlan0" and should look something link this:

wlan0     Link encap:Ethernet  HWaddr 00:36:76:62:8a:e4 
inet addr:  Bcast:  Mask:
             UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
             RX packets:6212 errors:0 dropped:0 overruns:0 frame:0
             TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
             collisions:0 txqueuelen:1000
            RX bytes:516614 (504.5 KiB)  TX bytes:3469 (3.3 KiB

The import parts are shown in blue. If the wlan0 device has been allocated an IP address, it is connected to the network using the SSID and PSK that you entered into the configuration file.

The WiFi link will now attempt to connect when it reboots, or the WiFi USB dongle is plugged into a USB port. If you would like some help stepping throught process described above, the next page will provide a script that will step you through the steps to set up your WiFi USB device.

As discussed earlier, not all WiFi USB dongles have a Raspberry Pi driver, so this installation will fail if a device driver cannot be found.