Skip to main content
Chemistry LibreTexts

1.2: Preparing your Raspberry Pi for Class

  • Page ID
    205330
  • Hypothes.is tag: s2020IOSTc1mod2

    Learning Objectives

    Students will be able to:
    Content

    • Install Raspian Buster with Desktop on their RasPi without NOOBs.
    • Use the Advanced Packaging Tool to install, upgrade and remove software
    • Linux command line arguments

    Process

    • Install Buster Stretch with Desktop on their RasPi without NOOBs.
    • Update and upgrade the Raspbian Operating System
    • Set up Headless operation with VNC

    Prior Knowledge

    • Computer file systems
    • Download programs from web repositories.

    Further Reading

    The general overview of this module is that we are going to download Raspbian Sketch, then create an image of it on the microSD card.  Once we have the image we will boot up the Pi in Desktop mode and set up a user profile.  Then we will register the Pi to the UALR Wifi, and then set up VNC and connect to it in headless mode

     

    Download Raspbian Buster

    To download the latest version of Raspbian go to:

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

    clipboard_eb7fa683b961780a3c3d20a0667f37588.png

    Figure \(\PageIndex{1}\):  Raspbian download options as of 01/22/2019

    There are three options, and we will take the option of Raspbian Buster with desktop and recommended software.  If your school allows torrent download that is faster, but most campuses do not allow torrent and so you will need to download the zip file.  This may take a couple of hours, and if you are installing in class, you should do the download before coming to class

     

    Preparing your microSD Card

    In IOST module 1 you installed all the software on your computer that you need for this task.  Place a microSD card into a USB adapter sleeve and then place the USB into a USB port on the computer you set up in IOST module 1.

    clipboard_e52e67dcdd42b998ac74c5647e1b4fe5e.png
    Figure \(\PageIndex{2}\):  USB adaptor sleeve for microSD card

    Format microSD Card

    This step will show you how to use the SD Card Formatter to format the microSD card.  This will clear all data on the card, and be sure you format the microSD card and not your hard drive!

     

    1.  From Start Menu, choose SD Card Formatter (you can click through the windows icon and scroll through the Apps to SD Association, or type in the search menu "sd" and the sd card formatter will autoappear

    clipboard_eeedd7ddfaa0c8898e11c95e081f3ec02.pngFigure \(\PageIndex{3}\):  Two ways to activate SD Card Formatter from Windows Start Menu. Scrolling through the Apps (left image) or using Start menu Search option (right image).

    2. Now that you have the SD Card Formatter open you can go and format your microSD card.  Now be sure NOT TO FORMAT the C drive.  Figure \(\PageIndex{4}\) shows screenshots of this process.

    clipboard_ea9758ebcd2b847e65796152458aaf228.png

    Figure \(\PageIndex{4}\):  Screenshots of formatting the microSD card with SD Card Formatter. (1) Check to be sure which drive your microSD card is in (2) Use quick format and make sure you are formatting the drive identified in step 1 (you do not want to format your computer's hard drive!). (3) The warning statement that formatting a drive will erase all data in the drive.  (4) The formatting complete message, you are now ready to place an image of Raspbian on your micro SD card

    UnZip Raspbian

    You now need to go to the folder you downloaded the Raspbian Zip file to.  This is a very large Zip file and WinZip can not handle it, and so you need to use another program like 7-Zip, which you installed in the first module (section 1.1.4).  Note, the Zip file was not placed in the default Window's download folder but a folder called Installation files, and in it was a subfolder for Raspbian and in that a subfolder identifying the date it was downloaded.  It is probably good practice not to unzip files in the default download folder, but make additional folders that help you organize the material you have downloaded.  Many people also tend to delete zip files once downloaded, but you may want to save this one because it took so long to download, which would make it easier in the event you need to transfer it to another computer.

    clipboard_ed7d7d8c17b6470b43a81f1de955d95c7.png
    Figure \(\PageIndex{5}\): Screenshots of using 7-Zip to unzip the zip file and generate a Disc Image File. (1) Right-Click the zip file, choose 7-Zip/Extract Here. (2) Screenshot showing file being unzipped. (3) Disk Image File has now been placed in folder.

    You now have the image of a Disc operating system that you will need to transfer to the micro SD card.

    Writing Image to microSD Card

    You will now use Win32DiskImager to write the Raspbian Image to your microSD card.

    clipboard_ef318e1d69e208a043a2abf69e7b2edf8.pngFigure \(\PageIndex{6}\): Screen capture of steps involved in writing Raspbian image to micro SD card.

    Figure \(\PageIndex{6}\) goes over the steps involved with writing an image of the Raspbian operating system to your Pi.

    1. Insert USB adaptor into USB port of computer with the downloaded Raspbian image.
    2. Start Win32DiskImager
    3. Click the blue icon (step 3.a) and open the unzipped image (step 3.b).  Make sure the device is the folder the USB adaptor is attached to (E in figure \(\PageIndex{6}\).  Set Hash to None and click write.
    4. A confirmation window opens and click yes after checking that the device you are writing to is the correct target (E here).
    5. The image will now be transferred to the microSD card.  Note, this may take some time (6:24 minutes in the above figure).  Once it is complete you should get a message stating: "Write Successful" and you are now ready to transfer the micro SD card to your Raspberry Pi and start it up.

    Starting your Pi the First time

    The first time we start the Pi will be in Desktop Mode, where we will set up the preferences and get the system MAC address so that we can remotely access the Pi through VNC.   Before we connect the monitor, keyboard and mouse we need to install the microSD card.  Figure \(\PageIndex{7}\) shows the correct and incorrect way to install the SD card.

    clipboard_e868347b493fab72cd65643c1b3d21624.png
    Figure \(\PageIndex{7}\): Insert the micro SD card into the Pi before connecting monitor, keyboard and mouse.

    Figure \(\PageIndex{8}\) shows a Pi in desktop mode.  Note, the last thing you should connect is the power supply.

    clipboard_ea9aeac5c5b54f105b9389ab34b98460f.png
    Figure \(\PageIndex{8}\):  Raspberry Pi in Desktop Mode

    Turn the Pi on and you will be taken through a startup menu.  Follow the instructions.  

    clipboard_e825c74958595b54066cfa86b235300b9.png
    Figure\(\PageIndex{9}\): If you live in Little Rock Arkansas choose US, American English and Chicago as your time zone.  Also click "Use US Keyboard".  then enter a new password as everyone has the same default password (raspberry

    Proceed through the setup menu, when you get to update software you should skip it if you are in the class as we do not have time, but do it if you are logged in and doing this from your home.  In the next section we will learn how to update the software from the command line, and you can do that from home.

    clipboard_e68ded4aeb59007e0d02bd6289747dc3d.png
    Figure \(\PageIndex{10}\): Do not update the software if you are doing this during class as we do not have enough time.  

     

    Now that the Pi has been setup you can go to preferences and double check your configuration.

     

    clipboard_e4e52c5eb87269e8792c91e2997b8c167.png
    Figure \(\PageIndex{11}\): 

     

    1. Set Country:  Choose United States, American English, Chicago (if you are in Little Rock), and click "Use US Keyboard".

    clipboard_e1134697fbab3cbef5abb87f12d69a96a.pngFigure \(\PageIndex{12}\):

     

    Accessing Pi through VNC Viewer

    Now that you have your Pi up and running you want to remotely access it (in Headless mode) through VNC viewer, which you installed on your laptop or desktop (section 1.1.6).  If you are at UALR you need to do this through the IOT WiFi network (not UALR WiFi or guest WiFi) and to do that you need to register your MAC address, which is covered in section 5.1.  

    Section 5.3 has instructions for running your Pi in headless mode through VNC and section 5.4 on adjusting the screen resolution.