DEV Community

Cover image for Get started with Raspberry Pi and start hacking
Cynthia HENAFF
Cynthia HENAFF

Posted on • Originally published at cynthiahenaff.com

Get started with Raspberry Pi and start hacking

Since 2022 I have been lucky enough to have a garden and I love to watch the plants and shrubs grow and the birds fly by. Spending my time looking out of the office window inspired me to come up with a project idea: a time-lapse camera. Usually, I would have gone with an Arduino or an ESP with a camera module. However, this time, I wanted to test and train myself with the Raspberry Pi. So, I'm taking this opportunity to share with you the basics and the new knowledge I acquired during this time.

What is Raspberry Pi?

Raspberry Pi logo<br>

The Raspberry Pi is a series of credit-card sized mini-computers (except for a few models I'll talk about below), designed in the UK in 2012 by the Raspberry Pi Foundation. The purpose of this computer was originally to promote computer science education in schools by providing a cheap and easy-to-use computer. Since its creation, it has become a worldwide success with developers, tinkerers and technology enthusiasts in general.

Indeed, the Raspberry Pi has everything to please:

  • small size
  • attractive price
  • low-power consumption
  • many electronic inputs/outputs
  • Wi-Fi, Bluetooth
  • HDMI, USB
  • ...

It is used in many projects, from a computer for yourself or a child, to a home file server, a NAS, a home automation control device, or even a media player on the TV and a retro gaming console.

Different models of Raspberry Pi

There are currently several Raspberry Pi models on the market, each with different features and uses. Here is a non-exhaustive list of the most popular models.

Raspberry Pi 4

The latest model. It is the most powerful model in the range and is recommended for performance-intensive applications such as development or streaming gaming.

Raspberry Pi 4

Raspberry Pi 400

This new Raspberry is a computer built right into the keyboard!

Raspberry Pi 400

Raspberry Pi 400 kit

Raspberry Pi 3

A slightly less powerful model than the Raspberry Pi 4, but still very powerful. It is recommended for applications requiring fewer resources, such as web development or home automation.
Raspberry Pi 3

Raspberry Pi Zero

The smallest and cheapest model in the range, equipped with Wi-Fi and Bluetooth.

It is recommended for DIY projects and applications that do not require high performance.

Raspberry Pi Zero

Raspberry Pi Zero 2 W

The latest model, identical to the Raspberry Pi Zero but five times faster.

Raspberry Pi Zero 2 W

It is important to choose the most suitable Raspberry Pi model for your needs based on performance and functionality.

Why are Raspberry Pi prices so high at the moment?

The price of the different models of Raspberry Pi is normally between 10 and 40€, however at the moment stock-outs are more and more observed and the prices are almost twice as high, but why?

This is mainly due to a shortage of semiconductors, i.e. the electronic chips that make up our computers (transistors, processors, RAM, graphics units, etc.). This shortage is due to the high demand for laptops, tablets and other electronic devices, which has increased sharply with the advent of remote working and lock-ups. The Raspberry Pi, which is a cheap microcomputer, is particularly affected by this shortage, as it has a low profit margin and uses partly older, and therefore cheaper, technology. As a result, the foundation that produces the Raspberry Pi is struggling to find chips at affordable prices or in sufficient quantity.

Setting up your Raspberry Pi

The Raspberry Pi documentation is known to be very comprehensive, accessible and regularly updated. It is available online at the official Raspberry Pi website and covers a wide range of topics, from installing the OS to using different devices and accessories.

The documentation is well-structured and easy to navigate, making learning about the Raspberry Pi affordable for everyone, whether you are a beginner or an experienced user.

In addition, there is an active community of Raspberry Pi developers and users who share their knowledge and experience on the internet, which can be an excellent source of further assistance.

Getting started

A minimum of hardware is required to get started with the installation of your Raspberry Pi. You will need :

  • A Raspberry Pi
  • A sufficiently powerful power supply for the Raspberry Pi
  • A microSD card
  • A USB SD card reader

Configuring the Raspberry Pi with Raspberry Pi Imager

To install our Raspberry Pi, we will use the Raspberry Pi Imager software which you can now download and install.

https://www.raspberrypi.com/software/

Once you have completed this first step, connect your microSD to your computer and launch Raspberry Pi Imager.

Raspberry Pi Imager

Operating System

First of all, you will have to choose the OS that will be installed on your microSD. Several Operating Systems (OS) will be proposed to you, which we can divide into two categories:

The type of OS

  • Lite: this is an OS with a headless environment, i.e. no desktop environment. When you boot your Raspberry, you will only have access to a terminal. This very light OS version is recommended for all server applications. In other words, if you don't plan to plug a keyboard/mouse and monitor into your Raspberry, this is the distribution you need.

  • Full: This is a desktop distribution with some “recommended” applications already installed. It is ideal if you want to use your Raspberry as a work computer, browse the internet…

  • If nothing is specified, it is a desktop OS.

OS in 32-bit or 64-bit versions. Overall, the 64-bit versions will be more powerful. All Raspberry computers support 32-bit OS. However, only the Raspberry Pi 3B, 3B+, 3A+, 4, 400 and Zero 2 W support 64-bit OS.

For my project, I chose to use the 64-bit Raspberry Pi OS Lite version.

Storage

For Storage, you simply need to select the microSD you have connected to your computer.

Raspberry Pi Image - Advanced options button

Advanced options

Many options are available in the advanced settings:

  • Hostname
    This is the name of your Raspberry Pi. I advise you to leave the default value, which is raspberrypi.local.

  • SSH
    This option allows you to connect to your Raspberry Pi remotely via SSH. I recommend that you enable SSH. If you know what an SSH key is, put in your own. If you don't know what it means, put a password. WARNING : with the LITE version, you must activate SSH; otherwise, you will need a screen and a keyboard connected to your Raspberry!

  • User
    If, like me, you use a Lite OS, it is essential to create a user on your Raspberry. You need to enable this option by adding a username and password. If you are using a desktop distribution, you will be able to create your user when you first boot your Raspberry.

  • Wi-Fi
    This option allows you to connect your Raspberry directly to your Wi-Fi by filling in the SSID and password of your Wi-Fi. It is also possible to connect your Raspberry to the Internet via an Ethernet cable if you would rather not use Wi-Fi. You can also set the Wireless LAN country if it does not match yours. However, I strongly advise you to set it via the selector and not to write it directly in the input. I have lost a few hours of my time with a Raspberry that did not connect to Wi-Fi, because spaces had been inserted behind my country code.

  • Finally, you can set the timezone of your Raspberry and the keyboard layout if you want to use a keyboard connected directly to your Raspberry.

As an example, here is my configuration for my project.

Raspberry Pi Imager - Advanced options

Now that your configuration is done, you can press the Write button, which will launch the installation of your OS on your microSD. This may take a while depending on the type of OS you choose.

Once finished, you can insert your microSD into your Raspberry Pi and plug in the power supply. You will need to wait a few minutes for your Raspberry Pi to boot up, and it will be accessible either by connecting a monitor and keyboard to it, or by SSH if you have opted for this solution.

Connecting to your Raspberry Pi via SSH

If you have set up your Raspberry Pi correctly by setting up SSH and a User in Raspberry Pi Imager, here are the steps to follow.

To begin, in your terminal, try pinging your Raspberry Pi with the following command:

ping raspberrypi.local
Enter fullscreen mode Exit fullscreen mode

If you changed the hostname during configuration on Raspberry Pi Imager, you need to replace raspberry.local with your-hostname.local.

For example, in my case, it will be monsieurrizpi.local (see config above).

The ping command should return something like this:

PING raspberrypi.local (192.168.1.131) : 56 data bytes
64 bytes from 192.168.1.131: icmp_seq=0 ttl=255 time=2.618 ms
Enter fullscreen mode Exit fullscreen mode

If it does not ping, wait a few more minutes. It may not have finished booting.

Once it pings you can connect to it via SSH with the following command:

ssh pi@raspberrypi.local
Enter fullscreen mode Exit fullscreen mode

You must replace pi by the username defined during the configuration on Raspberry Pi Imager and raspberrypi.local by the hostname of your Raspberry if you had modified it.

By default, the user defined is pi

For example, in my case, I use the following command:

ssh cynthia@monsieurrizpi.local
Enter fullscreen mode Exit fullscreen mode

Depending on the authentication mode chosen during configuration, you will be asked for your password or passphrase.

Starting your project

Your Raspberry Pi is now installed and ready to use. It's time to get started on your project or just use it as a computer.

I'll be back soon with a new article about the development of my time-lapse camera project.

If you are looking for an idea or a project, I recommend some websites with tutorials and interesting projects.

Top comments (0)