Most Raspberry Pi models now come with built-in connectivity options. Raspberry Pi 3, 3B+, Raspberry Pi Zero W, and Raspberry Pi 4 have built-in Bluetooth and Wi-Fi.
This inclusion empowers your projects by eliminating the need for USB dongles and hubs. But how do you set up Wi-Fi on a Raspberry Pi 3 or later? How is Bluetooth connected?
Here’s what you need to know about setting up a wireless network via Wi-Fi and Bluetooth on your Raspberry Pi.
Wi-Fi and Bluetooth on Raspberry Pi 3 and 4
Raspberry Pi 3 is the first version of a computer with a wireless interface and Bluetooth. The next version with these features includes the Raspberry Pi Zero W, Raspberry Pi 3 B+ and Raspberry Pi 4.
With built-in Wi-Fi, Raspberry Pi can easily connect to wireless networks. This greatly expands the connectivity options. Meanwhile, the inclusion of a Bluetooth radio in the Raspberry Pi (Pi 3 has Bluetooth 4.1 BLE, Pi 3 B+4.2 BLE, and Pi 4 Bluetooth 5.0) means you can add any device like a smartphone, TV, or Xbox One controller
Set Up Wi-Fi on Raspberry Pi via Desktop PC
The easiest way to connect your Raspberry Pi to a wireless network is to use a desktop tool. However, this means that you will need to set it up with your keyboard, mouse, and display. An alternative is to first connect an ethernet cable and then connect via VNC or RDP. . Just remember to disable Ethernet when the Pi is connected wirelessly!
To connect to the router, right-click the gray wireless network icon in the right corner of the panel. Choose an option Enable WiFi then select the desired network from the menu.
When prompted, enter Pre Shared Key then wait until the connection is established.
You should now be online.
Setting up a wireless network to connect your Raspberry Pi to Wi-Fi
In addition, you can set up a wireless network from the command line. This is a good option if you are accessing your Raspberry Pi over SSH (initially over Ethernet).
sudo apt update sudo apt upgrade
You have two options for setting up a wireless connection. It may seem that loading in the GUI is easier, but it’s easier to do it on the command line. You should already have an SSID, but if not, use
sudo iwlist wlan0 scan
This will show the SSID in the «ESSID» line. Then open wpa_supplicant.conf:
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
You will need to add or edit the following:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 country=US network={ ssid="SSID" psk="PASSWORD" key_mgmt=WPA-PSK }
Take the time to change the country value accordingly and add the SSID and password for your network.
Use Ctrl + X to exit and save, press Y and Enter for confirmation. Wireless communication should start immediately. If not, use this command to restart the wireless network:
sudo ifdown wlan0 sudo ifup wlan0
You can also just log in sudo reboot
.
Set up Wi-Fi on Raspberry Pi 3 before downloading
Another option for Wi-Fi on Raspberry Pi 3 and later is to set it up before the first boot. This is possible by inserting a microSD card into your PC’s card reader and navigating to the directory /boot/ . Here create a text file named wpa_supplicant.conf then open it up and add details like you did above.