Teach Yourself VISUALLY Raspberry Pi 1118768191RPi

User Manual: 1118768191RPi

Open the PDF directly: View PDF PDF.
Page Count: 322

DownloadTeach Yourself VISUALLY Raspberry Pi 1118768191RPi
Open PDF In BrowserView PDF
You’ll learn to:
• Set up your Raspberry Pi®
• Select and install your OS
• Understand advanced commands
• Use Scratch, Python, and Pygame
• Add custom hardware

Raspberry Pi

®

ISBN:978-1-118-76819-8
52999

9 781118 768198

Computers/
System Architecture/General
$29.99 USA • $35.99 CAN • £21.99 UK

Wentk

www.wiley.com/go/tyvraspberrypi

®

• Two-page lessons break big topics into bite-sized modules
• Succinct explanations walk you through step by step
• Full-color screen shots demonstrate each task
• Helpful sidebars offer practical tips and tricks

Raspberry Pi

Front Cover Image & Cover Design: ©Wiley.

Are you a visual learner? Do you prefer instructions
that show you how to do something — and skip the
long-winded explanations? If so, then this book is for
you. Open it up and you’ll find clear, step-by-step screen
shots that show you how to tackle more than 140
Raspberry Pi tasks. Each task-based spread covers a
single technique, sure to help you get up and running
on Raspberry Pi in no time.

Richard Wentk

Raspberry Pi

Richard Wentk

®

Teach Yourself VISUALLY™ Raspberry Pi®
Published by
John Wiley & Sons, Inc.
10475 Crosspoint Boulevard
Indianapolis, IN 46256
www.wiley.com
Published simultaneously in Canada
Copyright © 2014 by John Wiley & Sons, Inc., Indianapolis, Indiana
No part of this publication may be reproduced, stored in a retrieval
system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright
Act, without either the prior written permission of the Publisher, or
authorization through payment of the appropriate per-copy fee to the
Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923,
978-750-8400, fax 978-646-8600. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley
& Sons, Inc., 111 River Street, Hoboken, NJ 07030, 201-748-6011, fax
201-748-6008, or online at www.wiley.com/go/permissions.
Wiley publishes in a variety of print and electronic formats and by printon-demand. Some material included with standard print versions of this
book may not be included in e-books or in print-on-demand. If this book
refers to media such as a CD or DVD that is not included in the version you
purchased, you may download this material at http://booksupport.wiley
.com. For more information about Wiley products, visit www.wiley.com.
Library of Congress Control Number: 2013954228
ISBN: 978-1-118-76819-8

LIMIT OF LIABILITY/DISCLAIMER OF WARRANTY: THE PUBLISHER AND
THE AUTHOR MAKE NO REPRESENTATIONS OR WARRANTIES WITH RESPECT
TO THE ACCURACY OR COMPLETENESS OF THE CONTENTS OF THIS WORK
AND SPECIFICALLY DISCLAIM ALL WARRANTIES, INCLUDING WITHOUT
LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE. NO
WARRANTY MAY BE CREATED OR EXTENDED BY SALES OR PROMOTIONAL
MATERIALS. THE ADVICE AND STRATEGIES CONTAINED HEREIN MAY
NOT BE SUITABLE FOR EVERY SITUATION. THIS WORK IS SOLD WITH
THE UNDERSTANDING THAT THE PUBLISHER IS NOT ENGAGED IN
RENDERING LEGAL, ACCOUNTING, OR OTHER PROFESSIONAL SERVICES. IF
PROFESSIONAL ASSISTANCE IS REQUIRED, THE SERVICES OF A COMPETENT
PROFESSIONAL PERSON SHOULD BE SOUGHT. NEITHER THE PUBLISHER
NOR THE AUTHOR SHALL BE LIABLE FOR DAMAGES ARISING HEREFROM.
THE FACT THAT AN ORGANIZATION OR WEBSITE IS REFERRED TO IN
THIS WORK AS A CITATION AND/OR A POTENTIAL SOURCE OF FURTHER
INFORMATION DOES NOT MEAN THAT THE AUTHOR OR THE PUBLISHER
ENDORSES THE INFORMATION THE ORGANIZATION OR WEBSITE MAY
PROVIDE OR RECOMMENDATIONS IT MAY MAKE. FURTHER, READERS
SHOULD BE AWARE THAT INTERNET WEBSITES LISTED IN THIS WORK
MAY HAVE CHANGED OR DISAPPEARED BETWEEN WHEN THIS WORK WAS
WRITTEN AND WHEN IT IS READ.
FOR PURPOSES OF ILLUSTRATING THE CONCEPTS AND TECHNIQUES
DESCRIBED IN THIS BOOK, THE AUTHOR HAS CREATED VARIOUS NAMES,
COMPANY NAMES, MAILING, E-MAIL AND INTERNET ADDRESSES, PHONE
AND FAX NUMBERS AND SIMILAR INFORMATION, ALL OF WHICH ARE
FICTITIOUS. ANY RESEMBLANCE OF THESE FICTITIOUS NAMES, ADDRESSES,
PHONE AND FAX NUMBERS AND SIMILAR INFORMATION TO ANY ACTUAL
PERSON, COMPANY AND/OR ORGANIZATION IS UNINTENTIONAL AND
PURELY COINCIDENTAL.

Manufactured in the United States of America

Contact Us

10 9 8 7 6 5 4 3 2 1

For general information on our other products and services please contact our Customer Care Department within the U.S. at 877-762-2974,
outside the U.S. at 317-572-3993 or fax 317-572-4002.

Trademark Acknowledgments
Wiley, Visual, the Visual logo, Teach Yourself VISUALLY, Read Less Learn More and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates. Raspberry Pi is
a registered trademark of the Raspberry Pi Foundation in the United
Kingdom and other countries. All other trademarks are the property of
their respective owners. John Wiley & Sons, Inc. is not associated with
any product or vendor mentioned in this book.

Sales | Contact Wiley at (877) 762-2974 or fax (317) 572-4002.

For technical support please visit www.wiley.com/techsupport.

Credits
Acquisitions Editor
Aaron Black
Sr. Project Editor
Sarah Hellert
Technical Editor
Paul Hallett
Copy Editor
Kim Heusel

Director, Content Development
& Assembly
Robyn Siesky
Vice President and Executive
Group Publisher
Richard Swadley

