Setting up the Raspberry Pi

To set up our Raspberry Pi, you'll need a computer (Windows/Linux/Mac), a MicroSD card (and adapter), a USB-C power supply for the Raspberry Pi, and a wired/wireless network with internet access.

Goal

Our goal is to set up our Raspberry Pi with remote access (via SSH) so that we can make modifications OTA (over the air) while the device is running.

Step 1 - Downloads

Download an image of Raspbian OS from the Raspbian Downloads page - I'd strongly recommend the 'Lite' version.

Download and Install balenaEtcher - This is a tool that makes writing our image to the SD Card very simple.

Step 2 - Insert the MicroSD card into your PC

When you purchased your MicroSD, it likely came with an adapter - either USB or SD Card sized.
  • If you have a USB adapter, insert your MicroSD into the adapter, then insert the adapter into your PC.
  • If you have an SD adapter (and your PC has a SD Card slot) insert your MicroSD into the adapter, then insert the adapter into the PC.
Note: Starting with the Pi 4, it is possible to boot directly from a USB drive. This will not be covered in this tutorial.

Write the Raspbian image to the MicroSD

Open balenaEtcher, select your image file, then select the target device. Flash!


It's really that simple!

You should have a newly mounted partition labelled 'boot'. You'll need to add a file named 'ssh' to the root directory - this allows us to connect remotely on the first boot.

If you're using a wireless connection, create a wpa_supplicant.conf in the root directory as instructed on Setting WiFi up via the command line

You're done! It's time to insert the SD card into your Raspberry Pi and power it on for the first time!
If you're using a wired connection, you probably want to plug in your ethernet cable, too.

Connect via SSH, and set-up

It's important to find the IP of your Raspberry Pi, the easiest way is usually to log into your Router and search for your network device list. Once you have the IP address, open up your favourite terminal and connect via SSH.

The default username is pi, the default password is raspberry (we'll change this in the next step)

Once logged in, type the following commands:

sudo apt update checks and updates the list of available packages.
sudo apt upgrade installs the latest versions of installed software.
sudo raspi-config allows us to configure the Pi graphically, see the next section

raspi-config

The Raspberry Pi Configuration utility is the easiest way to update the Pi's settings.

  • Choose Update, this will ensure we're using the latest version of the utility.
  • Select Change User Password, making sure only you know the password.
  • Select Interfacing Options, SSH, then press Yes! We can now connect after each reboot.
  • Also in Interfacing Options, We should choose SPI (press Yes) - This is how the rPI will interface with our car.
  • Finally, Select Advanced Options, Expand File System. Once we restart, our filesystem will use the full capacity of our MicroSDXC card.
  • We're done! select Finish, then press Yes when asked if you'd like to reboot now.
There are many other options available, some which may be helpful to you. I strongly recommend not touching the rest unless you know what you are doing. You can break things here that'll cause you to end up back at step 1.

Your Pi is now configured, and up-to-date. It can be accessed remotely after each reboot. That ends this tutorial.






Comments