Setting Up Wireless Networking on Your Raspberry Pi

Ads by Google

Virtually every Raspberry Pi project will require a network connection, and considerable flexibility can be gained by ignoring the Ethernet port in favour of a wireless USB dongle. Knowing which one to use and how to set it up could be make or break for your project.

Ethernet Or Wireless?

When you first acquire your Raspberry Pi, the best option is to use an Ethernet connection to ensure the operating system is correctly configured and up-to-date. You can then move onto a wireless USB connection once you’re happy.


The benefit of Ethernet over wireless LAN on the Raspberry Pi – as with most other platforms – is that there is zero configuration required. All you need to do is ensure the cable is connected to a correctly-configured router, plug it into your Pi and boot it up.

Conversely, setting up wireless LAN on the Raspberry Pi can be tricky. The first thing to do is make sure you have chosen a compatible wireless USB dongle.

Finding A Compatible Wireless USB Dongle

There are various way that you might have acquired your Raspberry Pi. You might, for example, have bought it as a standalone unit and purchased the required additional components, a tactic that can prove more expensive than expected but still cheaper than other computers.


Alternatively, you may have purchased a Raspberry Pi kit, containing the computer, a case, SD card, and other hardware, including the wireless dongle. In this case, you should be confident that the dongle will be compatible with the computer.

Ads by Google

Many early buyers of the Raspberry Pi didn’t have the option of a dedicated Wi-Fi dongle, and had to rely on trial and error. This is how the list of compatible hardware was created at, which includes a section on wireless USB dongles.

For the best results, you should get your hands on the USB Wi-Fi adaptor distributed through The Pi Hut. This is a Wireless N device that will also work on other platforms (Windows, other Linux distros, Mac OS X) and is available for around $10 plus shipping.

This is the most common Wi-Fi adaptor in use for the Raspberry Pi, and is the one used to outline the process of configuring your WLAN connection below. Note that the following steps are intended for Raspbian users – the general process should be largely the same on your chosen Raspberry Pi distro, however.

Configuring The WLAN Connection

Start by connecting your USB Wi-Fi adaptor to your Raspberry Pi, ensuring the Ethernet cable is also connected. Check your SD card is secure and connect to your power supply.

You’ll need to ensure your version of Raspbian is fully updated, so after you log on, enter:

sudo apt-get update

Alternatively, you can launch into the GUI (enter startx)> and enter the same command in LXTerminal.

Next, check that the USB dongle is detected by your minicomputer – enter lsusb and check the results. The Wi-Fi device should be listed.


Recent versions of Raspbian come with WiFi Config installed, which is why the update is useful, to ensure this is present.

On the desktop, double-click WiFi Config and select wlan0 as the adaptor. On the Current Status tab click Scan and wait for the results – nearby wireless networks will be listed in a new window.


Select the network you wish to connect to, enter the password in the PSK field and then click Connect. Within seconds, your Raspberry Pi should be connected wirelessly, and you can remove the Ethernet cable.

Ensure The Wireless Adaptor Connects At Startup

Many people leave their Raspberry Pi computers running for quite some time without restarting. A result of this is that the newly configured wireless dongle will not require reconnecting as the connection has never dropped.

However, if you regularly shut down your Raspberry Pi, the wireless adaptor, in its current state, will not automatically reconnect. Therefore, attempts to communicate via SSH or VNC will prove fruitless.

Resolve this by switching to command line and entering

sudo cp /etc/network/interfaces /etc/network/interfaces.old

This will copy the existing interfaces file, renaming it to interfaces.old. Should a problem occur with the edits you’re about to make, the original can be renamed and reinstated.

Next, open the interfaces file in a text editor such as pico:

sudo pico /etc/network/interfaces


Here, find the section dedicated to your wireless device, replacing or amending so it reads as follows:

auto wlan0

allow-hotplug wlan0

iface wlan0 inet manual

wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

(Note that this configuration is for WPA secured wireless networks.)

When you’re done, click CTRL+X, then Y to confirm your changes and Enter. Complete the change by restarting your Raspberry Pi:

sudo shutdown -r now

When the device reboots, the USB wireless dongle will automatically connect to the previously configured network!

Forget Ethernet – Make Your Raspberry Pi Wireless!


I’d used my Raspberry Pi for over a year before I finally got around to setting it up with a wireless dongle, and I haven’t looked back. I’m sure you won’t either. As long as you use the compatible hardware and take care setting up the SSID and passkey, you’ll wonder why you ever bothered with the Ethernet cable!

Don’t forget to complete your configuration by setting the wireless USB dongle to initialize automatically when your Raspberry Pi boots.

For more tips and information about setting up your Raspberry Pi, see our free guide, Raspberry Pi: The Unofficial Tutorial.

Ads by Google

6 Comments - Write a Comment



Love the Pi.
Built one for a friend of a friend using a kit that came with wifi. Wifi did work out-of-the-box. No problems with OpenELEC XBMC.

I currently have an Odroid-U3. Quad core, 2GB RAM. Same guts as a Galaxy S3. I have a 16GB eMMC plugged in for the Debian Linux OS. Feels as smooth as an Intel x86 desktop.

I too have yet to connect the U3 to wifi since my router is 2 feet from it.

Love all these little ARM boards coming out now.



Great write up. There’s also an Arch Linux ARM based image for download here:



That looks really easy and simple, but it’s not working for us. The wpa_gui just sits there with
Status: Scanning and Last message WPS-AP-AVAILABLE.

The WiFi router has Security Mode “WPA-Personal” and WPA Mode “WPA2 only”. Password in “Pre-Shared Key. Pi has ThePiHut WiFi adaptor same as your picture. On the wpa_gui we’ve set WPA-2 Personal (PSK) and TKIP. Also tried CCMP.

The WiFi signal is strong with no-one else on same channel. All the other PCs/phones/tablets are happy with it.

What can be wrong?



Considering a USB wifi can be had for as low as $2 on ebay? Why the hell didnt they include one on the rpi. Instead we users have to go thru the agony of finding out what USB wifi works. I got fed up and buried my rpi! Why would one buy a cheapest hardware computer and then they expect us to buy one of the more expensive wifi adaptor? Just doesnt make sense. I initially wanted to make a KODI rpi. With the cost of expensive USB wifi, it is cheaper for me to use an Amazon fire TV stick instead!



So I got caught in the situation where I cannot reconnect after shutting down my pi. I understand how to prevent this for next time, but how can I manually reconnect it now? I’m hoping I don’t have to totally reinstall noobs and start from scratch? Thanks.

Your comment