About the Author
Richard Wentk has been building, working with, and writing about
technology since the 1980s. He has had a lot of fun installing Raspberry Pi
boards around his home for music storage, remote heating control and
efficiency, and security. He is also an app developer and the author of a
number of books for developers and Mac users. For the latest news and
information, visit his site at www.zettaboom.com.

Author’s Acknowledgments
All books are a collaboration, and this one is no exception. I’d like to
thank Aaron Black for giving the green light to this project, Paul Hallet for
checking code and facts, and Sarah Hellert for making the transition from
copy to print as smooth as possible.
Extra special thanks are due to Annette Saunders for cake.

How to Use This Book
Who This Book Is For
This book is for the reader who has never used this
particular technology or software application. It is
also for readers who want to expand their knowledge.

The Conventions in This Book
1

Steps

This book uses a step-by-step format to guide you
easily through each task. Numbered steps are actions
you must do; bulleted steps clarify a point, step, or
optional feature; and indented steps give you the
result.

3

Icons and Buttons

Icons and buttons show you exactly what you need to
click to perform a step.
4 Tips
Tips offer additional information, including warnings
and shortcuts.
5

Bold

Bold type shows command names, options, and text
or numbers you must type.
6 Italics
Italic type introduces and defines a new term.

2 Notes
Notes give additional information — special
conditions that may occur during an operation, a
situation that you want to avoid, or a cross reference
to a related area of the book.
CHAPTER

Control an LED with a Button

Y
6

ou can breadboard a simple circuit around the Pi to control an LED with a button or switch.
Both components connect to the Pi’s GPIO (general-purpose input output) pins. To light an LED,
connect a GPIO pin to the LED, to a small resistor (220R to 470R) next, and finally to GND.

7 Place the switch into the breadboard

To use a switch, connect one end directly to GND. Connect the other end to a GPIO pin. You must
add a pull-up resistor that “pulls” the pin to 3V3 — that is, logic one, when it is not connected to
anything. Use a medium (4k7 to 10k) resistor.

8 Connect pin 13 to the top of the switch.

Control an LED with a Button
Note: You can find the code used in this
section on this book’s website, www.
wiley.com/go/tyvraspberrypi.
Note: These steps assume you have a
breadboard with power lines on at least
one side, and a collection of male-tofemale jumper leads.

1

Note: On a breadboard, the holes are
joined horizontally, except for the power
lines on either or both sides, which are
joined vertically.
1 Connect pin 1 (3V3) — the lower pin

at the far left — to one power line.
2 Connect pin 6 (GND) — the third pin

2

Adding Custom Hardware

from the left on the top row — to
another line.
Note: Use the diagram at www.modmypi.
com/blog/raspberry-pi-gpio-cheat-sheet
as a reference.
3 Connect pin 11 to a line on the

breadboard.
4 Plug the long leg of the LED into the

same line.
5 Plug the short leg of the LED into a

lower line.
6 Join that line to the GND power line

through a 330R resistor.

278

14

so that the two switch connectors are
over the break in the board.
9 Connect pin 13 to the 3V3 power line

via a 4k7 resistor.
Note: You can use any resistor from 4k7
to 10k.
10 Connect the other end of the switch

directly to 0V.
Note: Use a male-to-male jumper lead.
If you do not have one, cut the leg off a
resistor and use that.
11 Launch the desktop and IDLE.
12 Type the code shown, and save it to

a file called LED.py.
13 Open LXTerminal, type sudo python

LED.py, and press

.

3

The LED lights when you push the
switch.

Note: You must run the code as root with
sudo. You cannot run it from IDLE.
, type C exit(), and
Note: Press
press
to quit Python.

TIPS
Can I use any LED?
There are hundreds of LEDs in every color. Highbrightness LEDs are “tuned” to produce brighter
light. A standard LED will work, but it may not be as
bright. For more light, use a smaller resistor. Keep it
bigger than 220R to avoid burning out the LED or
your Pi.

My circuit does not work. What did I do wrong?
A common mistake is using the wrong GPIO pins.
Double-check using the online diagram mentioned
after step 2. Next, check that the LED is the correct
way around. Finally, check that you connected the
LED to GND and not 3V3, and that the order of
components is Pin, LED, Resistor, and GND.

279

5
4

Table of Contents
Chapter 1

Getting Started with Raspberry Pi

Introducing Raspberry Pi............................................ 4
Take a Tour of Raspberry Pi........................................ 5
Choose Accessories................................................... 6
Choose and Use a Case.............................................. 8
Connect a Monitor.................................................. 10
Connect USB Accessories.......................................... 12
Connect Power and Boot.......................................... 14

Chapter 2

Selecting an Operating System

Understanding OS Options........................................ 18
Prepare an SD Card.................................................. 20
Copy NOOBS to an SD card........................................ 22
Select and Install Raspbian Wheezy........................... 24
Back Up an SD Card................................................. 26
Get Started with BerryBoot....................................... 28

Chapter 3

Setting Up Raspbian

Set a Password....................................................... 32
Select a Keyboard Layout......................................... 34
Select a Time Zone.................................................. 36
Manage Memory and SD Card Options......................... 38
Set Up Overclocking................................................ 40
Connect to the Internet........................................... 42
Revise the Configuration.......................................... 43
Update the Operating System................................... 44
Launch the Desktop................................................ 46
Shut Down the Pi.................................................... 47

Chapter 4

Working with Applications

Introducing Raspberry Pi Apps.................................. 50
Set Up Wi-Fi........................................................... 52
View Web Pages...................................................... 54
Work with Files in File Manager................................. 56
Edit Text with Leafpad............................................. 58
Configure the Desktop............................................. 60
Configure the Launch Panel...................................... 62

Table of Contents
Chapter 5

Working with the Command Line

Introducing Linux................................................... 66
Using the Command Line......................................... 68
Become the Superuser............................................. 69
Understanding the File System.................................. 70
Navigate and List Directories.................................... 72
Create a Directory................................................... 74
Delete Files and Directories...................................... 75
View a File............................................................. 76
Find a File or Command........................................... 77
Copy, Move, and Rename Files.................................. 78
Work with File Permissions....................................... 80
Using the Command Line History............................... 82

Chapter 6

Understanding Advanced Commands

