Background / Purpose / Getting Started / Cluster Guide
This section covers different methods on how-to set up and connect to the internet on your Raspberry Pi.
Ethernet is the preferred and easiest method.
Requirements:
Steps to connect:
Troubleshooting:
Requirements:
Steps to connect:
Troubleshooting:
How-to configure WiFi Protected Access (WPA) based wireless network interfaces manually on Linux-based operating systems via the Command Line Interface (CLI).
sudo raspi-config
If you do not know the SSID of the network, the next section details how to list all available networks prior to running raspi-config
command.
To scan and list all available WiFi networks along with other useful information, run the following command in a terminal window
sudo iwlist wlan0 scan
Retrieve the following information from your WiFi Network:
'ESSID:"testing"'
which is the name of the WiFi network'IE:IEEE 802.11i/WPA2 Version 1'
which is the authentication method that such network usesTry using raspi-config after writing down the network details. If raspi-config
fails to connect the Pi to the desired network, the next section covers how to manually add such network to the Pi and connect to it.
Create a wpa-supplicant
configuration file
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
Generate an encrypted pre-shared key (psk)
wpa_passphrase "<network ssid>" >> /etc/wpa_supplicant/wpa_supplicant.conf
Enter the network SSID and WPA password or keyphrase then hit Enter again.
Here is how wpa_supplicant.conf
should look like so far:
network={
ssid="network ssid"
psk="encrypted pre-shared key"
key_mgmt=WPA-PSK
}
Add the following information at the top of the wpa_supplicant.conf
file
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=<country-code-here>
Refer to en.wikipedia.org/wiki/ISO_3166-1 for your specific country code.
Re-configure the network interface
wpa_cli -i wlan0 reconfigure
Verify whether the Raspberry Pi has successfully connected to the internet using:
ifconfig wlan0
If inet addr
displays an IP address beside it, the Raspberry PI is connected to the internet. Otherwise, please refer to the Raspberry Pi Foundation’s guide on how to connect to WiFi via command line.