Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Raspberry Pi Zero Cookbook

You're reading from   Raspberry Pi Zero Cookbook Delve into the practical world of the Raspberry Pi Zero

Arrow left icon
Product type Paperback
Published in Mar 2017
Publisher Packt
ISBN-13 9781786463852
Length 422 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Edward Snajder Edward Snajder
Author Profile Icon Edward Snajder
Edward Snajder
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. Kick-Start Your Raspberry Pi Zero FREE CHAPTER 2. Setting Up Physical and Wireless Connections 3. Programming with Linux 4. Programming with Python 5. Getting Your Hands Dirty Using the GPIO Header 6. Controlling the LEDs and Displays 7. Controlling the Hardware 8. Taking Digital Inputs to the Raspberry Pi Zero 9. Interfacing Sensors with the Raspberry Pi Zero 10. Cooking up Projects to Amaze the World!

Connecting to displays and changing the configuration settings

The Raspberry Pi Zero is as capable as its predecessors, offering full HDMI video output. The ports are miniaturized, but that doesn't stop you from connecting your Zero to an LCD monitor. Here's how!

Getting ready

Now that you have your USB set up, your final step is getting video output. If you went with the video RCA hack, you can use the HDMI port or RCA video to get going. For HDMI, you'll need a micro-HDMI to standard HDMI adapter (and standard HDMI cable), or an HDMI cable that has one end micro and the other end standard.

A typical standard-to-micro HDMI adapter looks like this:

Getting ready

Standard-to-micro HDMI adapter

We now have our HDMI adapter and cable connected, the SD card installed, and the USB OTG adapter ready to go:

Getting ready

Pi connected to USB OTG and HDMI

How to do it...

  1. Confirm that the SD card is inserted and that your video and USB connections are set, and connect the micro-USB power to an adapter. If you started with NOOBS, you will be taken to the OS selection screen. Right now, there isn't very much to select from. The primary reason is that the Raspberry Pi Zero doesn't yet have Internet capability, so a list of available operating systems cannot be retrieved. For now, it is as easy as clicking on the checkbox for Raspbian and the Install button in the top left. From there, you are a few minutes from your new Raspberry Pi Zero desktop!
  2. Once you click on Install, NOOBS takes care of the rest and sets up a brand new default Raspbian system on your SD card. The system will start quickly and take you right to the installation screen:

    How to do it...

    NOOBS OS selection screen

  3. When you select Install, NOOBS will take care of the rest and prepare your card with the Raspbian operating system:

    How to do it...

    NOOBS Raspbian setup

  4. After this is complete, the installer will have you click to reboot, after which you will be taken right into Raspbian.

    Note

    If you started by using a Raspbian image instead of NOOBS, you will jump right into Raspbian Linux, skipping over the NOOBS setup section.

Initial Pi configuration

  1. The first thing you want to jump into is initial configuration. The fastest way to start that is by opening a terminal window. That's the little computer screen icon three icons to the right of the Menu button:

    Initial Pi configuration

    The Terminal icon is just to the right of the File Cabinet

    Click on that and type this command:

              sudo raspi-config
    

    Initial Pi configuration

    The Terminal screen - you'll be here a lot

  2. If you are prompted for a password, the initial password for user pi is raspberry. The Raspberry Pi configuration tool contains several options:

    Initial Pi configuration

    raspi-config main options

  3. Let's start with option 1, Expand Filesystem. This will extend all of the space that is available on the SD card after making the image. After you select it, the screen will move back to the terminal, run some more commands, and come back to the configuration utility with a report:

    Initial Pi configuration

    Partition resize success

  4. Next, let's change the default password of the pi user. Select the second option, and you will be prompted to enter and verify a new password.

    Note

    It is a very smart move to change the default user for pi or deactivate that user entirely. As you start playing with your Pi and making it more accessible to the Internet, you also make it more susceptible to hackers and bots. Since everyone knows the default login and password to a Raspbian installation, leaving them as the default when having them open to the Internet will almost certainly lead to unauthorized access and your work being stolen, altered, or destroyed.

    Another good option to take care of right away are Internationalization options. You can set your local time zone and keyboard type in this section. You'll know right away whether your Pi is set to the wrong keyboard layout when you start trying special characters.

  5. Finally, before rebooting, let's go into Advanced Options and pick the fourth option, SSH. Enable the SSH server. This will allow you to use the Raspberry Pi Zero from any computer on the network, once you get it on the network:

    Initial Pi configuration

    Advanced options menu

The table below shows the options available in raspi-config and what they are used for:

Number

Raspi-config option

Function

Notes

1

Expand Filesystem

Extends all available space on the SD card

Run after initial boot

2

Change User PW

Changes the password for the pi user

Run after initial boot

3

Boot Options

Gives you different options to boot to desktop, with or without login

Covered in the next section

4

Wait for Network @ Boot

Waits to boot the Pi until a network has become available

Recommend keeping set to No

5

Internationalization Options

Settings for locale, time zone, and keyboard

Run after initial boot

6

Enable Camera

Enables the camera port on the Raspberry Pi

Enable if you have a camera

7

Add to Rastrack

Adds your Raspberry Pi to the Rastrack database

Optional, register at http://rastrack.co.uk

8

Overclock

Increase the maximum speed of the processor

Covered in next section; sadly doesn't work on the Zero

9

Advanced Options

Several different advanced configuration options

Enable SSH after initial boot.

0

About raspi-config

Information about the configuration utility

You have been reading a chapter from
Raspberry Pi Zero Cookbook
Published in: Mar 2017
Publisher: Packt
ISBN-13: 9781786463852
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at £16.99/month. Cancel anytime