Welcome to a tutorial on how to Setup Wi-Fi on the Raspberry Pi 3!
As an introduction, I chose do to an article on this due to the fact there was only a few different variations of this guide on Google and none of them seemed to work for me! I eventually realised this could have been fixed easily because the other guides didn’t clearly state how to setup Wi-Fi on the Raspberry Pi 3.
Starting off, I hope to keep this very simplistic and easy for any level of user who is wanting to setup wi-fi on the Raspberry Pi 3 using command line.
1. Start off by connecting a keyboard to your Raspberry Pi, once logged in type the following command:
sudo iwlist wlan0 scan
2. After, the results should be like so, you may have a few depending on how many Wi-Fi networks are in range, find yours out of the list! Below I have highlighted the two important lines you’re looking for.
wlan0 Scan completed :
Cell 01 - Address: C4:04:15:E1:3F:29
Frequency:2.437 GHz (Channel 6)
Quality=57/70 Signal level=-53 dBm
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
9 Mb/s; 12 Mb/s; 18 Mb/s
Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s
Extra: Last beacon: 30ms ago
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
3. Navigate to the wpa_supplicant.conf file:
$ sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
4. Once open you may wish to add the following beneath update_config=1, I have included a copy of my wpa_supplicant.conf file below in step 5.
ssid="NETWORK SSID or ESSID in Step 3"
psk="PASSWORD TO WIFI NETWORK"
5. I found that this config by itself didn’t work, if your network mentions “IE: IEEE 802.11i/WPA2 Version 1” then you can put in an extra line, featured within my whole config file below. You can also change this to just “WPA2” without the quotations if your network shows WPA2.
6. You can check if this is connected by using the next command which shows the following results, I have highlighted the network name/ESSID and IEEE below.
sudo iwconfig wlan0
wlan0 IEEE 802.11bgn ESSID:"NETWORK NAME"
Mode:Managed Frequency:2.437 GHz Access Point: C4:04:15:E1:3F:28
Bit Rate=72 Mb/s Tx-Power=1496 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Link Quality=64/70 Signal level=-46 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
7. This isn’t required but I found disabling the Raspberry Pi 3 Wi-Fi Power Management stopped the network connection dropping and made it more responsive. To do this this, follow Step 7.
sudo iwconfig wlan0 power off
Please remember to type Sudo before most commands to run these as administrator, this sometimes will cause the commands not to execute properly without.
8. You may wish to reboot, although not required and your Setup of Wi-Fi on the Raspberry Pi 3 should now be complete!
For more information regarding the Raspberry Pi 3 and Raspberry Pi’s please refer to RaspberryPi.ORG!