Introduction

For such a small computer, the Raspberry Pi has made a big impact since its initial release in 2012. Priced at just $35 ($20 for the Model A+), the credit card–sized computer is an easily customizable, affordable computer and also has been used for countless creative projects by do-it-yourselfers. The Raspberry Pi is simple to use, it’s open source, and it can be manipulated to do all sorts of different things. At a glance, it’s just an inexpensive computer that runs an operating system based on Linux, but it’s truly so much more.

The Raspberry Pi was initially created as a fun and inexpensive educational tool to get kids interested in computer programming. The setup process alone—getting this basic computer hooked up to peripherals, the internet, and power—teaches you a bit of programming, and the fact that it’s a little difficult to use at first means you learn some basic computer-related skills by just getting it to turn on. Over time, the most popular operating system for the Raspberry Pi, Raspbian, has expanded to include a massive toolkit of software that helps further teach programming and a basic understanding of computer science.

The Raspberry Pi still meets its initial goal of education, but its popularity has expanded far beyond just children as adults are getting a ton of use out of it as well. In fact, the DIY electronics movement latched on to the Raspberry Pi when it was first released, resulting in the little device being nearly impossible to purchase for the first few months because it was sold out everywhere.

Since the initial release, we’ve seen a few models of the Raspberry Pi. The Model A+ is a simple, affordable version great for low-power projects, while Models B and B+ add a few extra USB ports and more RAM. The Raspberry Pi 2 ups the processing power and RAM of the B+ while maintaining the design and USB ports.

The DIY movement loves the Raspberry Pi for myriad reasons, but the big one is familiarity. Unlike other similar computer boards released before, the Raspberry Pi is capable of running Linux, an operating system that’s familiar to many people. Sure, Linux isn’t Windows or Apple’s OS X, but you can boot it up and understand how it works within a few moments, especially if you have prior experience with the other systems. This is a far cry from other boards like the Arduino that require a much more hands-on programming approach to use.

In this book, you learn everything there is to know about the Raspberry Pi, starting with its history and creation and including a wide variety of projects that aim to teach you how to use your Raspberry Pi in different ways. Throughout the course of these projects, you explore how to use and manipulate Linux, compile software, do some light programming, and build everything from a home security system to a private music streaming device.

For example, one of the most popular Raspberry Pi projects is a media center. With just a little bit of setup, you can use your Raspberry Pi to watch live video, stream movies, and do just about everything else a set-top box like a Roku or Apple TV can do. In fact, media centers are such a popular use for the Raspberry Pi, you can find numerous different operating systems to run it.

Likewise, you have alternatives for basic operating systems to run if you’re looking for a straightforward computer to use. Raspbian is the most popular operating system—and it was built just for the Raspberry Pi—but it’s not your only choice. You can search for other builds of Linux or even find versions of Raspbian created for specific projects. Examples include an operating system built for people who want to control robots, lightweight distributions that get rid of all the fluff, and just about anything you can think of. And if you’re really interested in messing around, you can even emulate old operating systems like the Commodore 64 or MS-DOS.

Choice is a big part of the Raspberry Pi’s success. Because the software is open source, you tend to have a lot of flexibility in what you can do with it. In this book, you learn one way to turn your Raspberry Pi into a music streaming device, but it’s certainly not the only way to do it. In fact, you almost always have several other possibilities available.

The Raspberry Pi runs Linux, so that means any software built for Linux can work on the Raspberry Pi. You can opt for just what you want to use for software and customize your Raspberry Pi however you like.

That flexibility extends to other facets of the Raspberry Pi as well. Pretty much any Wi-Fi adapter will work with this device, as will just about any keyboard. You can even skip all that and access your Raspberry Pi remotely if you want. It’s really up to you, and unlike software like Windows or OS X, nothing is closed off. You have access to every single little thing the Raspberry Pi can do at all points, and you can tinker with it as you see fit.

In this book, you’re going to do a lot of different projects, and sometimes you’re probably going to mess things up a little. Unlike Windows or OS X, making mistakes is okay. The Raspberry Pi is built so the operating system runs off an inexpensive SD card, so if you make a significant goof-up, all you need to do to start over from scratch is make another copy of the SD card. This is great for beginners and advanced tinkerers alike because the cost of failure isn’t that high.

If you follow the lessons in this book closely, you’ll complete a project, but individual set-ups, changes to small amounts of code, or even just a quirk in your own home network will give you the opportunity to explore beyond the pages of this book to discover more things you can do with the Raspberry Pi. That’s part of this device’s appeal. There’s not necessarily one right way to do things, so you’ll constantly be learning about different methods and other tricks.

