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

putty

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:

ifconfig

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

ifconfig

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.

3) Opening configuration file

Type the following command to open your configuration file:

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

wifi_config_file

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.

wifi_config_file_filled

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.

iwconfig

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 how to build a home automation system and we’ll cover the following main subjects: Node-RED, Node-RED Dashboard, Raspberry Pi, ESP32, ESP8266, MQTT, and InfluxDB database DOWNLOAD »
Learn how to build a home automation system and we’ll cover the following main subjects: Node-RED, Node-RED Dashboard, Raspberry Pi, ESP32, ESP8266, MQTT, and InfluxDB database DOWNLOAD »

Enjoyed this project? Stay updated by subscribing our newsletter!

Leave a Comment

Download Our Free eBooks and Resources

Get instant access to our FREE eBooks, Resources, and Exclusive Electronics Projects by entering your email address below.