Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Raspberry Pi Essentials
Raspberry Pi Essentials

Raspberry Pi Essentials: Get up and running with the Raspberry Pi to develop captivating projects

Arrow left icon
Profile Icon Jack Creasey
Arrow right icon
$19.99 per month
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.8 (5 Ratings)
Paperback Apr 2015 212 pages 1st Edition
eBook
$9.99 $25.99
Paperback
$32.99
Subscription
Free Trial
Renews at $19.99p/m
Arrow left icon
Profile Icon Jack Creasey
Arrow right icon
$19.99 per month
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.8 (5 Ratings)
Paperback Apr 2015 212 pages 1st Edition
eBook
$9.99 $25.99
Paperback
$32.99
Subscription
Free Trial
Renews at $19.99p/m
eBook
$9.99 $25.99
Paperback
$32.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Raspberry Pi Essentials

Chapter 2. Configuring the Raspberry Pi Desktop and Software

The Pi now boots to the desktop graphical interface, which means you have a base system on which to start project development. Like any other desktop PC, you will eventually want it configured to suit your development style. In this chapter, we maximize the utility of the desktop graphical tools and develop code for your projects. We don't expect you to become a Linux command-line guru. Instead, we will use simpler desktop tools such as editors, file managers, and the Python interactive development shell, IDLE3.

After completing this chapter, you will be able to:

  • Install networking and graphical networking tools
  • Keep your computer system up to date
  • Configure the Pi desktop to suit your development needs
  • Configure Ethernet and Wi-Fi networking connectivity options
  • Explain code development options available by default
  • Create Bash shell scripts and have them run automatically
  • Create Python 3 scripts and have them installed...

Hardware and software networking configuration

Since we will need Internet connectivity to install tools and utilities, let's now look at the Pi hardware and software networking configuration in more detail; the wireless configuration is first since many project designers may prefer a wireless connection.

There are many Pi-compatible wireless adapters and you may even have bought one as part of your initial kit. The most common recommendation is that you use a Wi-Fi adapter that uses the Realtek RTL8188CUS chipset. The driver for this chipset (rtl8192cu) is included in the Raspbian distribution, so enabling this particular type of Wi-Fi adapter is easy.

First, you need to install the adapter, and then we will look at the connection status of the USB devices on the Pi to ensure it is detected:

  1. Plug the Wi-Fi wireless adapter into any available USB port and unplug the Ethernet connection if you have one
  2. Open a terminal window and type lsusb
  3. In the same window, type lsusb –t

The lsusb...

Configuring the Raspberry Pi desktop and software

Because you enabled boot to the graphical desktop during the final installation configuration in Chapter 1, Getting Started with Raspberry Pi, each time you boot the Pi, the desktop automatically appears. The Pi is now very much like a compact version of your desktop PC, laptop, or even iPad.

The desktop environment is called the lightweight X11 desktop environment (LXDE). It is installed on top of a window manager, which in this case is Openbox. Let's take a quick tour of some important elements of the desktop, and at the same time set up some preferences and options.

The information to follow will provide you with the guidance you need to install a screensaver package and set up a desktop accelerator:

  • On the left-hand end of the taskbar is the main menu icon. When you click on it, one menu option offered is the ability to shut down. If you click on the shutdown menu selection, the End Session window opens. This allows you to select...

Desktop and file manager accelerators

When you work in a graphical desktop, one of the most used utilities is the file manager (PCManFM). In a development environment, there is often the need to transition from a low-security-privilege (user) context to a high-security-privilege (root) context to complete tasks. The current file manager does not allow this to happen. PCManFM will allow you to add defined actions to its context menus that can help to reduce the need for low-level command-line editors and Terminal session commands. In addition, there could be a constant need to start multiple Terminal windows and to move between multiple desktop views to reduce the clutter of open windows.

Now, let's set up a useful desktop accelerator. Find a clear location on the desktop with your mouse pointer and right-click on it. The menu that comes up is from the file manager and is not usually very useful. To replace it with some new functionality, follow these steps:

  1. Right-click on the desktop...

Project 1 – Building a talking clock with a Bash script

This project will expose you to the Bash shell scripting language. You will build a talking clock that tells the time every minute using an executable and an Internet-based web service. Once the clock is up and running, you will use an automation tool called Cron to schedule and run tasks at a particular time or at regular intervals.

The talking clock will have the following features and functions:

  • Automatically start every minute and run in the background without any visible interface to the desktop user
  • Read the system time to get the local time on your Pi
  • Produce a correctly formatted time string to announce the time, for example, you might say "The time is now nine fifteen AM"
  • Convert the time string to audio and play it
  • Exit the script

Creating project files and directories

First, you will open a Terminal window to create the project files and directories, update our system, and load a new utility application:

  1. At the command...

Building a talking clock with Python 3

Python is often used as a scripting language when the speed of execution is a secondary consideration. In this situation, it can provide much more script flexibility and improved manageability compared to a Bash script.