Understanding Advanced Linux................................. 86
Using the Nano Editor............................................. 88
Set Up Autologin.................................................... 90
Download and Install Applications............................ 92
Configure an Application.......................................... 94
Redirect Screen Output to a File................................ 96
Combine Commands with a Pipe................................ 97
Process Text with grep and sed................................. 98
Create a Simple Script............................................100
Run a Command at Set Times...................................102

Chapter 7

Networking Raspberry Pi

Understanding Networking......................................106
Set a Static IP Address...........................................108
Set Up ssh............................................................110
Using ssh for Remote Command Line Access...............111
Set Up Remote Access with VNC...............................112
Share Files with Samba...........................................114
Set Up a Simple Web Server.....................................116
Create a Simple Web Page.......................................118
Install PHP...........................................................119
Create a Smart Web Page........................................120
Send E-Mails.........................................................122
Get Started with curl and wget................................124
Put Your Pi on the Internet.....................................126

Chapter 8

Getting Started with Sound and Video

Understanding Media on the Pi................................130
Set Monitor Resolution and Overscan........................132
Set Up Audio.........................................................134
Play Video with omxplayer......................................136
License Extra Video Formats....................................138
Connect a USB Media Drive......................................140

Table of Contents
Chapter 9

Programming with Scratch

Understanding Scratch............................................144
Import a Costume..................................................146
Switch a Costume with Blocks..................................148
Create a Loop........................................................150
Move a Sprite........................................................152
Add a Bounce........................................................154
Check for Collisions................................................156
Respond to the Mouse and Keyboard.........................158
Edit a Costume......................................................160
Change the Stage Background..................................162
Play Sounds..........................................................164
Work with Variables................................................166
Using the Pen.......................................................168

Chapter 10

Getting Started with Python

Introducing Python................................................172
Launch IDLE..........................................................174
Work with Numbers................................................176
Create Variables.....................................................178
Get Started with Strings..........................................180
Split Strings..........................................................182
Pick Words from Strings..........................................184
Convert Strings and Numbers...................................186
Work with Files......................................................188
Create and Run a Python Script................................190

Chapter 11

Organizing Information with Python

Get Started with Lists.............................................194
Using List Methods................................................196
Explore Tuples.......................................................198
Work with Dictionaries............................................200
Understanding Repeats and Decisions.......................202
Make Decisions......................................................204
Work with Loops and Repeats..................................206
Understanding Functions and Objects.......................208
Create a Function...................................................210
Define a Class........................................................212
Using a Class.........................................................214
Load Modules........................................................216
Work with pickle....................................................218
Using the Debugger...............................................220

Chapter 12

Getting Started with Pygame

Introducing Pygame...............................................224
Create a Window....................................................226
Close a Window.....................................................228
Load a Background Image.......................................230
Read the Mouse.....................................................232
Respond to Keyboard Events....................................234
Scan the Keyboard.................................................236
Create a Timed Loop...............................................238

Table of Contents
Chapter 13

Creating Graphics with Pygame

Understanding Graphics and Animation.....................242
Understanding Sprites and Images...........................244
Get Started with Surfaces........................................246
Define Colors.........................................................248
Draw Shapes.........................................................250
Animate an Object.................................................252
Bounce a Shape.....................................................254
Draw Text with Fonts..............................................256
Load and Show an Image........................................258
Create a Sprite Class...............................................260
Check for Sprite Collisions.......................................262
Create a Breakout Game..........................................264
Share Your Games..................................................268

Chapter 14

Adding Custom Hardware

Understanding Electronics.......................................272
Using a Digital Multimeter......................................274
Set Up GPIO Control Software..................................276
Control an LED with a Button..................................278
Connect a Digital Temperature Sensor.......................280
Log Sensor Readings to a File..................................282
Graph Readings on a Web Page................................284
Connect a Real-Time Clock.......................................286
Create a Python Webcam.........................................288
Control a Relay......................................................290
Learn to Solder......................................................292
Create a Circuit on Stripboard..................................294
Understanding Further Options................................296

Index...................................................... 298

CHAPTER 1

Getting
Started with
Raspberry Pi
To set up your Raspberry Pi, you must choose essential extras and
connect them to your Pi. You can then power up your Pi for the first
time and begin setting it up.

Introducing Raspberry Pi .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . 4
Take a Tour of Raspberry Pi  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . 5
Choose Accessories  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . 6
Choose and Use a Case .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . 8
Connect a Monitor .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  10
Connect USB Accessories .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  12
Connect Power and Boot .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  14

Introducing Raspberry Pi

T

he Raspberry Pi is a tiny computer designed in the United Kingdom and sold around the world at
a very low price. The Pi ships as a bare circuit board with standard connections for a keyboard,
mouse, monitor, and power supply. You must add these extras yourself. To keep costs down, the Pi
uses an SD card, a small memory card, as a hard drive.
The Pi also includes extra connections you can use in your own electronic projects, and two software
applications, Python and Scratch, for learning programming.

Compare the Pi and a PC/Mac
The Pi is much less powerful than a PC or Mac. You cannot run Microsoft
Office on it. However, you can use it as a small media center and for
programming games. You can also create network-based projects such as
a web server, file server, or even a home automation system.

Understanding the Linux OS
As of summer 2013, some Pi kits ship with a tool called NOOBS (New Out of the Box Operating System)
which gives users a choice of operating systems. This book describes the most popular and best-supported
operating system — Raspbian Wheezy, a version of the popular free Linux operating system, often
represented by a penguin mascot known as Tux. Linux is more challenging and hands-on than Windows and
OS X, but is ideal for customization and for building hardware and software projects around the Pi. For
information about getting started with NOOBS, see Chapter 2, and return to Chapter 1 after you use NOOBS
to install Raspbian.

Compare the A and B Models
You can choose two models of the Pi board. The Model A has half the memory of
the Model B (256MB versus 512MB), lacks the B’s Ethernet network connector, and
has a single USB socket instead of the B’s stacked pair. It consumes a third less
power. Many users develop a project with a Model B and build the finished version
around a Model A.

A

B

4

• 256MB
• 0 x Ethernet
• 1 x USB

• 512MB
• 1 x Ethernet
• 2 x USB

CHAPTER

1

Take a Tour of Raspberry Pi

T

his tour shows the main connections and components of a Model B board.

A

Micro USB Power

Connects your RPi to an
external 5V power
supply.
B Composite Video
Jack

Connects your RPi to an
old TV using a legacy
composite video signal.
C

HDMI Socket