What’s more, you have a huge community of people to talk to about any problems that come up as you get creative with your Raspberry Pi. Countless websites, forums, and news stories are available to guide you through any troubles you might have. You’ll even be able to talk with Linux experts for help. You have a pretty big resource in the community of people who love the Raspberry Pi, and by the end of this book, you’ll be a contributing member to that community as well.

It’s easy to discount the Raspberry Pi as a hobbyist’s play toy, or just a fun little gimmick. However, once you get into it and start building things for yourself, you’ll realize just how much you can do with it. The Raspberry Pi is great for a lot of projects, but things will really start to get interesting once you have an understanding of how it works and you start developing your own uses for it. Every day, someone out there is coming up with a clever new use for their Raspberry Pi. Hopefully, by the end of this book, you’ll be an active member in the Raspberry Pi community, making all types of projects on your own and sharing them with people across the world.

Collaboration is a big part of the Raspberry Pi, and you’ll likely be doing a lot of it moving forward. You can tackle everything in this book on your own, but it’s a lot more fun when you’re working with others to solve problems and expand on the projects included here. You’ll get a lot more out of the Raspberry Pi when you share and work with other people.

The Raspberry Pi is about fun. Sure, its main goal is to provide an inexpensive computer to anyone in the world, but you can do so much more than that with it.

How This Book Is Organized

This book is divided into four parts. Each part is meant to familiarize you with different aspects of the Raspberry Pi:

Part 1, Getting Started with Your Raspberry Pi, covers the inception of the device, introduces you to the foundation that created it, explains what the device is typically used for, and shares other basics about its history and creation alongside its technical details. This part provides the foundation for everything you’ll learn in subsequent parts.

Once you get through the history, you move on to getting your Raspberry Pi up and running. In Part 2, Setting Up Your Raspberry Pi, you learn how Linux works, how to use the command line, and how to install operating systems on your Raspberry Pi. The Raspberry Pi is pretty easy to use, but it does require some basic computer know-how. By the end of this part, you’ll have the skills you need to move forward.

Once you get your Raspberry Pi set up, it’s time to start actually making things with it. Part 3, Raspberry Pi Projects, is all about projects you can complete with your Raspberry Pi. In these chapters, you use your Raspberry Pi to build projects ranging from a set-top media box to a home security system. With each project, you learn something new about programming, Linux, DIY culture, and the Raspberry Pi itself. By the time you finish the projects, you’ll be well on your way to creating and defining your own.

Finally, Part 4, Going Further with Your Raspberry Pi, shows you a number of ways to really push your Raspberry Pi beyond what’s covered here. The Raspberry Pi can be used for countless projects, and it’s impossible to cover them all in one book. Beyond simply running a copy of Linux, you can attach your Raspberry Pi to other peripherals, robots, and more. Chances are, once you finish the projects in Part 3, you’ll want to do more. This final part gives you the toolkit for doing just that.

Extras

Throughout this book, you’ll come across a number of different sidebars. These are meant to further your understanding of the Raspberry Pi or the project you’re working on. Here’s what to look for:

DEFINITION

Definitions help clarify a complicated term or phrase.

HARDWARE HELPER

In these sidebars, I share more information about the various accessories you can attach to your Raspberry Pi.

PI POINTER

Pi Pointers give you additional tips and tricks or helpful workarounds.

SOFTWARE SOLUTION

These sidebars share some notes on software you might want to try on your Raspberry Pi.

Online Bonus

Throughout the book, I share code you can type in at the command line to get your Raspberry Pi to do different things. Some of these code excerpts are rather long, so as a bonus to the book, we’ve included the longer bits of code (3 lines or more) you’re asked to type in on our website. When you see this icon in the book, point your browser to idiotsguides.com/raspberrypi, and copy and paste the appropriate code.

Acknowledgments

I’d like to thank everyone who directly or indirectly contributed to my finishing this book, fed me when I was too busy to eat, patted my back at the right time, or forced me to take breaks when I was pulling out my hair trying to get my Raspberry Pi to do what I wanted: my parents, Joe Flores, Bryan Danknich, Jen Betterly, Brian Ernst, and Tuyet Nguyen. Likewise, I couldn’t have done it without my co-workers, Whitson Gordon, Alan Henry, and the rest of the staff at Lifehacker.

Special Thanks to the Technical Reviewer

Idiot’s Guides: Raspberry Pi was reviewed by an expert who double-checked the accuracy of what you’ll learn here, to help us ensure this book gives you everything you need to know about making the most of your Raspberry Pi. Special thanks are extended to Kyle Prier.

Trademarks

All terms mentioned in this book that are known to be or are suspected of being trademarks or service marks have been appropriately capitalized. Alpha Books and Penguin Random House LLC cannot attest to the accuracy of this information. Use of a term in this book should not be regarded as affecting the validity of any trademark or service mark.