The Raspberry Pi is a brand of inexpensive single board computer popular with the students and hobbyists. What is unique about a Pi is that it can be easily customized to many different applications. This is unlike most consumer devices that only do one thing and cannot be modified. Over five million of these popular devices have been sold, as of 2015.
Common uses for the Raspberry Pi include: home theater video player, network file server, retro video game player, low power desktop computer, weather station, time lapse camera and International Space Station student & astronaut experiment platform. Click on the links to learn more about these uses.
The Pi uses a SoC (System on a Chip), in which one chip performs many functions. In the past, these were performed by separate chips. SoCs are found in phones, TVs, stereos, cars and home appliances. The Pi 3 uses an ARM Cortex-A53 BCM2837 SoC chip.
As of early 2017, the most advanced model is the Pi3. It has Bluetooth and WiFi, which are big upgrades over previous models. The SoC determines, to a great extent, the capability of each Pi model. Shown below is a chart of the current generation Pis. There are lots of other versions of the Pi, not shown here.
Getting Started with a Raspberry Pi using Raspbian, Part 1
There are many ways to get started with the Raspberry Pi. In this example, we will install an operating system on running on Pi’s micro SD card. The operating system is a port of Debian Linux called Raspbian (Raspberry Pi + Debian Linux). The Raspbian operating system is free and recommended by the Raspberry Pi Foundation.
Assuming you have a computer running Microsoft Windows, here is a list of items you need that relate to your Windows computer:
- Computer running Microsoft Windows with micro SD Card read/write ability
- an SD to micro SD adapter is probably going to be required. This should have been sold with your micro SD card
- Win32diskimager and 7-Zip installed on Windows computer
- Raspbian Jessie image file, unzipped and saved on windows computer
- refer to: https://www.raspberrypi.org/downloads/raspbian/
- Note: At the time of this post, there are two images shown. They are Lite or with Pixel. If you are note sure which to use, download the Pixel version.
- Ethernet Connection and network cable
- Part 2 of this post will require a USB drive formatted for use with Windows that have the files you want to access via network
- Note: If you are using a 3 Amp power supply, use can connect a portable USB powered hard drive directly to the Pi’s USB port
The following materials you will have to buy. Stay away from “kits”, they usually have lower grade parts sold at a higher cost.
- Raspberry Pi 3 (2, B+ or Zero may also be used depending on your application)
- Appropriate case for your Raspberry Pi
- 3 amp micro USB power cord
- Note: Use a Pi approved 3 amp power cable, don’t use a phone charger
- Why? A used phone charge setup may work on your phone, but it might not be reliable enough for the Pi. Loose connections and power dropouts are common causes of problems with the Pi.
- 32Gb Class 10 micro SD card
- Note: Use a new card and don’t buy a high end or larger capacity card
- Why? The weakest link on this system is the SD Card. They are slower and less reliable than USB or SSD drives. Once your system is working OK, a good next step is to move the operating system to a USB or network drive and make the SD card read only.
A good first project is to set up a headless server. It’s a very useful first project with the Raspberry Pi. Headless means that there is no GUI (Graphical User Interface) for the operating system. The Raspbian GUI is called Pixel. This is not to be confused with Google’s Pixel Android Smartphones of the same name.
A server is a computer designed to always be powered on and connected to a network. It can share files from a connected USB drive and perform monitoring/reporting/network tasks. Compared to a desktop or laptop computer, the Pi draws very little power. So it can be left on all the time and all year round.
The ready to use headless server image on https://www.raspberrypi.org/downloads/raspbian/ is the Raspbian Jessie Lite Minimal image. Depending on your application and hardware, it might make more sense to install the Raspbian Jessie with Pixel and then turn off the GUI during initial configuration.
If you are building a headless server running on a B+ or a zero, it will probably make more sense to use the Lite version because Pixel runs more slowly on this hardware. If you have a Pi3 that you aren’t sure what to use it for yet, go ahead and install the with Pixel version. Either way it’s not that critical, you can always turn off the Pixel GUI or install the missing GUI files later as needed.
Step 1: Download the appropriate image file from https://www.raspberrypi.org/downloads/raspbian/
- Optional: Check that the file downloaded correctly by using the Microsoft File Checksum Integrity Verifier. You can use that tool to compute the SHA1 cryptographic hash for the file you downloaded and compare it to the SHA-1 file shown on the downloads page
Step 2: Write the image by following the instructions on the following page: https://www.raspberrypi.org/documentation/installation/installing-images/windows.md
Step 3: Plug in the SD Card, wired ethernet connection, HDMI monitor and USB keyboard.
- Why? Even if you are running a headless server over WiFi, it’s easiest to do the initial configuration with a wired connection, monitor and keyboard.
Step 4: Plug in the power supply and boot up the Pi to the command prompt for Lite or the Pixel desktop. Make sure you have a good internet connection. This can be accomplished by sending a ping command (Lite) or opening a web browser (Pixel).
- Note: If you are running Pixel, note that the environment defaults to a German style keyboard. Update your settings in preferences. Then, make sure to start an instance of Terminal for the next step
Step 5: From the command prompt, type the following:
sudo apt-get update && sudo apt-get upgrade -y --fix-missing
- Note: Raspbian ships an image that has broken links and obsolete files. This will cause major problems later, so make sure run updates often. Add the fix missing switch (the dashes in the command indicate switches being activated or options being enabled) if you are getting “failed to fetch” or “broken mirror” errors.
Step 6: It will take several minutes for the previous step to complete. The terminal window will scroll through the numerous operating system updates. They should complete successfully. Next, from the command prompt, type the following:
Step 7: Referring to this webpage: https://www.raspberrypi.org/documentation/configuration/raspi-config.md
Follow the instructions below (item numbers are the raspi-config menu numbers):
- 8. Update → make sure to run this update
- 1. Change password → default password is “raspberry” and not changing this leaves open a major vulnerability
- 5. Interfacing options → enable SSH to connect to your headless server over the network from your Windows computer
- 2. Change hostname → give your Pi a unique name that you will easily recognize.
- 3. Boot options → your server will need 24/7 network access, so change Wait for network to “yes”
- 4. Localization options → set up your timezone and keyboard
- 4. Localization options → if you are in the USA, set your locale to en us utf-8 and none
- Select Finish and Reboot
Step 8: Find out how to log into your home network router from your Windows computer in order to see what devices are attached. Shown below is an example of this screen. This will be needed for the next part of this post.
Conclusion: Now your Pi is updated and ready for Part 2. The password has been changed, the operating system has been updated, the time zone and other items are set. Part 2 will detail the remote set up of a headless server and how to share a USB drive over your network!