Connects your RPi to a
monitor or TV using a
modern HDMI signal.

3.5mm Audio
Jack
D

Connects your RPi to
headphones, ear buds,
or external speakers.
E

Ethernet Socket

Connects your RPi to a network.
F

Dual USB Socket

Two stacked sockets connect the
RPi to a keyboard, mouse, or
other accessories.

G

Status LEDs

Light up to display the RPi’s
power, network, and disk status.
H

GPIO Pins

Pins for general-purpose external
connections, including optional
add-ons and your own custom
electronics.

I

Camera Connector

Connects the RPi to an optional
camera board.
J

Display Connector

Connects the RPi to an optional
external LCD display.
K

SD Card Socket

The socket for the SD card, shown
here in blue, is under the board at
the right.

5

Choose Accessories

Y

ou must add a power supply, a keyboard, and a monitor or TV to your Pi. You can also add
a mouse, a camera, a case, and Wi-Fi and/or Bluetooth dongles — small plastic USB aerials.
With accessories, the total price of an RPi system is $50 to $105 (£35 to £80), excluding a monitor.
You may be able to use an existing spare USB keyboard and mouse. But not all USB accessories are
compatible. Check http://elinux.org/RPi_VerifiedPeripherals for user reports.

Select a Power Supply
Power your system with two 5V
power supplies — one for the Pi, and
USB Pi PSU 5V
one for an external USB hub. The Pi
uses a special micro-USB connector
for power, which is typically supplied
by a power adapter plugged into a
wall socket. A few phone chargers
have compatible plugs, but most do
not produce enough power. Do not power your Pi from a computer’s spare USB socket.

USB Hub PSU 5V

Add a USB Hub
Most accessories, including a keyboard, mouse, and
Wi-Fi dongle, can connect directly to the Pi. But
accessories sometimes draw so much power the Pi
stops working. For reliable results, connect
accessories through a USB hub — a box of extra USB
sockets. Its power supply should be rated 2A or more.

Esc

~
`

F1

Caps Lock
Shift

Ctrl

F2

@
2

!
1

Tab

Q

F3

#
3

E

S
Z

F5

%
5

R
D

X
Alt

F4

$
4

W

A

C

F7

&
7

O
K

M

:
;
>
.

Alt

F11

+
=

|
\

}
]

“
‘
?
/

F12

Backspace

{
[

P

L
<
,

F10

_
-

)
0

I

J
N

F9

(
9

U

H
B

F8

*
8

Y

G
V

F6

^
6

T
F

Print
scr
SysRq

Scroll
Lock

Pause

Insert

Home

Page
Up

NUM
Lock

Delete

End

Page
Down

HOME

Break

Enter
Shift

“
‘

/

*

8

7

-

9
PGUP

+
4

5

1

2

6

3
PGDN
ENTER

Ctrl
DEL

INS

USB Hub

Select a Keyboard
and Mouse
Most USB PC mice and keyboards
work with the RPi. Wireless makes,
such as Logitech, are likely to
work. You can use a Bluetooth
keyboard and mouse if you add a
Bluetooth dongle, but you cannot
set up Bluetooth without a
working keyboard.

6

Esc

~
`

F1

!
1

Tab
Caps Lock
Shift

Ctrl

F2

@
2

Q

F3

#
3

A

E

S
Z

F5

%
5

R
D

X
Alt

F4

$
4

W

F
C

F7

&
7

O
K

M

:
;
>
.

Alt

F11

+
=

|
\

}
]

“
‘
?
/

F12

Backspace

