Preface - Raspberry Pi: A Quick-Start Guide, 2nd Edition (2014)

Raspberry Pi: A Quick-Start Guide, 2nd Edition (2014)

Preface

Over the past decades, computers have gotten cheaper and cheaper, so today you can find them not only at your desk, but also in nearly every consumer electronics device, such as smartphones and DVD players. Still, computers aren’t so cheap that you spontaneously buy one when shopping for your groceries. Usually, you carefully plan your next computer purchase, because you have to use it for a couple of years.

Computers like the Raspberry Pi will change the situation completely in the near future. The Raspberry Pi—or Pi, for short—is a full-blown desktop PC that costs only $35. You can connect it directly to the Internet, and it can display high-definition videos. Also, it runs Linux, so you don’t have to pay for an operating system. This makes the Pi probably the first throwaway computer in history.

Originally, the Raspberry Foundation[4] built the Pi to teach children how to program, so it comes as no surprise that the Pi is an excellent device for exactly this purpose. On top of that, you can use the Pi for many other exciting things. For example, you can turn it into a multimedia center, use it as a cheap but powerful web server, or play some classic games.

The Pi is also a great machine for experimenting with electronics. In contrast to many popular microcontroller boards, such as the Arduino, the Pi runs a full-blown operating system, and you can choose from a wide range of programming languages to implement your projects.

With cheap and small devices like the Raspberry Pi, a new era of ubiquitous computing has begun, and you can be part of it. This book will help you get up to speed quickly.

Who Should Read This Book?

This book is for everyone who wants to get started with the Raspberry Pi. Even if you have some experience with other computers, you’ll quickly see that the Pi is different in many regards, and this book will help you avoid the most common pitfalls.

You can choose from a variety of operating systems for the Pi, but this book’s focus is on Debian Linux (Raspbian), because it’s the most convenient choice for beginners. If you’ve never worked with Linux before, you should start with Appendix 1, A Linux Primer. Even if you’ve worked with Linux before, you still might learn a few things, because running Linux on the Pi is different in some ways.

Of course, you’ll get the most out of this book if you have a Raspberry Pi and follow all the book’s examples closely.

What’s in This Book?

The Raspberry Pi doesn’t come with a user guide, but in this book you’ll learn step by step how to get the most out of your mini-computer quickly. You’ll learn how the Pi’s hardware works, as well as how to run different operating systems and use the Pi for special purposes, such as turning it into a multimedia center.

Here’s a list of all the things you’re going to learn:

· The book starts with an introduction to the Raspberry Pi’s hardware. You’ll learn what the Pi’s connectors are for and which additional hardware you need to start the Pi for the first time.

· After you’ve connected all the necessary devices to your Pi, you need an operating system. Although the Pi is a fairly young project, you can already choose from several operating systems, and you’ll learn about their pros and cons.

· Installing an operating system on the Pi is quite different from installing an operating system on a regular PC. So, you’ll learn how to get Debian Linux up and running on the Pi.

· Debian Linux runs fine out of the box on the Pi, but to get the most out of it, you have to tweak a few configuration parameters. For example, it’s beneficial to set the correct layout for your keyboard. In addition, you’ll learn how to install, update, and remove software.

· The Pi’s hardware—especially its graphics hardware—is special in many regards. Depending on the display you’re using, you have to adjust some low-level settings for the Pi’s firmware. You’ll learn what settings are available and how to solve the most common firmware problems.

· To see what you can achieve with the Pi with a minimum of effort, you’ll turn it into a kiosk system. It will be able to display a set of static slides as well as live information from the Internet.

· At this point in the book, you’ll have used the Pi more or less in isolation, but now you’ll learn how to integrate it with networks. You’ll use the Pi for everyday tasks such as browsing the Web, you’ll make it accessible via Secure Shell, and you’ll even turn it into a full-blown web server. Also, you’ll learn how to share your Pi’s desktop with a PC, and vice versa.

· With the XBMC project, you can turn your Raspberry Pi into a multimedia center with ease. Not only can you show your photo collections to your friends in your living room, but you can also play music in all popular formats, and you can watch your favorite movies and TV shows in high definition.

· The Raspberry team originally built the Pi for educational purposes, but you can easily use it to play some entertaining games. Even though it’s possible to run some first-person shooters, you might prefer some classic genres, such as interactive fiction and point-and-click adventures.

· One of the greatest advantages the Pi has over regular PCs is its GPIO pins. In the book’s final chapters, you’ll learn how to use them to attach your own electronics projects to the Pi.

· The Pi’s homogeneous hardware makes it easy to create additional hardware. The Raspberry team has released a camera, for example, that works perfectly with the Pi; you can easily integrate it with your own projects.

· The appendix contains a short introduction to Linux. If you’ve never worked with Linux before, you should read the appendix before you start with Chapter 3, Configure Raspbian.

Where Can I Get a Raspberry Pi and Additional Hardware?

In the beginning, only two distributors in the UK produced and sold the Raspberry Pi: Farnell[5] and RS Components.[6] Today, you can buy a Pi from many other stores, such as Adafruit,[7] SparkFun,[8] and Maker Shed.[9] These shops also sell many accessories for the Pi, such as power supplies, keyboards, mice, and so on.

You can find a growing list of compatible hardware on the project’s wiki,[10] but when in doubt, it’s better to buy hardware from one of the vendors mentioned here.

Debian Linux

The most popular operating system for the Pi is Linux. Several Linux distributions are available for the Pi, and we chose Debian. In May 2013 the Debian team froze the latest version, named wheezy, and because of the great efforts of the Raspbian team,[11] it became quickly available for the Pi. Raspbian supersedes Debian squeeze, which was the reference operating system for the Pi for a long time.

The Raspbian distribution has many advantages over all of its predecessors. It is much faster, it has more recent software, and it is more stable. Also, it’s the preferred solution of the Raspberry team, so this book’s focus is on Raspbian.

Code Examples and Conventions

In this book you’ll find a few code examples written in PHP, Python, HTML, and the programming language of the Bash shell. They’re all very short, and if you’ve done some programming before, you’ll have no problem understanding them. If you haven’t developed software before, you’ll still be able to copy the code to the Pi and make it run.

Footnotes

!

[4]

http://www.raspberrypi.org/

[5]

http://www.farnell.com/

[6]

http://www.rs-online.com/

[7]

http://adafruit.com/

[8]

http://sparkfun.com/

[9]

http://makershed.com

[10]

http://elinux.org/RPi_VerifiedPeripherals

[11]

http://www.raspbian.org/