Programming Blog

Jeremy Morgan

Mostly Coherent Ramblings of a Silicon Forest Software Developer

How to Install a Wireless USB Network Card on Raspberry Pi

By: Jeremy Morgan

Raspberry Pi Newsletter

Today I’m going to show you how to install a wireless networking card on your Raspberry Pi. I’m using the ultra cheap Ralink wireless card, but the instructions are similar for any Wireless Device.

Update Your System

For this tutorial I’m using Raspian. This is a great beginner OS for the Pi and quite easy to use.

You’ll want to make sure you’re at least wired in so you can do an update:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get autoremove

Get Started

We’re going to do this from SSH, though it’s easier to do from the desktop. But you got a Raspberry Pi to learn didn’t you? Many people use their pi strictly over SSH and don’t run a desktop at all. I have decided to include those kinds of instructions rather than do it the graphical way.

1. Plug in your USB device and find it

Once plugged in, again we’ll look at our USB devices:


It looks like in my case it’s installed, so now we’ll make a copy of the WPA supplicant file:

sudo cp /etc/wpa_supplicant/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant.conf.bak

Now open up the file:

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

And add the following:

    ssid="[YOUR NETWORK SSID]"

It should look like this:

Now, save the file. CTRL + X - Save “Y”

Start up Your Adapter

Now we need to stop the wlan service:

sudo wpa_action wlan0 stop

Then bring it back up:

sudo ifup wlan0

Test Connectivity

sudo wpa_cli status

You should see something like this:

If not, double check your network SSID and Password, that’s the most common problem. You may have a card that isn’t supported by the Raspberry Pi, if not get a new one! They’re super cheap and well worth it.

(Optional) - If You End up Needing a Driver

Sometimes there are issues that prevent you from loading the drivers for your card. Much of the firmware comes with raspian, but if not you’ll have to find the drivers for it. You’ll need a Windows machine to get the drivers you’ll need (at least for Ralink).

Insert the device and run the driver disk provided. Then after successfully installing it, open up your control panel, and select the properties of the device:

Click on “driver details”

This will show you the location of the driver files to copy off the machine, you can put them on a USB stick and put them on your Pi from there.

Get The Drivers off the USB Stick The Hard Way

I put the driver files on a USB stick. Getting them from the desktop is really easy, but what if you only have SSH access? Don’t fret. With Raspian it should automount just fine, you only need to find it.

Run the following command to list your USB devices:


Now, you want to see all the disks that are attached to your system:

sudo fdisk -l

As you can see in my case, my USB stick is mounted at /dev/sda1 so the device is connected to my pi. But where is it?


There it is! Under /media/MYLINUXLIVE but that probably won’t be your folder, it will show the drive label you gave it when you formatted it. (I happen to use and love the LinuxLive program whenever I can).

Now I can just look for the drivers on the disk and copy them to a folder in my home directory:

cd ~
mkdir usbdriver
cp -r /media/MYLINUXLIVE/driver/* usbdriver/

Now the files are copied, safely unmount the drive:

sudo udisks --unmount /dev/sda1
sudo udisks --detach /dev/sda

Now you’ll have the drivers you need, but keep in mind the device may not be supported at all.

Raspberry Pi Newsletter


I hope this has helped to show you how to install a wireless USB card on the Raspberry Pi. Raspian has a lot of firmware already built in and a lot of USB Wifi adapters are supported right out of the box. Wpa_supplicant makes things really easy. I decided to show how to do it from the prompt for those who want to learn more about the prompt, or install from SSH.

The Raspberry Pi is all about learning so I encourage you to experiment with this stuff as much as possible. The worst that will happen is you’ll need to reinstall the OS. Remember, you’re learning Linux at the same time which opens a lot of doors for your projects. Enjoy!

My New Course: Hands on Internet of Things with the Raspberry Pi

Internet of Things

I have just released my new course titled ”Hands on Internet of Things” which is intended to be a course for people who want to get started with IoT. I’ll take you through blinking lights and reading sensors to creating YOUR own IoT endpoint and dashboard. I’m offering this special coupon for readers of my site: get %50 off this course here. Thanks for being a reader!

Like my IoT projects? Sign up here to be added to my IoT newsletter