The Research Experience for Teachers Program /
http://www.cs.appstate.edu/ret

Activity Title: “Setting up the Raspberry Pi”

Introduction/Motivation:

Schools tend to use and teach in a Microsoft Windows environment; however, many jobs, and post-secondary schools use and work in Linux and UNIX environments. Necessary skills to navigate, use, and work with Linux and UNIX based systems are needed as many courses in computer science, networking, web administration and others require skills in Linux and UNIX systems. The Raspberry Pi is a unique tool to help generate interest in computer science and the Linux Operating System.

Procedure:

Background:

The Raspberry Pi is a small credit card / wallet sized computer system developed to teach computer science.

Preparation:

You should assemble the components for the Raspberry Pi and check that all cables and peripheral connections are established.

Lab Activity:

1.  Familiarize yourself with the Raspberry Pi and its I/O ports.

Figure 1 – The Raspberry Pi (from the top)

Wireless NIC (Not installed) and Camera (Not Installed)

Figure 2 – Sound Port (blue), RCA Video (Yellow), GPIO (Pins)

Figure 3 – HDMI Interface to connect to a Display

Figure 4 – SD Card Port (Bottom of the Raspberry Pi) and Power Connector (Right Side)

Figure 5 – Hard Wired Networking (Left) and 2 USB Ports (Center)

Raspberry Pi Assembled in Optional Enclosure (Notice the SD card on the Bottom Right)

2.  Connect Appropriate Cables and Assemble your Raspberry Pi. Do not install the SD Card or plug in the power cable.

3.  Find the SD card, and place it in the card reader in your laptop or desktop card reader so that the Operating System Image can be copied to the SD card. This step may not be necessary if your PI came with a PRE-Loaded Image. Check your documentation. If your card is PRE-Imaged skip steps 4-7. The following steps are for Windows based imaging of the SD Card. You will need other directions to use a Linux or MAC computer to create your SD Card. Use the links at the bottom of this document to find directions for using “dd” on UNIX based systems.

4.  Download and Install the following software to your laptop or desktop.

a.  https://www.sdcard.org/downloads/formatter_4/ Formatting Tool for SD Cards

b.  http://sourceforge.net/projects/win32diskimager/ Software to copy the Image to the SD Card. The image will not work if copied directly to the SD Card.

5.  Download the latest Raspberry Pi Raspbian Image. http://www.raspberrypi.org/downloads

6.  If your Raspbian Image download is a .ZIP file, extract it into a directory/folder.

7.  Find the drive letter of your SD card and then format it using the SD Card Formatting Tool. Set "FORMAT SIZE ADJUSTMENT" option to "ON" in the "Options" menu in the Formatting tool before formatting the SD Card. Choose the correct SD card from the list. Be sure to format the correct drive as this will erase the contents of the drive.

8.  Then run the Win32diskimager software and follow the on screen directions to prepare the SD Card with the Raspbian Image. Be sure to point the image to the correct destination drive and click to start the process to place the image onto the SD Card. This may take some time. Your SD Card is now ready to eject, and place into the Raspberry Pi.

Booting the Raspberry Pi:

1.  Install the newly imaged SD Card into the Raspberry Pi.

2.  Plug in the power to the cable for Raspberry Pi. There is no ON/OFF button. As soon as you apply power, the Raspberry Pi will begin to boot to the Operating System.

3.  You will be prompted to answer questions about the Setup and Features, Language, Keyboard Type, etc. Answer each of the questions based on your setup needs.

4.  One of the questions will prompt you to have your Raspberry Pi boot directly to the GUI or to a command line. (Run Level 5 for GUI, Run Level 3 for command line.

5.  Your login name is Pi. And your password is raspberry.

6.  If you chose to boot directly to the command line, use startx to boot to the GUI.

7.  Should you need to use ROOT access privileges (Admin) you will need to use sudo and then the appropriate syntax for the command.

8.  Update your new install by doing the following at the terminal command line.

a.  sudo apt-get update This may take some time.

b.  sudo apt-get upgrade This may take some time.

9.  Install some editors for your command line to for programming. VIM is the most powerful of these.

a.  sudo apt-get install vim

b.  sudo apt-get pico

c.  sudo apt-get joe

10.  Add some programming languages to your PI. Python is installed by default.

a.  sudo apt-get install perl

b.  sudo apt-get install ruby

c.  sudo apt-get install gcc

d.  sudo apt-get install libstdc++6-4.6-dev (version may change…Google this if necessary)

11.  Some websites to get you started with Python, Perl, and Ruby.

a.  http://www.perl.org/docs.html

b.  http://www.ruby-lang.org/en/documentation/

c.  http://www.python.org/doc/

12.  It is possible to run several types of servers on your Raspberry Pi.

a.  Apache Web Server - http://elinux.org/RPi_Apache2

b.  XBMC Streaming Media Server – Google XBMC and Raspberry Pi for directions

13.  Other Images for the Raspberry Pi are available. Check the Raspberry Pi downloads page for other images to run on Raspberry Pi.

Vocabulary To Research:

1.  BGA: ball grid array.

2.  SoC: system on chip.

3.  GPIO: General purpose input/output.

4.  GPU: graphics processing unit.

5.  PXE: preboot execution environment.

6.  PoE: power over Ethernet.

Assessment

Pre-Assessment

  1. What features and limitations are available on the Raspberry Pi?
  2. Compare and contrast your laptop/desktop to the Raspberry Pi.
  3. Explain the pins and purpose of the GPIO.

Results/Conclusions

  1. What is an embedded system?
  2. List and explain some devices and uses for embedded systems.

Reference(s):

http://www.raspberrypi.org/

http://www.raspberrypi.org/quick-start-guide

http://elinux.org/RPi_Hub