{
[

P

L
<
,

F10

_
-

)
0

I

J
N

F9

(
9

U

H
B

F8

*
8

Y

G
V

F6

^
6

T

Enter
Shift

“
‘

Print
scr
SysRq

Scroll
Lock

Pause

Insert

Home

Page
Up

NUM
Lock

Delete

End

Page
Down

HOME

Break

7

/
8

*

-

9
PGUP

+
4

5

1

2

6

3
PGDN
ENTER

Ctrl
INS

DEL

CHAPTER

1

Getting Started with Raspberry Pi

Select a Monitor
Although the RPi can connect to an old
TV through its composite video jack, the
HDMI (High-Definition Multimedia
Interface) connector produces a cleaner
and sharper digital signal. For good
results, connect the HDMI output to any
monitor or TV with an HDMI input. You
can also use a monitor with a DVI-D or
DVI-I input via an HDMI-DVI adapter
cable. Older VGA sockets are not directly compatible.

Buy an SD Card

4

GB

The Pi is designed to work with an SD card — a small plastic memory card — instead
of a hard drive. The card holds the Pi’s operating system (OS) and software. Beginners
should buy a card with the OS preinstalled. More experienced users can buy a blank
card, which you can choose from the list at http://elinux.org/RPi_VerifiedPeripherals,
and install the software using the instructions in Chapter 2.

SD

Buy a Bundle
4

GB

You can save time and money by buying an accessory bundle for your Pi. In the
United States, Newark (www.newark.com) supplies a range of Model A and Model
B bundles with prices from $45 to $105. In the United Kingdom, Maplin (www.
maplin.co.uk) supplies a Pi with a set of guaranteed extras for £79.99.

SD

Avoid Electronic Project Kits
Some Pi kits are collections of optional electronic components. Select a kit or
bundle with the items listed on these pages. Ignore kits with breakout boxes,
breadboards, jumper leads, switches, and LEDs. You can add these extras
when you have more experience with your Pi.

7

Choose and Use a Case

Y

ou can enclose your Pi in a case to protect it from accidents and improve its looks. A case for
your Pi is optional, but recommended. You can choose a case based on design and color, but for
electronic projects pick a case with easy access to all connectors, including the GPIO pins. Standard
cases are plastic boxes with connector holes. A more sophisticated option is a VESA mount case, with
four screws and a plate for mounting your Pi on the back of a TV or monitor with prefitted VESA (Video
Electronics Standards Organization) screw holes.

Choose and Use a Case
1 Open a web browser and visit

http://elinux.org/RPi_Cases
to view more than 50 case
options.
2 Review the cases.

You can either build a case
by following the linked
instructions, or buy one from
an online vendor.
Note: If you choose a prebuilt
case, the elinux page includes
links to vendors. You may have to
search again to find vendors for a
specific case in your country.
Note: This example uses a budget
case with a VESA mount bought
from Amazon.
3 Hold your Pi without

touching the circuit board.
Note: You can avoid touching the
board by holding the USB and
Ethernet connectors, or the sides
of the board. Do not squeeze too
hard.
4 Slot your Pi into the case.

8

CHAPTER

Getting Started with Raspberry Pi
A

1

If you do not have a VESA
case, position and tighten
the rear screws to close the
case.

Note: Some cases clip together
from a number of plastic layers
and do not use screws.

5 If you have a VESA case,

secure the mounting plate to
the rear of the case using the
screws.
Note: The screw heads are behind
the case in this photo. They fit
between the VESA plate and the
back of the monitor.
6 Position and tighten the four

finger nuts to mount the
case on the back of a
monitor with a VESA mount.
Note: You can also use a VESA
case to mount your Pi on a wall
or fix it permanently to furniture.
The Pi is now enclosed in a
case. If you used a VESA
mount case, it is also
mounted on the back of a
monitor.

TIPS
Do I need a case?
Electronic circuits are very sensitive to static
electricity. You can literally destroy your Pi by
wearing synthetics or walking on synthetic carpet
and touching the circuit board. A box helps protect
your Pi from static and from other accidental
damage.

What should I look for in a case?
Some cases are decorative, others are more practical.
If you plan to use your Pi for electronic projects, look
for a case with a slot for the GPIO, or general purpose
IO, connector. Cases that support the optional Pi
camera or an LCD screen are available but are not as
popular or easy to find as plain cases.

9

Connect a Monitor

A

lthough the Pi includes a composite video connector compatible with an old analog TV, this is
a nostalgic option and gives poor output. For best results, use a modern monitor or TV with an
HDMI connector. Most 19-inch or larger monitors capable of displaying a 1080p signal are compatible.
You can also use a slightly older monitor with a digital DVI connector if you use an optional cheap
converter or special cable. Both are easy to find on Amazon or eBay by searching for “HDMI to DVI.”
Note that cheap converter cables are usually identical to much more expensive ones.

Connect a Monitor
1 If you are using an HDMI to

HDMI cable, plug one end into
the HDMI socket on the Pi.

2 Plug the other end into the

HDMI socket on the rear of
your monitor or TV.
Note: When you apply power to
the Pi you may need to use the
OSD, or on-screen display, on the
monitor to select the HDMI
input. See your monitor’s manual
for details.

10

CHAPTER

Getting Started with Raspberry Pi

1

3 If you are using an HDMI-

to-DVI cable, plug the HDMI
connector into the HDMI socket
on your Pi.

4 Plug the DVI connector into the

DVI socket on the rear of your
monitor.
5 Tighten the thumb screws to

secure the connection.
Your Pi is connected to a monitor,
but is not yet powered up.
Note: When you apply power to the
Pi you may need to use the OSD, or
on-screen display, on the monitor
to select the DVI input. See your
monitor’s manual for details.

TIPS
Can I use a monitor or projector with a VGA socket?
HDMI is not compatible with VGA. You must convert
HDMI into VGA by passing it through an adapter box,
which can cost from $50 to $200 (£30 to £150),
depending on quality. Use HDMI or DVI if you can.
The image quality is better, and the cost is much
lower.

Can I use the composite video output to
connect a monitor or projector?
Composite video has even lower quality than VGA.
Use it as a last resort. You may need to
experiment with the Overscan setting on the
Setup Options screen to avoid black bars or
missing lines on a projector or TV.

11

Connect USB Accessories

Y

ou can connect USB accessories in two ways. On a Model B, you can plug a keyboard and mouse
into the two main USB connectors. This uses both free USB sockets, so you cannot connect other
items. It may also make your Pi less reliable.
For better results, connect all accessories to a USB hub with an independent power supply, and then
connect the hub to the main USB socket on your Pi. You can do this with both A and B models. Note
that the micro-USB socket on the Pi is for power only; you cannot connect a hub to it.

Connect USB Accessories
1 Plug the hub’s power adapter

into a wall socket (mains
socket).
Note: You may want to use a
power strip with an optional
surge protector for reliability.
Note: Do not connect the power
from the adaptor to the hub yet.

2 Connect the keyboard to your

hub.
3 Connect the mouse to your

hub.
4 Plug the Wi-Fi dongle into

the hub, if you have one.

12

CHAPTER

Getting Started with Raspberry Pi

1

5 Connect the hub to the USB

socket on the Pi.
Note: Hubs typically have a cable
that ends in a flat, or A type,
USB connector. Plug this into the
Pi’s USB socket.

6 Connect the hub to its power

supply to turn it on.
Note: The power connector and
socket on your hub may look
different.
The USB hub is powered up,
but the Pi is not yet running.

TIP
Can I use two hubs at the same time?
Yes. If you have an unusually complicated collection of accessories, you can use two different hubs, as long
as both have separate 2 amp power supplies. Plug each hub into a separate USB socket on the Pi. Note that
this is only possible on a Model B. Alternatively, you can buy hubs with eight or even more sockets, but two
separate hubs are more likely to work reliably and provide enough power.

13

Connect Power and Boot

T

he Pi does not have a power switch. You can power it up by turning on the power to its power
supply and plugging the micro-USB cable into the corresponding socket on the Pi.

The Pi boots, or sets itself up so it is ready to work, within 30 seconds. It displays a stream of text on
the screen as it works through its boot sequence, which is a list of steps it works through as it gets ready.

Connect Power and Boot
1 Plug the Pi’s USB power

supply into the wall socket
(mains socket) or a power
strip if you are using one.
Note: Some supplies include a
built-in light to show that power
is on.

2 Plug the other end of the

power cable into the microUSB socket on the Pi.
Note: The socket is tiny and
slightly stiff. Insert the plug
carefully, without forcing it.
Note: The Pi does not have a
power switch. The micro-USB
connector can be fragile. For extra
reliability, choose a power supply
with an A-type USB socket. You
can then use a micro-USB to
A-type cable to plug and unplug
power at the socket, or via an
optional A to A extender.

14

CHAPTER

Getting Started with Raspberry Pi
A

1

The Pi’s power LED lights.
The other LEDs may flash.

Note: For more information about
the LEDs, open a web browser
and visit www.raspberrypi.org/
phpBB3/viewtopic.
php?f=24&t=6952.

B

If you connected a monitor,
it shows the Pi’s boot
sequence, a long list of
messages displayed by the Pi
as it launches its operating
system.

TIPS
How do I know when boot has finished?
The first time you boot your Pi, it displays a configuration and
setup screen. Thereafter, the Pi displays a login prompt that asks
you to sign in with your username and password. When you log in
correctly, it displays a system prompt — the computer name of the
Pi, your username, a tilde (~), and a dollar sign ($). The system
prompt shows your Pi is ready to respond to keyboard commands.

Can I unplug the power to power off?
Unplugging the power without shutting
down can corrupt the data on the
memory card, and your Pi may not boot
again. Instead, follow the power down
steps in Chapter 3.

15

CHAPTER 2

Selecting an
Operating
System
Unlike a PC or a Mac, a Raspberry Pi can run many operating systems.
The recommended OS, described in the rest of this book, is called
Raspbian Wheezy. You can experiment with other OS options by
installing them on an SD card.

Understanding OS Options .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  18
Prepare an SD Card  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . 20
Copy NOOBS to an SD Card .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  22
Select and Install Raspbian Wheezy  .  .  .  .  .  .  .  .  .  .  .  . 24
Back Up an SD Card .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . 26
Get Started with BerryBoot .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  28

Understanding OS Options

B

efore you can use your Pi, you must install an operating system, or OS, on an SD card. If you are
assembling your own Pi system, you can use a free software application called NOOBS, or New Out
of Box Software, to select an OS from a list and install it on a card. Older Pi kits included SD cards
with Raspbian Wheezy preinstalled. Newer kits include cards with NOOBS preinstalled; you must use
NOOBS to set up Raspbian Wheezy before you can use your Pi.

Understanding NOOBS
Because many users could not understand how to install an OS
on a blank SD card, the creators of the Pi produced NOOBS to
make the process simpler. NOOBS works in four steps. First,
prepare an SD card. Next, download NOOBS, unzip it, and copy
the files it holds to your card. Plug the card into your Pi, and
apply power to start the Pi running, which is called booting
the Pi. When NOOBS launches, select an operating system from
a list built in to NOOBS and install it on the card. Finally,
NOOBS restarts, or reboots, your Pi automatically, and the Pi
launches the OS you installed on the card. You can then begin
working with your operating system.

Pi
e
roy
ar
r
ftw
x S
bfe
) i
Bo
p
S
P
s Out O
rry
w
be
OB
Ra
sp
Ne
a
O
R
o
t
N
( sert in
ll

1)

In

2)

