3 ways to connect a Raspberry Pi 3 to a network using Wi-Fi

If you are using anAd Blocking Browser Extension
please consider deactivating it for this website.Also see our Ads Policy.

The Raspberry Pi 3 comes equipped with on-board Wi-Fi and an Ethernet port. Establishing a network connection using Wi-Fi can be done in a couple of ways.

This is an ongoing post. Please suggest corrections, explanations, etc. in the comment section at the bottom of this page.

From a hardware point of view, using Wi-Fi connectivity offers more freedom, but is a little more complicated to configure when compared with a wired connection. Using an Ethernet cable will need no configuration and will allow network connection with an automatic assigned dynamic IP address. Using Wi-Fi will also assign a dynamic IP, but will need the network name (SSID) and the password (also called the passphrase or pre-shared key) of the wireless network. Also read setting up a static IP address on the Raspberry Pi using Wi-Fi.

This post will show how to configure a wireless network connection using the Raspi-config tool (Raspbian Stretch only), the Raspbain GUI (Raspbian Jessie and Raspbian Stretch) and the terminal. It will also show how to remove the settings again.

Before or after the chosen method, an IP address will indicate that the Raspberry Pi is connected to a local network. To get the IP address, use the following command in the terminal:

hostname -I

The simplest way to test whether the Raspberry Pi is connected to the internet is by using the ping command from the terminal:

ping -c 5 google.com

Configuring the Wi-Fi settings using the terminal

Using the terminal to configure the Raspberry Pi 3’s Wi-Fi settings is the most accessible way, but also the most complicated. It offers a few more options when compared with the other options. The terminal is accessible on all the versions of Raspbian, either from the boot sequence, or from the terminal icon at the top of the GUI.

To access the terminal from the Raspbian Stretch’s GUI, use the terminal icon on the top right of the screen. Raspbian Jessie is the same.

The configuration settings for wireless connectivity is stored in the wpa_supplicant.conf file. To make a backup of the original file use:

The default optional settings will work in most cases, but read the # comments for custom settings. Comment out (using #) or remove the line to use the default setting. Press Ctrl + X to exit and save the changes.

To remove the wireless network settings, simply remove all the network lines again and reboot the Raspberry Pi using:

sudo reboot

Configuring the Wi-Fi settings using the Raspbian GUI

As from Raspbian Jessie, the GUI offers a very easy way to configure the Wi-Fi settings.

The network configuration icon for Raspbain Jessie. This icon looks a bit different in Raspbain Stretch.

The network configuration icon is situated on the top right section of the GUI (next to the sound icon). By clicking on it, the available wireless networks will be selectible, after which the password (Pre Shared Key) will be prompted for.

The configuration settings for wireless connectivity is stored in the wpa_supplicant.conf file. To remove the wireless network settings, see using the terminal commands mentioned earlier.

Configuring the Wi-Fi settings using the Raspi-config tool

As from Raspbian Stretch, the Wi-Wi settings can be configured using Raspi-config, the GUI and the terminal. Using the Raspi-config tool is an easy way (when compared with using the terminal) to configure the wireless settings using Raspbian Stretch Lite. The Raspi-config tool can be accessed using the following terminal command:

sudo raspi-config

To use Raspi-config from the terminal, the keyboard arrow buttons are used to move to the desired menu item and it is selected with the Enter key. The Escape key can also be used cancel certain options and to exit Raspi-config.

To change the Wi-Fi settings, go to Network Options -> Wi-Fi. From the menu, select your country, enter the SSID (network name) and password. Once this is complete, Raspi-config will restart.

The configuration settings for wireless connectivity is stored in the wpa_supplicant.conf file. To remove the wireless network settings, see using the terminal commands mentioned earlier.

Save, share & Disqus

Use the buttons below, on the left or the bottom of this page to share this post. Your comment is important, but don't be a shit. Keep it constructive and polite.

Comment via Disqus

Disqus is a worldwide comment hosting service for web sites and online communities. This secure platform ensures a pleasant commenting environment which is manageable from one account. Use the Login button to sign up.

Manually updating Kodi’s media libraries15 June 2017Although Kodi is quite comprehensive with a lot of automatic functionality (build-in or via plugins), there are still some things that needs to be done manually. Cleaning and updating the media libraries are unfortunately some of them. More…

Automatic media library updates for Kodi media center10 March 2017After new content has been loaded to Kodi’s storage locations, a media library update is required to add this content to the front-end. This post will show how to automate this process by installing an auto library updater for Kodi. More…

Communicating between 2 Raspberry Pis using sshpass10 September 2016 | Updated 24 October 2018sshpass is a Linux software package that can be used to establish a direct (secure) connection between two Linux operated computers. This connection allows ‘remote’ access to a ‘local’ computer to run commands ‘locally’. Communicating between 2 Raspberry Pi’s using sshpass will show you how. More…