Raspberry Pi Cookbook: Software and Hardware Problems and Solutions
Format: PDF / Kindle (mobi) / ePub
With millions of new users and several new models, the Raspberry Pi ecosystem continues to expand—along with a lot of new questions about the Pi’s capabilities. The second edition of this popular cookbook provides more than 240 hands-on recipes for running this tiny low-cost computer with Linux, programming it with Python, and hooking up sensors, motors, and other hardware—including Arduino and the Internet of Things.
Prolific hacker and author Simon Monk also teaches basic principles to help you use new technologies with Raspberry Pi as its ecosystem continues to develop. This cookbook is ideal for programmers and hobbyists familiar with the Pi through resources, including Getting Started with Raspberry Pi (O’Reilly). Python and other code examples from the book are available on GitHub.
- Set up your Raspberry Pi and connect to a network
- Work with its Linux-based operating system
- Program Raspberry Pi with Python
- Give your Pi "eyes" with computer vision
- Control hardware through the GPIO connector
- Use Raspberry Pi to run different types of motors
- Work with switches, keypads, and other digital inputs
- Use sensors to measure temperature, light, and distance
- Connect to IoT devices in various ways
- Create dynamic projects with Arduino
packages that you could install. See Also See Recipe 3.17 for removing programs that you no longer need so that you can free up space. See also Recipe 3.19 for downloading source code from GitHub. 3.17. Removing Software Installed with apt-get Problem Having installed a whole load of programs using apt-get, you now find that you want to remove some of them. Solution The apt-get utility has an option (remove) that will remove a package, but only packages that have been installed with apt-get
My Server Bottle v0.11.4 server starting up (using WSGIRefServer())... Listening on http://192.168.1.16:80/ Hit Ctrl-C to quit. Finally, if that runs OK, use the following command to make the system aware of the new service that you have defined: $ sudo update-rc.d my_server defaults See Also For more information on changing file and folder permissions, see Recipe 3.13. 3.21. Running a Program or Script Automatically at Regular Intervals Problem You want to run a script once a day or at
of range” error: >>> a = 777 Traceback (most recent call last): File "
bottle project documentation. For more on formatting dates and times in Python, see Recipe 7.2. 7.16. Writing a Simple Web Server in Python | 165 CHAPTER 8 GPIO Basics 8.0. Introduction This chapter contains some basic recipes for setting up and using the Raspberry Pi’s general-purpose input/output (GPIO) connector. 8.1. Finding Your Way Around the GPIO Connector Be sure to check out the accompanying video for this recipe at http:// razzpisampler.oreilly.com. Problem You need to connect
to do with your Raspberry Pi. If you plan to build hardware projects with the Raspberry Pi, then use Raspbian or Occidentalis (from Adafruit). Of these, Raspbian is the official and most commonly used distribution for Raspberry Pi, but Occidentalis requires less setup to start hacking hardware. If you plan to use your Raspberry Pi as a media center, there are a number of distributions specifically for that purpose (see Recipe 4.1). In this book, we use the Raspbian distribution almost