The GUI development environment for Python 3 is called IDLE3, and if you double-click on the icon, it will, by default, open a single window called Python Shell. Although you can enter commands directly in the shell interface, it will be beneficial for you to learn from the start how to create and save program files using the Python editor.

If you are not familiar with Python 3, there are many online tutorials that introduce basic programming techniques. An excellent overview and tutorial is available from the Python.org website at http://docs.python.org/3.2/tutorial. There is also an excellent help system in Python Shell that you can use to develop programs in the editor window.

To access the help system, at the Python Shell command prompt...

Summary

Now that we've completed the second chapter, let's review some of the important tasks you performed in this chapter:

  • Installed graphical networking tools
  • Configured the Pi desktop to suit your development needs
  • Configured the Ethernet and Wi-Fi networking connectivity options
  • Created a talking clock to better understand Bash scripts and Python 3 programming language

You also learned how to do most of this work directly from the desktop, minimizing the use of command-line sessions.

At some point in your project design career, you may want to become a command-line geek, but it would require building expertise at the command-structure level.

In the next chapter, you will learn how to connect PiCam or multiple webcams and to acquire and store video streams and images.

Left arrow icon Right arrow icon

Description

Programmers new to the Raspberry Pi and novice programmers with little to no experience with micro board computing will find the book useful. A basic knowledge of programming languages in general will prove useful for a better understanding of the topics.

Who is this book for?

Programmers new to the Raspberry Pi and novice programmers with little to no experience with micro board computing will find the book useful. A basic knowledge of programming languages in general will prove useful for a better understanding of the topics.

What you will learn

  • Build your own fullfledged Raspberry Pi hardware and install the Raspbian OS
  • Configure the Raspberry Pi development environment and get acquainted with OS configuration and tools
  • Build a camerabased project using PiCam and USB cameras
  • Build and configure a stereo audio system using VLC
  • Explore the Raspberry Pi GPIO to connect to the outside world
  • Utilize and explore extensive I2C interface support built into the Raspberry Pi to enhance your system
  • Configure remote access and battery power for a mobile Raspberry Pi
  • Build a fully functional Raspberry Pi linefollowing robot using PiCam

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Apr 28, 2015
Length: 212 pages
Edition : 1st
Language : English
ISBN-13 : 9781784396398
Vendor :
Raspberry Pi
Category :
Concepts :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Apr 28, 2015
Length: 212 pages
Edition : 1st
Language : English
ISBN-13 : 9781784396398
Vendor :
Raspberry Pi
Category :
Concepts :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 114.97
Raspberry Pi Essentials
$32.99
Raspberry Pi Sensors
$32.99
Learning Raspberry Pi
$48.99
Total $ 114.97 Stars icon
Banner background image

Table of Contents

