Raspberry Pi Cookbook: Software and Hardware Problems and Solutions

Raspberry Pi Cookbook: Software and Hardware Problems and Solutions

Simon Monk

Language: English

Pages: 510

ISBN: 1491939109

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

Sets, Logic and Maths for Computing (2nd Edition) (Undergraduate Topics in Computer Science)

Trillions: Thriving in the Emerging Information Ecology

Practical RDF

Adventures In Raspberry Pi

Nagios: System and Network Monitoring (2nd Edition)





















and opens up all sorts of possible uses, including home automation, web serving, network monitoring, and so on. The connection can be wired through an Ethernet cable (at least in the case of the model B), or the Pi can use a USB WiFi module to provide a network connection. Having a connected Raspberry Pi also means that you can connect to it remotely from another computer. This is very useful in situations where the Raspberry Pi itself is in‐ accessible and does not have a keyboard, mouse, and

myfile2.txt Although in this example, both file paths are local to the current working directory, the file paths can be to anywhere in the filesystem where you have write access. The following example copies the original file to an area /tmp, which is a location for temporary files. Do not put anything important in that folder. $ cp myfile.txt /tmp Note that in this case, the name to be given to the new file is not specified, just the directory where it is to go. This will create a copy of

regular intervals. Solution Use the Linux crontab command. To do this, the Raspberry Pi needs to know the time and date, and therefore needs a network connection or a real-time clock. See Recipe 11.13. 3.21. Running a Program or Script Automatically at Regular Intervals | 77 Discussion The command crontab allows you to schedule events to take place at regular intervals. This can be daily or hourly, and you can even define complicated patterns so different things happen on different days of

Figure 4-2. Setting up WiFi in Raspbmc Select the WiFi option and then enter your SSID (WiFi network name) and WiFi password. 4.1. Making a Media Center | 93 See Also The XBMC software has a user manual in the form of a wiki. Raspbmc is not the only media center distribution. Two other popular distributions are: • OpenElec • XBian You can add an IR remote to Raspberry Pi to control XBMC. 4.2. Installing Office Software Problem You need to open word processor and spreadsheet documents on a

spaces. The convention used in this book is to use four spaces for a level of indentation. 5.2. Editing Python Programs with IDLE | 113 When you’re starting out in Python, it’s not uncommon to see an error such as IndentationError: unexpected indent, which means that somewhere things are not indented correctly. If everything appears to line up, double-check that none of the indents contain Tab char‐ acters. Python treats tabs differently. Notice how IDLE uses color coding to highlight the

Download sample