Saturday 3 September 2016

[RaspPi] How to start Raspberry Pi 3 headless on a WiFi connection with WPA-PSK

While some Raspberry Pi owners out there start with their Pi plugged to a monitor, a keyboard, and a mouse, some other users prefer to run the Pi in headless mode. The headless mode off-the-shelf wasn't really bad with the previous editions of Raspberry Pi prior the third one since the user could have access via the ethernet port. However, if the user decides to start in headless mode on wireless ethernet, a little configuration needs to be done, which happens to be the topic of this tutorial.

I assume that the user has a Raspberry Pi 3 and Raspbian OS installed on a microSD card.

Plug the microSD card in the PC and go to root partition.
The first step is to set the appropriate configuration that allows to automatically use the wireless interface.
Backup etc/network/interfaces then edit it and overwrite it with the following content:

The second step is to configure the default WiFi connection for the wireless interface.
Backup etc/wpa_supplicant/wpa_supplicant.conf then edit it and append the following content:


The right values ssid and psk should be put in there, of course.

Put the microSD card in the Raspberry Pi and plug the power supply. When the green LED stops fluttering, open an ssh session to pi@raspberrypi.local, the password is raspberry. If the configuration and the connection are well set, ssh should work fine.

In the end, don't forget to properly shutdown the Raspberry, for example using this command:
sudo shutdown -h now
And wait until both the green and the red LEDs are continuously on to unplug the power supply.

Happy tinkering!

No comments:

Post a Comment