Skip to content

Preparing a Raspberry Pi

Overview

This is a recipe to prepare a Raspberry Pi computer to use with a PiE server. The general steps we will follow are as follows:

  • Install the Raspberry Pi OS named buster onto an SD card.
  • Boot the Pi with the SD card and find its IP on a local network.
  • Login to the Pi with ssh.
  • Configure the Pi with sudo raspi-config.
  • Mount a USB drive

This might seem daungting but if you take each step methodically, you can do it. If you have done it a few times, it should take about 20 minutes.

Required hardware

For this initial setup you will need the following:

  • A residential router connected to the internet
  • A macOS or Windows machine connected to the router
  • An additional ethernet cable for the new Pi

If your setting up the Pi to eventually be on a University network, there are some additional requirements. Here we will assume you are on a residential network that you control. This can be acheived by simply bringing everything home and working from there.

Download Raspberry Pi Imager

These initial steps are done on any internet connected computer (not the Pi).

We will use the Raspbery Pi Imager to copy a downloaded Raspberry Pi OS (a .zip or .img file) onto your SD card.

Download the Raspberry Pi Imager. Here are direct links for downloading for the macOS and Windows:

Download the Raspberry Pi OS (buster)

It is CRITICAL that you download and install a slightly older version named Buster.

This can be found towards the bottom of the main Raspberry Pi OS download page. You can get there using the 'See all download options' button.

Specifically, you want the following:

Raspberry Pi OS Lite (Legacy)
Release date: February 21st 2023
System: 32-bit
Kernel version: 5.10
Debian version: 10 (buster)
Size: 286MB

Here is a direct link to download the buster xz file.

The name of the file you downloaded should be 2023-02-21-raspios-buster-armhf-lite.img.xz. This is a compressed file, on either macOS or Windows uncompress it and you should end up with a new img file named 2023-02-21-raspios-buster-armhf-lite.img. This is what you will install onto the SD card using the Raspberry Pi Imager.

Format the SD card

You need to format the SD card using the Fat format.

If using a macOS computer

  • Insert the SD card
  • Open the 'Disk Utilities' app. It is in Applications:Utilities folder
  • Select your SD card in the left list (make sure you get it right)
  • Select 'Erase'
  • In the Erase dialog select MS-DOS (Fat) and Master Boot Record (MBR)

If you are using a Window computer, just follow the prompts when you first insert the SD card or right-click the SD card and format it.

Run Raspbery Pi Imager

In the Raspberry Pi Imager software ...

  • Select Choose OS and then Use Custom and then select the img file you just uncompressed.
  • Select your SD card.

Enable ssh on boot

Now the system is on your SD card. You need to enable ssh on boot so you can login to your Pi.

An aside. What we are doing here is a bit different than most interactions with computers. The Raspberry Pi, as we are using it, will reamin headless. This means there will never be a monitor, keyboard, or mouse connected to your Pi. All interaction is done through a command prompt using the terminal software called ssh.

To enable ssh on boot, you need to make an empty file named ssh on the SD card.

  • On macOS

With the SD card inserted, in a Terminal, enable ssh on boot with the following command

touch /Volumes/boot/ssh
  • On Windows

Use the exporer to view the SD card, it should be named boot. Right-click and create a new text document. Change the name of the new file to just ssh (no extnesion).

Goal half-way completed !!!

You now have an SD card ready to boot a Raspberry Pi! Go take a break!

Power up the Pi

  • Insert the SD card into the Raspberry Pi computer.
  • Attach an ethernet cable from the Pi to your local router.
  • Plug in the USB power.

Find the Pi on your local network and get its IP address

Now you need to find the IP address of your Pi on the local network.

Note: This step is most easily done on a home type router (a residential router). This way you can use the router web interface to determine the IP address of the Pi. If your on a University network, you need to contact your network administrators and request a fixed IP. To do this, you will usually have to give them the Raspbery Pi ethernet MAC address.

Once you are connected to a residential router, on a computer on the local network (connected to the same router as the Pi), open a browser and go to your local router page. It is usually at http://192.168.1.1. Once there, find the connected devices tab and find your Raspbery Pi in the list.

You need to note the IP address of your Pi for the following steps.

If you eventually want your Pi on a University network and need the MAC address of the Pi you can also find it here. The MAC address is a unique identifier for each ethernet or wifi chip, it does not change.

Connect with ssh

Again, on a computer on the local network, you need to connect to the Pi using a terminal program called ssh.

On macOS, run the Terminal program. On Windows run a terminal program like Putty.

At the command prompt, type

ssh pi@<IP-address-of-your-pi>

Where <ip-address-of-your-pi> is the IP address you just noted down from your router.

This will then ask for a username and password.

The username is pi and the password is raspberry.

Once logged in, your command prompt should look something like pi@raspberrypi:~ $

Configure pi

Once logged into the pi, type sudo raspi-config and you will be presented with a number of menu options. You can select menus with the up/down arrows, enter into submenus with return (or enter) and go back to a previous menu with escape.

sudo raspi-config
|       1 System Options       Configure system settings                       │
│       2 Display Options      Configure display settings                      │
│       3 Interface Options    Configure connections to peripherals            │
│       4 Performance Options  Configure performance settings                  │
│       5 Localisation Options Configure language and regional settings        │
│       6 Advanced Options     Configure advanced settings                     │
│       8 Update               Update this tool to the latest version          │
│       9 About raspi-config   Information about this configuration tool

Select 1 then

│       S3 Password          Change password for the 'pi' user                 │

You must set the password to poetry7d. This is required for the PiE server to talk to the Raspberry Pi.

│       S4 Hostname          Set name for this computer on a network           │

Enter any valid hostname you want. This will uniquely identify your Pi with an easy to remember name on the network. We usually use animal names like giraffe or monkey.

Select 3

│       3 Interface Options    Configure connections to peripherals            │

then select

│    P1 Camera      Enable/disable connection to the Raspberry Pi Camera       │

When asked, Would you like the camera interface to be enabled select <yes>

Select 5

│       5 Localisation Options Configure language and regional settings        │

then select

│         L1 Locale       Configure language and regional settings             │

Scroll up/down with up/down arrow. Toggle the selections with space, move from the list to the ok and cancel buttons with tab

by default, the following is usually selected

│    [*] en_GB.UTF-8 UTF-8                                              ▒   │

If your in the UK, you are good to go. If you are in the US then select (sorry to be so US centric)

│    [*] en_US.UTF-8 UTF-8                                              ↓   │

Select

│         L2 Timezone     Configure time zone                                  │

and select your timezone

Select 6

│       6 Advanced Options     Configure advanced settings                     │

then select

│   A1 Expand Filesystem       Ensures that all of the SD card is available    │

You are done with this step !

From the main menu select <finish> and when asked to reboot select <Yes>

Mount a USB drive

The Raspberry Pi OS does not mount USB drives when they are first plugged in (this is normal for most Linux operating systems).

Follow our monting a USB drive tutorial. An alternate version is here.