Setup wireless networking

One of the first items to setup on a freshly installed Pi is wireless networking. To do so, you have to edit the wpa_supplicant file.

First go to the root environment

$ sudo su

On the root prompt enter

# wpa_passphrase "ssid" "password" >> /etc/wpa_supplicant/wpa_supplicant.conf

replace the ssid and password with the values of your wireless network. This command will create a wireless setup file with the ssid and password of your wireless network. By default this file will also contain a line with the unencrypted password, so for security reasons we will delete this line.

Exit the root environment by typing exit and edit the wpa_supplicant.conf file by typing

$ sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

Remove the line starting with #psk=

network={
        ssid="ssid"
        #psk="password" <-- remove
        psk=44116ea881531996d8a23af58b376d70f196057429c258f529577a26e727ec1b
}

Save the file and exit nano by pressing CTRL+X followed by Y

Restart the wireless interface (assuming your wireless device is wlan0) by typing

$ sudo wpa_cli -i wlan0 reconfigure

Within a few seconds you should be connected to the wireless network. You can check this by typing

$ ifconfig wlan0

Full article on Raspberry site: https://www.raspberrypi.org/documentation/configuration/wireless/wireless-cli.md


Comments

Be the first to comment