In order to be able to follow the tutorials better, I would like to quickly show you how to set up the Raspberry PI.
Note: There are also many other setup options, the one shown here is just a suggestion!
The aim of this tutorial is to show used hardware, and the initial setup of your Raspberry PI.
I use this hardware for all tutorials. For many purposes (but not all) you can also use previous versions of the Raspberry PI.
The easiest and most comfortable installation is with the Raspberry Pi Imager
. You can download it here and then install it. As soon as the installation is successfully completed, put the SD card into your SD card into your SD card reader and run Raspberry Pi Imager. First, select the OS (e.g. Raspberry Pi OS Lite). Second, select the SD card and third press button Write
.
Raspberry Pi OS Lite
Release date: March 4th 2021
Kernel version: 5.10
Size: 1175 MB
Note: In the following tutorials, I do as first step always an update/upgrade. You should also keep your system up-2-date.
To enable SSH on headless Raspberry PI, simply create the (empty) file named ssh
, into the boot partition of the SD card.
# create empty file
┌──[lupin@macOS]::[~]
└─ % touch /Volumes/boot/ssh
Similar to SSH you also can set up already the Wi-Fi (as STA). Only difference is that this configuration wpa_supplicant.conf
_ file needs some content.
# add and modify file
┌──[lupin@macOS]::[~]
└─ % vim /Volumes/boot/wpa_supplicant.conf
Add the content to your configuration file (depending on your location and Wi-Fi).
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=<Country code>
network={
ssid="<Name of your Wi-Fi AP>"
psk="<Password>"
}
Unmount the SD card, plug into Raspberry PI and start up the device. After the start, connect with SSH (user: pi and password: raspberry) and change to user root
. As root run the command raspi-config
and finish your setup.
# ssh connection to Raspberry PI
┌──[lupin@macOS]::[~]
└─ % ssh [email protected]
# change to root
$ sudo su -
# start console based raspi-config application
$ raspi-config
Note: Please activate SSH and set up the Wi-Fi again (just to ensure).
From version 1.6, you can save some time (many configuration steps) with the advanced option feature. Just hit keys [Ctrl] + [Shift] + [x]!