Configuring a wireless connection on Raspberry Pi

Now you can configure the wireless connection to allow your Raspberry Pi to connect with your home or school Wi-Fi network. The following steps will guide you through how to configure the connection settings:

  1. Open the wpa_supplicant configuration file in nano using the following command:
pi@raspberrypi:~ $sudonano /etc/wpa_supplicant/wpa_supplicant.conf
  1. Go to the bottom of the file and add the following:
network={
ssid="testing"
psk="testingPassword"
}
  1. If the network you are connecting to does not use a password, the wpa_supplicant entry for the network will need to include the correct key_mgmt entry:
network={
ssid="testing"
key_mgmt=NONE
}
  1. Alternatively, you can use the wpa_passphrase utility to generate an encrypted PSK:
network={
ssid="testing"
#psk="testingPassword"
psk=131e1e221f6e06e3911a2d11ff2fac9182665c004de85300f9cac208a6a80531
}
  1. If you are using a hidden network, an extra option in the wpa_supplicant file, scan_ssid, may help connection:
network={
ssid="yourHiddenSSID"
scan_ssid=1
psk="Your_wifi_password"
}
  1. Now save the file by pressing Ctrl + X, then Y, then finally press Enter.
  2. Reboot your Raspberry Pi for the new configurations to take effect by issuing the following command:
pi@raspberrypi:~ $sudo reboot
  1. You can verify if it has successfully connected by using ifconfig wlan0. If the inetaddr field has an address beside it, the Raspberry Pi has connected to the network. If not, check that your ssid and psk are correct:
Verifying the wireless connection
  1. Otherwise, you can verify the wireless connection between your Raspberry Pi and router by logging into your router's configuration page.
You may get a different user interface depending on your router's brand.

Refer to the following screenshot:

Device list at router configuration page
  1. Now you have successfully connected your Raspberry Pi to the home router's wireless network.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.246.193