Pinterest Stumbleupon Whatsapp
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 What Is The True Cost Of Running a Raspberry Pi? What Is The True Cost Of Running a Raspberry Pi? The Raspberry Pi - a small, compact and versatile computer, capable of processing HDMI and MPEG-2 being the central component of any number of weekend projects from retro gaming stations and media centres to smart... Read More , a tactic that can prove more expensive than expected but still cheaper than other computers.

Ads by Google


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.

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 upgrade

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 Setting Up Your Raspberry Pi For Headless Use With SSH Setting Up Your Raspberry Pi For Headless Use With SSH The Raspberry Pi can accept SSH commands when connected to a local network (either by Ethernet or Wi-Fi), enabling you to easily set it up. The benefits of SSH go beyond upsetting the daily screening... Read More or VNC VNC, SSH and HDMI: Three Options for Viewing Your Raspberry Pi VNC, SSH and HDMI: Three Options for Viewing Your Raspberry Pi The Raspberry Pi is a remarkable little computer, but it can be time consuming to set it up and connect it to your monitor. Read More 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.

  1. learn
    October 17, 2016 at 1:07 pm

    Thank you for the detailed explanation.

    I am using Pi 3 which has built in WiFi is there any additional or different steps I need to do in order to connect to the network ?

    Another question , dose this type of connection allows me to telnet to the pi from another PC?

    Thank you a lot

  2. Ash
    January 6, 2016 at 5:23 am

    Do you have any suggestion on controlling raspberry pi (or arduino) via remote wifi web (or mobile app)? Thank you!

  3. PhiDeck
    January 1, 2016 at 6:23 pm

    My philosophy is the opposite of the author's: I use Ethernet wherever possible and practical, and WiFi only where Ethernet is not possible or practical.

    • Christian Cawley
      January 5, 2016 at 2:00 pm

      I wouldn't call it a philosophy. I use Ethernet 90% of the time, using Wi-Fi pretty much the same as you.

  4. Richard Lawrence
    December 29, 2015 at 1:34 pm


    Thanks, we were distracted on other things for a few months, now starting again with new version of Raspian and the WiFi connects immediately.

  5. Karl Kranich
    October 27, 2015 at 11:34 pm

    Thanks for this! One thing you might want to correct: "sudo apt-get update" doesn't update anything on your pi except for its list of packages. You'll have to "sudo apt-get upgrade" to actually install upgraded packages.

    • Christian Cawley
      October 29, 2015 at 7:41 am

      Oops, good spot, thanks!

  6. dmarcia
    June 4, 2015 at 12:19 pm

    Hi Christian, I'm a newbie doing my IT project, creating wifi network using raspberry pi. I'm trying to using 3 wireless adapter to provide 3 different ssid, was trying whole day and night configuring hosted.conf file with no success. The problem is, I can see only 1 last ssid that configured in hosted.conf file. How to make it works, to display all 3 said in the network? How to add other interface (wlan1 and wlan2) in hosted.conf file? Thank you I really appreciate your help.

  7. MDR
    May 22, 2015 at 2:00 pm

    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.

    • Christian Cawley
      May 29, 2015 at 9:02 pm

      have you tried reconnecting with an Ethernet cable?

    • Mike Roman
      May 29, 2015 at 11:29 pm

      Yes, it gets online fine with an ether net cable but I really need wireless for my purpose. Any ideas how to get wireless to work?

  8. Arell
    April 7, 2015 at 1:50 pm

    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!

  9. Richard
    February 21, 2015 at 9:28 pm

    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?

  10. hydn
    July 18, 2014 at 5:36 am

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

  11. Ed
    April 7, 2014 at 9:03 pm

    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.

Leave a Reply

Your email address will not be published. Required fields are marked *