- ホーム
- > 洋書
- > 英文書
- > Science / Mathematics
Full Description
DIY hardware hacking...easy as Pi (R)!Raspberry Pi is taking off like a rocket! You can use this amazing, dirt-cheap, credit card-sized computer to learn powerful hardware hacking techniques as you build incredibly creative and useful projects! This complete, full-color guide requires absolutely no experience with either hardware hacking or computer programming. Colorful photos guide you through each project, and the step-by-step instructions are stunningly clear and easy! 1. Start with the absolute basics:Discover why millions of people are so passionate about the Pi! Tour the hardware, including storage, connections, and networking Install and run Raspbian, Raspberry Pi's Linux-based operating system Manage devices and configuration files Network Raspberry Pi and add Wi-Fi Program Raspberry Pi using Python, Scratch, XHTML, PHP, and MySQL2. Next, build all these great projects:Media Center Retro Console Video Game Station Minecraft Server Web Server Portable Webcam Security & Privacy Device3. Then, master all these cutting-edge techniques:Overclock Raspberry Pi for better performance Link Raspberry Pi to the Arduino and Arduino clones, including the AlaMode and the Gertboard Use the Pi to build electronics prototypes using a breadboard
Contents
Table of ContentsIntroduction 1What's in This Book 2Who Can Use This Book 4How to Use This Book 5Task: This Is a Task 5There's More Online... 5PART I HARDWARE FOUNDATIONSChapter 1 What Is the Raspberry Pi? 7Why the Pi? 8Hardware Versions 9Is the Raspberry Pi Open Source? 14Open Source Licenses 15Open Source and the Raspberry Pi 15How Can I Purchase a Raspberry Pi? 16Chapter 2 Hardware Components Quick Start 17Understanding Pi Hardware Terminology 17The Hidden Cost of Owning a Raspberry Pi 20A 5V Power Supply 21SD Card 23Powered USB Hub 24Ethernet Cable 24Monitor 25Cables 25USB Keyboard and Mouse 26A Tour of the Model B Board 27Networking 27Video and Audio 27Storage 29Power/Status Information 29Camera 30Processing 31Expansion 31Next Steps 32Chapter 3 A Tour of Raspberry Pi Peripheral Devices 33Circuit Prototyping Equipment 34Single-Board Microcontrollers 37The Gertboard 38Single-Board Computers 40Relevant Technician Tools 41Task: Check Raspberry Pi Voltage with a Multimeter 41Raspberry Pi Starter Kits 43Next Steps 45Chapter 4 Installing and Configuring an Operating System 47Common Operating Systems 49Understanding Linux 49Linux and Raspberry Pi 52The Kernel and Firmware 53Raspberry Pi's Other Operating Systems 54Installing Raspbian on Your Raspberry Pi 55Task: Creating a Raspbian SD Card in Windows 57Task: Creating a Raspbian SD Card in OS X 58Task: Creating a Raspbian SD Card in Linux 60An All-in-One Solution 63Task: Installing an OS on Your Raspberry Pi Using NOOBS 64Testing Your New Raspbian Image 65Chapter 5 Debian Linux Fundamentals-Terminal 67Baby Steps 67Essential Terminal Commands 69startx 69pwd 70ls 71cd 72sudo 73passwd 74nano 74man 75shutdown 76Updating Your Software 77Updating Raspbian 78Updating the Pi Firmware 79Revisiting Raspi-Config 80Expand Filesystem 81Change User Password 81Enable Boot to Desktop 82Internationalisation Options 82Enable Camera 82Add to Rastrack 83Overclocking 83Advanced Options 84Raspi-Config Under the Hood 84Next Steps 85Chapter 6 Debian Linux Fundamentals-Graphical User Interface 87LXDE-The Desktop Environment 87Starting and Exiting LXDE 88Task: Using Raspi-Config to Adjust Boot Behavior 88Touring the LXDE Interface 89Delving into the Main Menu 92Installing, Updating, and Removing Software 94Accessing the Pi Store 95Task: Downloading a Free App from the Pi Store 97Tweaking the LXDE UI 98Task: Change the Desktop Background 98Task: Customize the LXTerminal 99Task: Customize the LXPanel 100Openbox 100Editing Configuration Files 101Chapter 7 Networking Raspberry Pi 103Basic Networking Concepts 103Configuring Wired Ethernet 104Task: Setting a Static IP Address on Your Raspberry Pi 106Configuring Wireless Ethernet 107Task: Setting Up Wi-Fi on Your Pi 109Configuring "Headless" Raspberry Pi 110Secure Shell (SSH) 112Task: Using SSH to Connect to a Raspberry Pi Remotely 113Virtual Network Computing (VNC) 114Task: Using VNC to Connect to the Raspberry Pi 115Task: Configure Your Pi to Start VNC Server Automatically 117On Browsing the Web with the Pi 118Chapter 8 Programming Raspberry Pi with Scratch-Beginnings 121Technical Aspects of Scratch 122Scratch Version Issues 122The Scratch Community 123Getting Comfortable with the Scratch Interface 124About Blocks 127Crafting a (Very) Simple Scratch Application 129Task: Creating a Basic Scratch App 130The PicoBoard 132Obtaining a PicoBoard? 134Using a PicoBoard in Scratch 134Task: Using the PicoBoard in Scratch 134Chapter 9 Programming Raspberry Pi with Scratch-Next Steps 137Begin with the End in Mind 137Let's Build the Game! 139Task: Setting Up the Game Screens 140Task: Setting Up the Scratch Cat 143Setting Up the First Ball 144Setting Up the Second and Third Balls 146Debugging and Troubleshooting 147Uploading Your Project 149Task: Share Your Scratch Project 149Remixing 151Task: Create a Remix 151Chapter 10 Programming Raspberry Pi with Python-Beginnings 153Checking Out the Python Environment 154Interacting with the Python 3 Interpreter 156Exiting the Interpreter 157Getting Online Help 157Writing Your First Python Program 158Task: Creating Your First Python Script 159Running Python Scripts 161Task: Running Python Scripts (command line) 161Task: Running Python Scripts (IDLE) 161Broadening Your Python Horizons 163Chapter 11 Programming Raspberry Pi with Python-Next Steps 165Getting Comfortable with IDLE 165Task: Creating a New Python Script File 168Writing a Simple Game 168Delving into a Bit More Detail 171Variables 171Type Casting 171Concatenation 173Modules 173Task: Loading and then Updating the GPIO Module in Python 3 176Where Do You Go from Here? 177Chapter 12 Raspberry Pi Media Center 179A Bit o' History 180But Will It Blend? 181Introducing Raspbmc 182Task: Installing Raspbmc Under Windows 182Task: Installing Raspbmc Under OS X 183Configuring Raspbmc 184Getting Your Remote Control Working 186Task: Controlling Your Raspbmc Box from iOS 186Task: Controlling Your Raspbmc Box from a Web Browser 189Task: Configuring a GPIO-based IR Receiver 190Transferring Content to Your Pi 192Task: Uploading Media Content to Raspberry Pi 192Scraping Your Media 194Task: Configuring XBMC Media Detection 194Playing Your Content 196Installing Add-Ons 197Chapter 13 Raspberry Pi Retro Game Station 199A Word About Console Video Game Emulation 200Installing RetroPie 200Task: Setting Up RetroPie 201Transferring ROMs to RetroPie 203Task: Transferring ROMs to Your Raspberry Pi 204Setting Up Your Controls 206Task: Configure RetroPie Joystick Control Mappings 208Playing Your Games 209Installing Useful Add-Ons 210Task: Install ES-Scraper 211In Search of the Perfect Joystick 212Chapter 14 Raspberry Pi Minecraft Server 217Installing Minecraft Pi 219Task: Installing Minecraft Pi 219Accessing the Python API 221Task: Loading the Minecraft Python Libraries 222Task: Making Your Player Jump High! 224Task: Create a Diamond Floor 225Building a Minecraft Server 226Task: Installing Java and the Minecraft Server 227Administering a Minecraft Server 230Minecraft Plugins 232Chapter 15 Raspberry Pi Web Server 233What Is the LAMP Stack? 234Installing Your Web Server 235Task: Installing the LAMP Stack on Raspberry Pi 236Task: Verifying PHP Configuration 237Task: Verifying MySQL Installation 239Tweaking Up Your Web Server Settings 240Transferring Content to Your Web Server 240Task: Using SFTP to Transfer Content to Your Pi 241Task: Install and Test FTP on Your Raspberry Pi 243Setting Up phpMyAdmin 243Task: Installing phpMyAdmin 244Setting Up Joomla 245Task: Installing Joomla on Your Raspberry Pi 246Putting Your Web Server on the Public Internet 249Task: Making Your Raspberry Pi Publicly Accessible by Using No-IP 250Chapter 16 Raspberry Pi Portable Webcam 253About the Raspberry Pi Camera Board 253Installing and Configuring the Raspberry Pi Camera Board 256Task: Preparing the Raspberry Pi for the Camera Board 256Task: Installing the Raspberry Pi Camera Board 257Using the Camera Board 259Capturing Still Pictures 259Recording Video with the Camera Board 263Task: Encoding a raspivid Video File 265Using a Third-Party USB Webcam 266Task: Configuring a Third-Party USB Webcam 267Setting Up Your Webcam 269Task: Setting Up a Time-Lapse Webcam 270Adding a Rechargeable Battery Pack to Your Pi Camera 273Python and Your Webcam 274Task: Setting up SimpleCV 274Chapter 17 Raspberry Pi Security and Privacy Device 277Encrypting Your Internet Connection with a VPN 277Browsing Where You Want via a Proxy Server 278Building Your Raspberry Pi VPN Gateway 280Task: Creating Your Hamachi VPN 281Task: Connecting to Your Hamachi VPN from Your Desktop Computer 283Task: Installing Hamachi Client on Your Raspberry Pi 284Building Your Raspberry Pi Proxy Server 286Task: Installing and Configuring Privoxy Raspberry Pi 286Testing the Configuration 287Task: Pointing Your Workstation Computer at Your Pi Proxy 289Speaking of Geolocation 292Task: Adding Your Raspberry Pi to the Rastrack Database 294Building a Raspberry Pi Tor Proxy 294Chapter 18 Raspberry Pi Overclocking 299What Is Overclocking? 299Warranty Implications of Overclocking 300Overclocking Your Pi 302The Raspi-Config Method 302Task: Verifying Your Pi's CPU, Voltage, and Temperature Status 303The Manual Method 304Benchmarking Your Pi 305Task: Installing and Running nbench 306Adjusting the Memory Split on Your Pi 307Task: Tweaking Memory Split with Raspi-Config 308Tweaking Memory Split by Hand 309A Historical Footnote 309Various and Sundry Performance Tweaks 311Chapter 19 Raspberry Pi and Arduino 315Introducing the Arduino 315Digging into the Arduino Uno 319Connecting the Arduino and the Raspberry Pi 321Connecting the Raspberry Pi GPIO Pins to the Arduino Serial Pins 322Connecting the Raspberry Pi GPIO Pins to the Arduino I2C 322Connecting the Raspberry Pi to the Arduino via USB 322Connecting the Raspberry Pi to the Arduino via a Shield or Bridge Board 322Connecting the Raspberry Pi to an Arduino Clone 323Understanding the Arduino Development Workflow 323Task: Install and Configure Arduino IDE on the Raspberry Pi 324Task: Running the "Blink" Sample Sketch 327Fading an LED 330Task: Running the Fade Sketch 331Using the AlaMode 332Task: Getting the AlaMode Up and Running 333Chapter 20 Raspberry Pi and the Gertboard 337Anatomy of the GPIO 339Connecting Your Gertboard and Raspberry Pi 341Installing the Testing Software 343Task: Enabling SPI on Your Raspberry Pi 344Task: Installing the Python Gertboard Test Suite 345Testing the LEDs 346Testing Input/Output 349A Couple Quick Breadboarding Exercises 350Accessing the GPIO Pins Directly 350Task: Lighting an LED Directly from the GPIO 351Accessing the GPIO Pins via the Pi Cobbler 353Programming the Atmel Microcontroller 354Task: Preparing Your Arduino Environment 355Final Thoughts, and Thank You 357Index 359