Table Of ContentAbout This eBook
ePUB is an open, industry-standard format for eBooks. However, support of ePUB and its many
features varies across reading devices and applications. Use your device or app settings to customize
the presentation to your liking. Settings that you can customize often include font, font size, single or
double column, landscape or portrait mode, and figures that you can click or tap to enlarge. For
additional information about the settings and features on your reading device or app, visit the device
manufacturer’s Web site.
Many titles include programming code or configuration examples. To optimize the presentation of
these elements, view the eBook in single-column, landscape mode and adjust the font size to the
smallest setting. In addition to presenting code and configurations in the reflowable text format, we
have included images of the code that mimic the presentation found in the print book; therefore, where
the reflowable format may compromise the presentation of the code listing, you will see a “Click here
to view code image” link. Click the link to view the print-fidelity code image. To return to the
previous page viewed, click the Back button on your device or app.
®
Hacking Raspberry Pi
Timothy L. Warner
800 East 96th Street,
Indianapolis, Indiana 46240 USA
Hacking Raspberry Pi®
Copyright © 2014 by Que Publishing
All rights reserved. No part of this book shall be reproduced, stored in a retrieval system, or
transmitted by any means, electronic, mechanical, photocopying, recording, or otherwise, without
written permission from the publisher. No patent liability is assumed with respect to the use of the
information contained herein. Although every precaution has been taken in the preparation of this
book, the publisher and author assume no responsibility for errors or omissions. Nor is any liability
assumed for damages resulting from the use of the information contained herein.
ISBN-13: 978-0-7897-5156-0
ISBN-10: 0-7897-5156-9
Library of Congress Control Number: 2013944701
Printed in the United States of America
First Printing: November 2013
Editor-in-Chief
Greg Wiegand
Executive Editor
Rick Kughen
Development Editor
Todd Brakke
Managing Editor
Kristy Hart
Project Editor
Elaine Wiley
Copy Editor
Chrissy White
Indexer
Brad Herriman
Proofreader
Kathy Ruiz
Technical Editor
Brian McLaughlin
Editorial Assistant
Kristen Watterson
Cover Designer
Chuti Prasertsith
Book Designer
Mark Shirar
Senior Compositor
Gloria Schurick
Graphics
Tammy Graham
Cover Illustration
©Kokander/Shutter Stock
©Yippe/Shutter Stock
Trademarks
All terms mentioned in this book that are known to be trademarks or service marks have been
appropriately capitalized. Que Publishing 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.
Warning and Disclaimer
Every effort has been made to make this book as complete and as accurate as possible, but no
warranty or fitness is implied. The information provided is on an “as is” basis. The author and the
publisher shall have neither liability nor responsibility to any person or entity with respect to any loss
or damages arising from the information contained in this book.
Bulk Sales
Que Publishing offers excellent discounts on this book when ordered in quantity for bulk purchases or
special sales. For more information, please contact
U.S. Corporate and Government Sales
1-800-382-3419
corpsales@pearsontechgroup.com
For sales outside of the U.S., please contact
International Sales
international@pearsoned.com
Contents at a Glance
Introduction
Part I Hardware Foundations
Chapter 1 What Is the Raspberry Pi?
Chapter 2 Hardware Components Quick Start
Chapter 3 A Tour of Raspberry Pi Peripheral Devices
Part II Software Foundations
Chapter 4 Installing and Configuring an Operating System
Chapter 5 Debian Linux Fundamentals—Terminal
Chapter 6 Debian Linux Fundamentals—Graphical User Interface
Chapter 7 Networking Raspberry Pi
Chapter 8 Programming Raspberry Pi with Scratch—Beginnings
Chapter 9 Programming Raspberry Pi with Scratch—Next Steps
Chapter 10 Programming Raspberry Pi with Python—Beginnings
Chapter 11 Programming Raspberry Pi with Python—Next Steps
Part III Basic Raspberry Pi Projects
Chapter 12 Raspberry Pi Media Center
Chapter 13 Raspberry Pi Retro Game Station
Chapter 14 Raspberry Pi Minecraft Server
Chapter 15 Raspberry Pi Web Server
Chapter 16 Raspberry Pi Portable Webcam
Chapter 17 Raspberry Pi Security and Privacy Device
Part IV Hacking the Raspberry Pi
Chapter 18 Raspberry Pi Overclocking
Chapter 19 Raspberry Pi and Arduino
Chapter 20 Raspberry Pi and the Gertboard
Index
Table of Contents
Introduction
What’s in This Book
Who Can Use This Book
How to Use This Book
Task: This Is a Task
There’s More Online...
Part I Hardware Foundations
Chapter 1 What Is the Raspberry Pi?
Why the Pi?
Hardware Versions
Is the Raspberry Pi Open Source?
Open Source Licenses
Open Source and the Raspberry Pi
How Can I Purchase a Raspberry Pi?
Chapter 2 Hardware Components Quick Start
Understanding Pi Hardware Terminology
The Hidden Cost of Owning a Raspberry Pi
A 5V Power Supply
SD Card
Powered USB Hub
Ethernet Cable
Monitor
Cables
USB Keyboard and Mouse
A Tour of the Model B Board
Networking
Video and Audio
Storage
Power/Status Information
Camera
Processing
Expansion
Next Steps
Chapter 3 A Tour of Raspberry Pi Peripheral Devices
Circuit Prototyping Equipment
Single-Board Microcontrollers
The Gertboard
Single-Board Computers
Relevant Technician Tools
Task: Check Raspberry Pi Voltage with a Multimeter
Raspberry Pi Starter Kits
Next Steps
Part II Software Foundations
Chapter 4 Installing and Configuring an Operating System
Common Operating Systems
Understanding Linux
Linux and Raspberry Pi
The Kernel and Firmware
Raspberry Pi’s Other Operating Systems
Installing Raspbian on Your Raspberry Pi
Task: Creating a Raspbian SD Card in Windows
Task: Creating a Raspbian SD Card in OS X
Task: Creating a Raspbian SD Card in Linux
An All-in-One Solution
Task: Installing an OS on Your Raspberry Pi Using NOOBS
Description:Task: Install and Configure Arduino IDE on the Raspberry Pi . inexpensive, the Raspberry Pi Foundation gives users a great deal of . can move beyond surface-level software and interact directly with the internals of what .. trouble finding an official distribution source regardless of where you liv