a
S
g
st O
in
In her oot
to ll ot e b
a
hil
st
w
In
n
/
M
R
ow
all

oo st
y
Ch e-In Ke

To

ld
ho

R

You cannot install Windows or OS X on your Pi. Instead, the Pi works well with an
alternative OS called Linux, which is free, highly customizable, and available in a
number of different distros, or distributions. NOOBS includes three general Linux
distros designed to work with your Pi called Raspbian Wheezy, Archilinux, and
Pidora. This book is about Raspbian Wheezy. Archilinux and Pidora are more
experimental and not recommended for beginners.

Most Linux distros are for general computing. But some are
more specialized and designed to do one job well. A distro
called XBMC turns any compatible computer into a media
center and includes software for playing, downloading,
streaming, and managing video and audio files. NOOBS
includes two versions of XBMC created for the Pi — RaspBMC
and OpenELEC. Either can turn your Pi into a powerful media
player. XBMC is not covered in this book. You can find out
more at http://xbmc.org/about.

18

d

- A
y
x
ez
u
he
W EC
n
ia
EL
b
A
sp pen ora
a
C
R
O
ID
M
T

IF

SH

Understanding Linux Choices

Understanding Media Center Choices

S

O

se

h

rc

in

L

P

pB

as

R

S

cO

is

R

CHAPTER

Selecting an Operating System

2

Understanding Other OS Choices
As of summer 2013, NOOBS includes one OS that is not based on Linux. RiscOS is an updated version of a
British desktop operating system developed during the late 80s and early 90s, and supports an optional
package of productivity software called NutPi, which sells for $50 (£35). RiscOS is not covered in this book.
You can find out more at www.riscosopen.org/content.

Understanding the Recovery Option
Because the Pi is designed for education, you can experiment freely with applications and settings. Some
mistakes can trash an operating system and stop it working. NOOBS includes a recovery option to rescue you
if you ever need to start from scratch: Boot while holding down
to relaunch NOOBS, wipe your SD
card, and reinstall an OS. Note this option wipes all the data and settings on the card.

Understanding Card Swapping
In theory you can use NOOBS to create a
Raspbian
openELEC
RiscOS
collection of SD cards with different operating
systems. When you want to transform your Pi
into a different computer, you can power it
down, remove one SD card, plug in another,
SD
SD
SD
and apply power again to reboot. In practice,
the Pi’s SD card connector is not robust enough
for regular swapping, and it can become
unreliable after a few tens of swaps. You can
experiment with different OS options on different cards to a limited extent, but enthusiastic card swapping
is not recommended.

GB

Raspbian

GB

4

SD

RiscOS

4

GB

BerryBoot is an alternative to NOOBS for more experienced
users. With BerryBoot you can install multiple operating
systems on a single card. You can pick a different OS
whenever you reboot, which makes your Pi more useful
and avoids physical card swapping. You can also use
BerryBoot to install operating systems on more robust
media, such as hard drives and USB flash drives. When you
gain more experience with Linux, you can customize the
list of operating systems available with BerryBoot.

4

SD

openELEC

4

GB

Understanding BerryBoot

GB

4

GB

4

SD

19

Prepare an SD Card

Y

ou can prepare an SD card for use with NOOBS by downloading and running a free application from
the website of the SD Association. Different versions of the application are available for Macs and
PCs, but they do the same job and are set up in a similar way.
Technically, you prepare a card by formatting it. This takes a few minutes and erases all the
information on the card. You can format and reuse the same card more than once, but if you repeat
the process many tens of times the card may become unreliable.

Prepare an SD Card
On a Mac
1 Connect a card reader and insert an

SD card.
2 Open a web browser and visit www.sdcard.

org/downloads/formatter_4/eula_mac.
Note: If you cannot find version 4 of the
formatter, check www.sdcard.org/
downloads to find the most recent version.
3 Click I Accept.

Your browser downloads the file.
4 Navigate to the PKG file in Finder,

double-click it, and follow the steps
to install the application.
5 Open your Applications folder and

