Random Nerd Tutorials

How to Configure WiFi on Your Raspberry Pi


In this post, you’ll configure the WiFi on your Raspberry Pi. If it’s your first time using the RPi, first make sure you read my Getting Started with Raspberry Pi guide.

Setting up your WiFi via the command line is the best method, since you don’t necessary need access to the GUI (Graphical User Interface) everything you need is already right there (in your command line).

1) Accessing Your Command Line

Boot your Raspberry pi with the WiFi adapter plugged in. You can access your command line using one of the following methods:

  • Having an Ethernet connection ensures that you can open an SSH client like PuTTY  to establish an SSH communication
  • Using the Raspberry Pi GUI to open your terminal window


2) Checking if your RPi recognizes your WiFi adapter

There are several ways to check if your WiFi adapter has been recognized. You can type:


And your wireless adapter named as wlan0 should appear  as shown in the Figure below.


If you don’t see your WiFi adapter listed, you might have to install drivers for your particular WiFi adapter. I’m using the TL-WN725N and by default Raspbian doesn’t support my WiFi adapter. So I’ve followed this thread to install my drivers.

If you don’t have a WiFi adapter yet, I highly recommend purchasing the Edimax EW 7811UN. This is a good option, because Raspbian comes with its drivers installed out of the box, that ensures that your RPi recognizes that WiFi adapter.

Click the image above, to see on Amazon.

Click the image above, to see on Amazon.

3) Opening configuration file

Type the following command to open your configuration file:

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf


4) Adding your network details

Go to the bottom of your configuration file wpa_supplicant.conf and add your network details as shown below. Replace “YOUR-SSID” and “YOUR-SSID-PASSWORD” with the details of your WiFi connection.



Now save your file by pressing Ctrl+x then y, then finally press Enter.

5) Testing your connection

You can check the status of the wireless connection using ifconfig (to see if wlan0 has acquired an IP address) and iwconfig to check which network the wireless adapter is using.


Do you have any questions? Leave a comment down below!

Thanks for reading. If you like this post probably you might like my next ones, so please support me by subscribing my blog and my Facebook Page.

Learn ESP32 with Arduino IDE

This our complete guide to program the ESP32 with Arduino IDE, including projects, tips, and tricks! The registrations are open, so SIGN UP NOW »

Recommended Resources

Home Automation using ESP8266 »
Build IoT projects and home automation gadgets with the ESP8266 Wi-Fi module.

Build a Home Automation System »
Learn how to build a automation system using open-source hardware and software from scratch.

Arduino Step-by-Step Projects »
Build 25 cool Arduino projects with our course even with no prior experience!

Leave a Comment:

Grab our Electronics and Programming Courses