9 Chapters
1. Getting Started with Raspberry Pi Chevron down icon Chevron up icon
2. Configuring the Raspberry Pi Desktop and Software Chevron down icon Chevron up icon
3. Raspberry Pi and Cameras Chevron down icon Chevron up icon
4. Raspberry Pi Audio Input and Output Chevron down icon Chevron up icon
5. Port Input and Output on the Raspberry Pi Chevron down icon Chevron up icon
6. Driving I2C Peripherals on the Raspberry Pi Chevron down icon Chevron up icon
7. Going Mobile with Raspberry Pi Chevron down icon Chevron up icon
8. Creating a Raspberry Pi Line-following Robot Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.8
(5 Ratings)
5 star 0%
4 star 80%
3 star 20%
2 star 0%
1 star 0%
Stareagle Oct 08, 2015
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
The Raspberry Pi Esentials book is a great resource for those starting to dabble in this area. It has clear and concise information to get you up and running quickly.It even goes into some detail on various electronic projects that can be completed using the Raspberry PI which is easy to follow and understand.To avoid clutter a lot of the code files are available for download in a single zip file. This also aleviates the error factor of trying to type in the code from the pages of the book and can simply be imported when needed.Although it is a beginners kind of book, I would say the user would need at lease some experience of the Raspberry Pi and an awarenes of electronics in general.Overall a great book and I would recommend it to others.
Amazon Verified review Amazon
Jaume Aragay Badia Oct 11, 2015
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Great introduction level book to the Raspberry Pi but not for newbies. If you know linux and electronics and want to get a first contact with the Raspberry Pi, this is your book; if not, you can find other RasPi books specifically for newbies with step by step instructions.The book is full of little gold nuggets in the comments for real life situations. Some code is not listed on the book pages but is referenced for downloading. This has a good side: no typing errors; but also a bad one, at least for me, I can't see everything in one place to follow the whole thing, that's why I did not give it the fifth star.The chapters cover these topics:- The unboxing and first time booting of the RasPi and it's configuration.- The use of cameras with the RasPi and video resources including motion detection procedures.- The RasPi audio input and output.- The real world interaction through the input and output pins of the RasPi.- The use of different peripherals including I2C ones to run PWM on servos (if you don't understand what I say here, this may not be your book).- What's needed to make a RasPi mobile (autonomous).- A final project: A RasPi line-following robot.All the chapters have their own (very well crafted and interesting) projects and some of them are merged in the robot project at the end of the book.
Amazon Verified review Amazon
Gopinath Palaniappan Oct 09, 2015
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Raspberry Pi Essentials"Get up and running with the Raspberry Pi to develop captivating projects"Author: Jack CreaseyAs the name suggests, its a book to teach you the basics of Raspberry Pi hardware. Its also supplemented with a number of examples and mini projects to keep you occupied for days.* C1 : Includes basic setup of Raspberry Pi, Booting into Rasbian* C2 : Is all about configuration of desktop, networking/wifi and a talking clock* C3 : Helps you setup a webcam or PiCam to capture video. 3 mini projects for security camera application* C4 : Deals with Audio input and output. Includes 2 mini projects to create your own internet radio* C5 : I/O ports* C6 : Interfacing I2C peripherals* C7 : Making it portable* C8 : Building a line follower robotThere is a lot covered in the book. Initial chapters does not require anything but the Raspberry Pi. Later chapters do require additional peripherals and kits. I loved the last chapter that teaches you to assemble a line follower robot.Link to the books:http://www.amazon.com/dp/1784396397 [$14.59 kindle/$29.99 print]https://www.packtpub.com/hardware-and-creative/raspberry-pi-essentials [$23.99 ebook/$29.99 print+ebook]
Amazon Verified review Amazon
Dustin Marx Jun 12, 2015
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
"Raspberry Pi Essentials" packs much detailed information into its pages. Many of the code listings used in the numerous projects are not fully contained in the book, but are instead available via download. This allows the pages to focus on text, graphics, and images. The book covers diverse topics such as selecting and configuring a Raspberry Pi, connecting cameras to the Raspberry Pi, working with audio input and output, making the Raspberry Pi mobile, and building a Raspberry Pi-based robot to follow a line."Raspberry Pi Essentials" features clear graphics and screen snapshots that illustrate the concepts being discussed. Some code samples need to be downloaded rather than being present in the pages of the book. This works with the author's approach to minimize knowledge of coding and keep the focus on the Raspberry Pi. The code samples can be easily downloaded in a single ZIP file."Raspberry Pi Essentials," as its title suggests, covers Raspberry Pi essentials, but covers them in a highly detailed manner that is not always the case with "essentials" books. "Raspberry Pi Essentials" is probably best suited for someone with at least minimal experience with Raspberry Pi and readers of the book should definitely have access to a Raspberry Pi and other described components to work with as the book is read. The book is project-heavy and likely to be most useful to those who implement the projects.I reviewed a PDF version of this book provided by Packt Publishing.
Amazon Verified review Amazon
MRL Oct 09, 2015
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
“Raspberry Essentials” aims to illustrate the basics of Raspberry Pi, from installation to advanced use. The book is meant for both experienced DIY and first time amateurs.In the first part of the book, it wouldn’t have hurt to include more details for first time users.As an example, at page 14:“Ctrl + Alt + Backspace: Use this key combination to log out of the current Xsession user (use Xsession to login).Ctrl + Alt + F1: Use this key combination to switch to a command session on tty1 (type exit to close)Ctrl + Alt + F7: Use this key combination to switch back to the graphical desktopCtrl + Alt + F2 through F6: Use this key combination to switch to a command session on tty2-tty6.”The passage above works for an experienced user -- meaning someone who knows developer tools and has a basic knowledge of administrative tasks of a Linux OS -- but I’m afraid that a first time user who has never seen a Linux OS wouldn’t understand what is a Xsession, an tty1, tty2 and so on!If you are a Linux guy, this book will prove to be very useful, thanks to plenty of tips and hands-on tutorial that will help you to achieve various tasks, from network configuration to appropriate monitor customization. In addition to that, readers will learn, step by step, to keep the development environment up to date.Some complex tasks and configuration files can be downloaded from a web site.Unfortunately some bash scripts (or python scripts) are presented in their final form, without a good explanation about all their functions. This way, programmers can use them as a “recipe” or should put in a lot of work on their own to try to fully understand them.Chapter 5, "Port Input and Output on the Raspberry Pi", and Chapter 6, "Driving I2C Peripherals on the Raspberry Pi", are much more useful and well developed but, in my opinion, the scripts could have used a deeper explanation; it would have tremendously improved the whole presentation.Chapter 7, "Going Mobile with Raspberry Pi", and 8, "Creating a Raspberry Pi Line-following Robot", are great reading materials for DIY aficionados. They pick up some ideas from previous chapters (like using a camera) and they add great advice for someone who needs only a few tips to achieve his goals. Maybe this is the real target of the book: a DIY fan with a lot of time to try something new and an outstanding ability to learn in autonomy.I would have liked the book more if the author had developed the topics in a way that could have been easier to understand. Maybe the author could have focused on less topics. I would recommend to revise the book paying more attention to every single subject from the beginning to end.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.