First Steps with your Raspberry Pi

Suparna S Nair
Secure and Private AI Writing Challenge
7 min readAug 16, 2019

Udacity Secure and Privacy AI Challenge

Hurray!

Congratulations on being the proud owner of Raspberry Pi! 👏

If you are a beginner and maybe wondering, “err… what should I do next?” you have ended up in the right place!

Here in this tutorial, I will take you through the detailed steps on how to set up your RPi (Raspberry Pi) and connect to it, through your laptop. To be precise, I will walk you through the following:

  • Install the Raspbian Operating System in RPi and configure it
  • Connect to the Pi via SSH (Secure Shell) over Ethernet or WiFi 😅

This article assumes no previous knowledge on Raspberry Pi’s.

So let’s begin the new chapter in your journey through the world of IoTs!

What’s a Pi?

Rasbperry Pi is a single chip computer — in layman’s term, you can think of Raspberry Pi as a tiny computer. As with any computers, this Pi also needs an operating system to run. A newly ordered Raspberry Pi gets shipped with no Operating System. This needs to be installed manually via a MicroSD card.

Check-List

So put things in order, let’s first list down the parts we need to set this up!

  • A Raspberry Pi — version 3 B+ (older versions like Pi 3 B2 or Pi2 would also suffice, note that Pi2 does not support WiFi, but the other 2 versions do).
  • A microSD card, preferably over 16GB.
  • SD Card adapter (to flash OS onto microSD card from laptop)
  • A mouse (to explore the Pi of course!)
  • An HDMI cable to connect the Pi to the monitor
  • An Ethernet cable to connect to your Pi using your laptop (must for Pi2, for newer versions, you can use the WiFi feature as well!)
  • A keyboard (to change the password maybe?)
  • 2A micro USB Power Adapter (to power up the Pi)
  • A monitor to view the graphical interface
The check-list!

Installing the OS

The Operating System for RPi can be fetched from the official site of Raspberry Pi:

https://www.raspberrypi.org/downloads/

Scroll down to see the download links to different OSes for Pi, one for Windows IoT, and various flavors of Linux OS (Ubuntu, Debian, Fedora etc.). Don’t get overwhelmed with the wide range of options! As a beginner, let’s stick on to Raspbian. During the time of writing this article, the latest version is “Buster”.

The download page for Raspbian

Download the ZIP file for the full version of Raspbian Buster (Raspbian Buster with Desktop and recommended software). The downloaded file will be an image file (.img). Image file is a disc image file created by various disc imaging applications. It stores an exact copy of data which you would store in a CD or DVD. Here, this would be the entire OS.

Download the full version of Raspbian

The OS of Pi needs to be present in its memory. So this file needs to be flashed into the microSD card.

Preparing the microSD card

Before flashing the OS into microSD card, make sure it is formatted.

SDFormatter is a great tool to format SD cards. This utility is a simple, self-explanatory tool. So go ahead and download it from this LINK and format your microSD card.

Flashing Raspbian OS into microSD card

Now that the microSD card is ready, let’s flash the image file onto it.

Again, there are several tools available out there for performing this step. Personally I have used Etcher, Win32DiskImager and Rufus.

Let’s use Etcher for now. Download etcher from this LINK and install it.

  • Launch Etcher.
  • Select the image file to be flashed.
  • Select the target (here, the microSD card drive)
  • Click on Flash to flash the image onto the microSD. There you go!
Balena Etcher Application

This would take a while (around 10–15 minutes).

Once flashing is complete, your microSD card is equipped with Raspbian Buster 😊

Powering up the Pi & Launching the OS

Now let’s power up the Pi with the OS loaded and see it launch for the first time!

  • Connect the HDMI cable from the Pi to the monitor
  • Load the microSD card in the Pi’s slot
  • Connect the keyboard to the USB slot of Pi
  • Connect the mouse to the USB slot of Pi
  • Plug the Pi with a 2A adapter though the micro USB slot
  • Turn on the power supply.
microSD card slot of Pi
Connect everything in place!
Final Step: Power Up!

Voila! You will see the Raspbian OS loading in the monitor and a desktop screen finally appears within few seconds.

Booting up the Raspbian OS of Pi

Congratulations again! You have successfully powered up your Pi with the OS running!

Configuring the Pi for the first time

When Pi launches the first time, you will be prompted by a Configuration wizard.

Configuring Raspberry Pi for the first time

Go through the screens and click on ‘Next’. At the end you will be prompted to change the password.

Enabling SSH

Now that the Pi is ready, you can do a myriad of things with it. The Pi will look like a Linux OS, but with limited features. You have a terminal to type in your commands, Games, Office suite (Libre office) and a lot more cool applications. You can explore the Pi through the Graphical interface using the mouse and keyboard. But what if you need to access your Pi via the shell without using the monitor, keyboard or mouse, directly from your laptop/PC?

This would need you to connect to the Raspberry Pi by some means. One such option is to use SSH to connect to Pi from your laptop via the Ethernet cable. So let’s get started with it!

The first step in connecting to Pi via SSH is to enable SSH in Pi!

  • Go to the Pi icon => Preferences =>Raspberry Pi Configuration
Raspberry Pi configuration
  • Click on Interfaces tab => Check the radio button for SSH (If you do not have a monitor, you can view the GUI via VNC, at which point you will have to enable VNC as well, but let’s not go into that at the moment).
  • Click on OK
Enabling SSH

The second step in connecting to Pi via SSH is to identify the IP address of the RPi.

  • Connect your raspberry pi to the laptop via Ethernet cable
  • Launch terminal from Pi (Pi icon=> Accessories => Terminal, or you might have a terminal icon on the task bar on top)
Opening terminal in Raspberry Pi
  • Type in the following:
hostname –I
  • You will get the IP address of the Pi

Now, this IP address will change based on the network you are in. Currently, you have created a local network between your laptop and the Pi. In case you connect your laptop and Pi over a network router, this IP address would be different. We will discuss this in detail when we access internet connectivity for the Pi.

Logging into Pi via SSH from laptop

The last and final step is to connect to Pi via SSH!

  • Open an SSH client like PuTTy (download from HERE).
  • Type in the IP address under host name and click on Open.
SSH via PuTTy to RPi from laptop
  • You will get the following warning message when you do this for the first time. Click Yes.
  • Yaay! You get the login prompt in the PuTTy’s session. Type in the username (by default, this is pi) and the password (by default, this is raspberry, unless you have changed it).
  • You should get the following screen in the terminal.
Login Success!

Voila! You have successfully logged into your Pi from laptop via SSH!

Congratulations! You have successfully achieved a milestone in your RPi journey. Time to grab a coffee! ☕

In the next series, I will walk you through accessing internet in your Pi so that you can install and update packages or simply browse the web from the Graphical interface!

--

--

Suparna S Nair
Secure and Private AI Writing Challenge

An artist and tinkerer by passion, a software engineer by profession!