double-click SDFormatter.app.
6 If you have more than one card or

USB stick connected, click the Select
Card menu and select your SD card.
7 Click Option.
8 In the Logical Address Adjustment

dialog, click Yes (

changes to

9 Click OK to confirm.
10 Click Format.

The tool takes a few seconds to
format the card.

20

)

CHAPTER

Selecting an Operating System

2

On a PC
1 Connect a card reader and insert an

SD card.
2 Open a web browser and visit www.

sdcard.org/downloads/formatter_4/
eula_windows.
Note: If you cannot find version 4 of the
formatter, check www.sdcard.org/
downloads to find the most recent version.
3 Click I Accept.

Your browser downloads the file.
4 Navigate to the file, right-click it, and

select Extract All to unzip it to a folder.
5 Open the folder, double-click setup.

exe, and follow the steps to install
the application.
6 Navigate to the SDA folder in Program

Files and double-click SDFormatter.exe.
7 If you have more than one card or USB

stick connected, click Drive and select
the letter corresponding to your SD card.
8 Click Option.
9 Select ON.
10 Click OK to confirm.
11 Click Format.

The tool takes a few seconds to
format the card.

TIPS
Does the speed of the card matter?
SD cards come in four speeds, labeled 2, 4, 6, 10 and UHS (Ultra High
Speed). Faster cards are more expensive and can be less reliable. All cards
should work with the Pi, but the 6-speed is a good trade-off between cost,
speed, and reliability. Because of hardware limitations, the Pi’s card slot
cannot make full use of faster speeds. Some users suggest always using
10-speed cards, but it is not clear if this genuinely improves reliability.

Do I have to give the card a
name?
No. Leave the name field
unchanged when you use the
formatting application.
NOOBS does not need a
named card.

21

Copy NOOBS to an SD card

Y

ou can download NOOBS for free from the Raspberry Pi support site. Unzip it to reveal a collection
of files. To install NOOBS on a card, use Windows Explorer or Finder to copy all files to the card.

Finder on the Mac and some unzip tools on a PC create a new folder when you unzip NOOBS. Do not
copy the folder to your card. Copy the files in the folder.

Copy NOOBS to an SD Card
1 Follow the instructions in the

previous section to prepare an SD
card; leave it plugged in to your
computer.
2 Open a web browser and visit

http://downloads.raspberrypi.org/
noobs.
Note: If you see a File Not Found
message, repeat step 2.
NOOBS should begin to download
automatically.
A

If nothing happens, right-click
Direct Link and select Save link
as, Download Linked File.

3 On a Mac, open Finder.

Note: In Windows, skip to step 6.
4 Navigate to the download location

and find the NOOBS Zip file.
Note: The usual location is the
Downloads folder. If you have
customized your browser to save to a
different folder, look there instead.
Note: The name of the NOOBS file
includes the version number, for
example, NOOBS_v1_2_1.zip.
5 Double-click the file to unzip it.
B

22

Finder unzips the contents of the
file to a new folder.

CHAPTER

Selecting an Operating System

2

Note: On a Mac, skip steps 6 to 8.
6 On a PC, open Windows Explorer

and navigate to your Downloads
folder.
7 Right-click the NOOBS file and

select Extract All.
C

You can change the destination
folder.

8 Click Extract.
9 Open a new window in either

Finder or Windows Explorer.
Note: This example shows Finder on
a Mac.
10 Navigate to the SD card.

Note: If you did not set a name for the
card, the name appears as NO NAME.
11 Select all the files in the unzipped

NOOBS folder and drag them to the
empty SD card.
Note: Copy the files in the folder. Do
not select and copy the folder itself.
12 Eject the card.

Note: On a Mac, click the eject triangle
next to NO NAME in Finder. On a PC,
open Computer or My Computer in
Windows Explorer, right-click the drive,
and select Eject.

TIPS
Is there any difference between
copying NOOBS on a PC or Mac?
There is no practical difference.
Finder on the Mac creates a
hidden file on the card, but
NOOBS ignores this file.

What do I do if I have a card with Raspbian Wheezy preinstalled?
Ignore the instructions in this chapter. Simply plug the card in to your
Pi and apply power. When Raspbian boots, see Chapter 3 to begin
configuring it. Optionally, you can install NOOBS on a different card
to experiment with the other OS choices. This book describes
Raspbian only.

23

Select and Install Raspbian Wheezy

Y

ou can use NOOBS to select and install an OS on an SD card. NOOBS runs the first time you power
up your Pi after preparing an SD card on your Mac or PC and inserting it into the Pi’s card slot. In
NOOBS, you can select an OS and install it on the card.
NOOBS does not run again unless you force it to. When you reboot, your Pi launches the OS you
picked. But if you hold down
on your keyboard while rebooting, NOOBS displays its recovery
option. You can use this option to wipe the contents of your card and install another OS.

Select and Install Raspbian Wheezy
Note: NOOBS requires a USB hub, a
mouse, and a power supply. Work
through Chapter 1 if you have not yet
bought these items and connected
your Pi to them.
1 Plug the card you created in the

previous sections in this chapter in
to your Pi.
Note: The card slot is under the Pi. Plug
the card in the slot so the label is visible
from the bottom, as in the photo.
2 Connect your Pi to the power

supply you selected in Chapter 1.

NOOBS launches automatically.
Note: You can select a different
language in the menu at the bottom of
the screen. The default British English
option is also suitable for users in the
United States.
A

Raspbian is preselected.

3 Click Install OS.

Note: To install a different OS, select
one of the other OS options before
clicking Install OS.
4 When the alert box appears, click

Yes to confirm.

24

CHAPTER

Selecting an Operating System
B

2

NOOBS begins copying
Raspbian to the SD card.

Note: NOOBS displays a progress
bar and various notes about
Raspbian as it works.

When NOOBS finishes it
reboots your Pi automatically.
Initially, your Pi displays
many lines of scrolling text.
After a minute or so it
displays the Raspbian
configuration options. To use
these options to configure
your Pi, see Chapter 3.

TIPS
What happens if I install a different OS?
Every OS launches in a different way. The many lines
of scrolling text are common to Linux, but each
distro displays different information as it boots. If
you do not install Raspbian, you will not see the
configuration options described in the Chapter 3.

