Simon Monk
Raspberry Pi Cookbook
Raspberry Pi Cookbook
by Simon Monk
Copyright © 2014 Simon Monk. All rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.
O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are
also available for most titles (http://my.safaribooksonline.com). For more information, contact our corporate/
institutional sales department: 800-998-9938 or corporate@oreilly.com.
Editor: Rachel Roumeliotis
Production Editor: Melanie Yarbrough
Copyeditor: Nancy Reinhardt
Proofreader: Rachel Monaghan
Indexer: J
udy McConville
Cover Designer: Karen Montgomery
Interior Designer: David Futato
Illustrator: Rebecca Demarest
December 2013: First Edition
Re
vision History for the First Edition:
2013-12-06: First release
See http://oreilly.com/catalog/errata.csp?isbn=9781449365226 for release details.
Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly
Media, Inc. Raspberry Pi Cookbook, the image of a Eurasian sparrowhawk, and related trade dress are trade‐
marks of O’Reilly Media, Inc.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as
trademarks. Where those designations appear in this book, and O’Reilly Media, Inc., was aware of a trade‐
mark claim, the designations have been printed in caps or initial caps.
While every precaution has been taken in the preparation of this book, the publisher and authors assume
no responsibility for errors or omissions, or for damages resulting from the use of the information contained
herein.
ISBN: 978-1-449-36522-6
[LSI]
Table of Contents
P
reface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
1. Setup and Management. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1. Selecting a M
odel of Raspberry Pi 1
1.2. Enclosing a Raspberry Pi 3
1.3. Selecting a Power Supply 4
1.4. Selecting an Operating System Distribution 5
1.5. Writing an SD Card with NOOBS 6
1.6. Writing an SD Card Manually (Mac) 9
1.7. Writing an SD Card Manually (Windows) 10
1.8. Writing an SD Card Manually (Linux) 11
1.9. Connecting the System 13
1.10. Connecting a DVI or VGA Monitor 14
1.11. Using a Composite Video Monitor/TV 14
1.12. Using All the Storage on the SD Card 16
1.13. Adjusting the Picture Size on your Monitor 17
1.14. Maximizing Performance 19
1.15. Changing Your Password 21
1.16. Setting the Pi to Boot Straight into a Windowing System 22
1.17. Shutting Down Your Raspberry Pi 23
1.18. Installing the Raspberry Pi Camera Module 25
2. Networking. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.1. Connecting to a W
ired Network 31
2.2. Finding Out Your IP Address 33
2.3. Setting a Static IP Address 35
2.4. Setting the Network Name of a Raspberry Pi 36
2.5. Setting Up a Wireless Connection 37
2.6. Connecting with a Console Lead 38
iii