Can I unplug the Pi to power it down?
No! You should always shut down your Pi first
before unplugging the power. If you do not, the
information on the SD card can become corrupted.
See Chapter 3 for detailed instructions on shutting
down the Pi.

25

Back Up an SD Card

Y

ou can use a Mac or PC to back up the contents of an SD card. Backing up a card saves
configuration options, installed applications, and other files. You can make multiple backups as
you work. The backup process works with every Pi OS, including Raspbian Wheezy.
Note you cannot simply copy the files from a card to back it up. On a Mac, use the Disk Utility
application. On a PC, use a free application called win32DiskImager.

Back Up an SD Card
Shut Down the Pi
1 Shut down your Pi using the

instructions Chapter 3.
Note: Do not simply unplug the
power lead.

On a Mac
1 Unplug the SD card from the Pi

and insert it into a card reader
connected to your Mac.
2 Navigate to the Utilities folder

in Applications and double-click
the Disk Utility application.
3 Click the card device to

select it.
Note: Do not select the headings
under the device. The correct item
includes the words Generic and SD.
4 Click New Image.
A

You can optionally change the
filename and location of the
backup in the Save As field.

5 Click Save.

The utility creates a DMG file
that holds the contents of the
card, and adds the file to the
list of disk images in the area at
the left.

26

CHAPTER

Selecting an Operating System

2

On a PC
1 Open a web browser and visit http://

sourceforge.net/projects/
win32diskimager. Click Download.
2 Double-click Win32DiskImager-v0.8-

binary.zip and extract it to a folder.
Note: The version number may be greater
than 0.8.
3 In Windows Explorer, create a file

with an IMG extension, for example,
by right-clicking, selecting New and
then Text Document, and renaming
the file extension to .img.
Note: Version 0.8 of Win32DiskImage has
a bug. You must create an IMG file
manually in Windows Explorer before
Win32DiskImager allows you to write a
backup file.
4 Double-click Win32DiskImager.exe

to launch it.
5 Click the folder icon (

).

6 Navigate to the file you created in

step 1 and click it.
7 Click Open.
8 Click Read.

Win32DiskImager copies the contents
of your card to an IMG file. This can
take up to 20 minutes.

TIP
How do I restore a backup?
On the Mac, insert a card, run DiskUtility, click Restore, drag the backup file from the lower list at the left
to the Source field, and the card you inserted to the Destination field. Click Restore. On a PC, run
Win32DiskImager, click the file icon, select the backup file, click the device letter icon, select the card
device, and then click Write.

27

Get Started with BerryBoot

Y

ou can use a free application called BerryBoot to install multiple operating systems. With
BerryBoot, you can switch between a different OS every time you restart your Pi. You can also
install OS files on other devices, including USB memory sticks and hard drives. Where a 4GB SD card
has room for just one or two OS options, a 16GB or 32GB USB stick gives you room for many more.
BerryBoot is easy to use. Note that it downloads files from the Internet when you install a new OS.
This can take an hour or two, and requires a good broadband connection.

Get Started with BerryBoot
1 Follow the instructions in the section

“Prepare an SD Card” to prepare a
blank SD card.
2 Open a web browser and visit www.

berryterminal.com/doku.php/berryboot.
3 Download the latest version of the

berryboot.zip file.
4 Follow the instructions in the section

“Copy NOOBS to an SD Card” to copy
the BerryBoot files to your card.
Instead of downloading and copying
the NOOBS files, copy the BerryBoot
files you downloaded in step 3.
5 Place the SD card into your Pi and

apply power.
BerryBoot displays a Welcome screen.
6 Click Yes (

changes to

).

7 Click a network option

(

changes to

).

Note: You must connect your Pi to the
Internet to use BerryBoot.
8 Select a time zone and a keyboard

layout.
Note: You can skip step 8 if you do not
customize BerryBoot or change any
advanced settings.
9 Click OK.

28

CHAPTER

Selecting an Operating System

2

10 Select a storage device for your OS files.

Note: The SD card is labeled “device mmcblk0.”
If you connected your Pi to any other storage
device, it appears automatically in the list.
11 Click Format.

BerryBoot reformats the card.
Note: This wipes all the information on your
storage device. Be very careful, and doublecheck that you are not wiping useful
information.
12 Select an operating system from the list.
13 Click OK.

BerryBoot downloads the files for the OS
and installs them on the device you
selected in step 10.
Note: When you restart your Pi, BerryBoot
loads a screen with a list of installed OS
options. Click Add OS to add another OS to the
list, Delete to remove an OS, and Make
Default to choose the OS loaded by BerryBoot
after a short wait.
Note: Experienced users can edit the boot
options. See the BerryBoot web page for
details.

TIPS
Can I extend the OS list?
Yes, but not easily. The Pi supports many alternative OS
options. But BerryBoot is only compatible with those supplied
in a special format known as SquashFS. Converting the files
included in an OS to the SquashFS format and customizing the
BerryBoot OS list is an advanced project. You can find out
more at www.berryterminal.com/doku.php/berryboot/adding_
custom_distributions.

Can I install an OS on a card without
BerryBoot or NOOBS?
Yes. BerryBoot and NOOBS simplify
installation, but you can install an OS
on a card without them. For a detailed
guide to manual installation, see
http://elinux.org/RPi_Easy_SD_Card_
Setup.

29

CHAPTER 3

Setting Up
Raspbian
Before you can use your Pi you must set it up. You can change the
password, select a keyboard layout to match the keyboard you are
using, set a time zone, and set up the memory card. Optionally, you
can also overclock the Pi so it runs faster.

Set a Password  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . 32
Select a Keyboard Layout  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . 34
Select a Time Zone  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . 36
Manage Memory and SD Card Options .  .  .  .  .  .  .  .  .  .  .  38
Set Up Overclocking .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  40
Connect to the Internet  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  42
Revise the Configuration .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  43
Update the Operating System  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . 44
Launch the Desktop  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  46
Shut Down the Pi .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . 47

Set a Password

T

he first time the Pi boots, a Setup Options screen, also known as the Configuration tool, appears.
On this screen, you can change your Pi’s basic settings, including your user password. The default
username is pi, and the default password is raspberry.
You can shorten the password to a single letter for convenience or choose a much longer password for
security. You cannot set a blank password or disable the login prompt.

Select a Password
1 Boot up and wait until the

Setup Options screen appears.
2 Press

to position the red
highlight on the Change User
Password option and press
.

Note: You can also press
to
highlight