Details

Exploring Raspberry Pi


Exploring Raspberry Pi

Interfacing to the Real World with Embedded Linux
1. Aufl.

von: Derek Molloy

24,99 €

Verlag: Wiley
Format: EPUB
Veröffentl.: 13.06.2016
ISBN/EAN: 9781119188698
Sprache: englisch
Anzahl Seiten: 720

DRM-geschütztes eBook, Sie benötigen z.B. Adobe Digital Editions und eine Adobe ID zum Lesen.

Beschreibungen

<b>Expand Raspberry Pi capabilities with fundamental engineering principles</b> <p><i>Exploring Raspberry Pi</i> is the innovators guide to bringing Raspberry Pi to life. This book favors engineering principles over a 'recipe' approach to give you the skills you need to design and build your own projects. You'll understand the fundamental principles in a way that transfers to any type of electronics, electronic modules, or external peripherals, using a "learning by doing" approach that caters to both beginners and experts. The book begins with basic Linux and programming skills, and helps you stock your inventory with common parts and supplies. Next, you'll learn how to make parts work together to achieve the goals of your project, no matter what type of components you use. The companion website provides a full repository that structures all of the code and scripts, along with links to video tutorials and supplementary content that takes you deeper into your project. <p>The Raspberry Pi's most famous feature is its adaptability. It can be used for thousands of electronic applications, and using the Linux OS expands the functionality even more. This book helps you get the most from your Raspberry Pi, but it also gives you the fundamental engineering skills you need to incorporate any electronics into any project. <ul> <li>Develop the Linux and programming skills you need to build basic applications</li> <li>Build your inventory of parts so you can always "make it work"</li> <li>Understand interfacing, controlling, and communicating with almost any component</li> <li>Explore advanced applications with video, audio, real-world interactions, and more</li> </ul> <p>Be free to adapt and create with <i>Exploring Raspberry Pi.</i>
<p>Introduction xix</p> <p><b>Part I Raspberry Pi Basics Chapter 1</b></p> <p><b>Chapter 1 Raspberry Pi Hardware 3</b></p> <p>Introduction to the Platform 3</p> <p>Who Should Use the RPi 5</p> <p>When to Use the RPi 5</p> <p>When to Not Use the RPi 6</p> <p>RPi Documentation 7</p> <p>The RPi Hardware 8</p> <p>Raspberry Pi Versions 9</p> <p>The Raspberry Pi Hardware 10</p> <p>Raspberry Pi Accessories 12</p> <p>Important Accessories 13</p> <p>Recommended Accessories 14</p> <p>Optional Accessories 16</p> <p>HATs 19</p> <p>How to Destroy Your RPi! 20</p> <p>Summary 21</p> <p>Support 21</p> <p><b>Chapter 2 Raspberry Pi Software 23</b></p> <p>Linux on the Raspberry Pi 24</p> <p>Linux Distributions for the RPi 24</p> <p>Create a Linux SD Card Image for the RPi 25</p> <p>Connecting to a Network 26</p> <p>Regular Ethernet 27</p> <p>Ethernet Crossover Cable 29</p> <p>Communicating with the RPi 31</p> <p>Serial Connection with the USB-to-TTL 3.3V Cable 31</p> <p>Connecting through Secure Shell (SSH) 33</p> <p>Transferring Files Using PuTTY/psftp over SSH 35</p> <p>Controlling the Raspberry Pi 36</p> <p>Basic Linux Commands 36</p> <p>Basic File Editing 41</p> <p>What Time Is It? 43</p> <p>Package Management 44</p> <p>Configuring the Raspberry Pi 46</p> <p>The Raspberry Pi Configuration Tool 46</p> <p>Updating the RPi Software 48</p> <p>Video Output 49</p> <p>Interacting with the Onboard LEDs 50</p> <p>Shutdown and Reboot 53</p> <p>Summary 54</p> <p><b>Chapter 3 Exploring Embedded Linux Systems 55</b></p> <p>Introducing Embedded Linux 56</p> <p>Advantages and Disadvantages of Embedded Linux 57</p> <p>Is Linux Open Source and Free? 58</p> <p>Booting the Raspberry Pi 58</p> <p>Managing Linux Systems 69</p> <p>The Super User 69</p> <p>System Administration 70</p> <p>Linux Commands 89</p> <p>Linux Processes 96</p> <p>Other Linux Topics 99</p> <p>Using Git for Version Control 99</p> <p>A Practice-Based Introduction 101</p> <p>Git Branching 105</p> <p>Common Git Commands 107</p> <p>Using Desktop Virtualization 108</p> <p>Code for This Book 110</p> <p>Summary 111</p> <p>Further Reading 111</p> <p>Bibliography 111</p> <p><b>Chapter 4 Interfacing Electronics 113</b></p> <p>Analyzing Your Circuits 114</p> <p>Digital Multimeter 114</p> <p>Oscilloscopes 115</p> <p>Basic Circuit Principles 117</p> <p>Voltage, Current, Resistance, and Ohm’s Law 117</p> <p>Voltage Division 119</p> <p>Current Division 120</p> <p>Implementing RPi Circuits on a Breadboard 121</p> <p>Digital Multimeters (DMMs) and Breadboards 123</p> <p>Example Circuit: Voltage Regulation 124</p> <p>Discrete Components 126</p> <p>Diodes 126</p> <p>Light-Emitting Diodes (LEDs) 128</p> <p>Smoothing and Decoupling Capacitors 130</p> <p>Transistors 132</p> <p>Optocouplers/Opto-isolators 138</p> <p>Switches and Buttons 140</p> <p>Logic Gates 143</p> <p>Analog-to-Digital Conversion 150</p> <p>Sampling Rate 151</p> <p>Quantization 151</p> <p>Operational Amplifiers 152</p> <p>Concluding Advice 155</p> <p>Summary 156</p> <p>Further Reading 157</p> <p><b>Chapter 5 Programming on the Raspberry Pi 159</b></p> <p>Introduction 160</p> <p>Performance of Languages on the RPi 160</p> <p>Setting the RPi CPU Frequency 165</p> <p>A First Circuit for Physical Computing 166</p> <p>Scripting Languages 168</p> <p>Scripting Language Options 168</p> <p>Bash 169</p> <p>Lua 171</p> <p>Perl 173</p> <p>Python 173</p> <p>Dynamically Compiled Languages 176</p> <p>JavaScript and Node.js on the RPi 176</p> <p>Java on the RPi 178</p> <p>C and C++ on the RPi 180</p> <p>C and C++ Language Overview 182</p> <p>LED control in c 194</p> <p>The C of C++ 196</p> <p>Overview of Object-Oriented Programming 199</p> <p>Object-Oriented LED Control in C++ 203</p> <p>Interfacing to the Linux OS 206</p> <p>Glibc and Syscall 206</p> <p>Improving the Performance of Python 208</p> <p>Cython 208</p> <p>Extending Python with C/C++ 211</p> <p>Summary 215</p> <p>Further Reading 216</p> <p>Bibliography 216</p> <p><b>Part II Interfacing, Controlling, and Communicating 217</b></p> <p><b>Chapter 6 Interfacing to the Raspberry Pi Input/Outputs 219</b></p> <p>Introduction 220</p> <p>General-Purpose Input/Outputs 221</p> <p>GPIO Digital Output 222</p> <p>GPIO Digital Input 225</p> <p>Internal Pull-Up and Pull-Down Resistors 226</p> <p>Interfacing to Powered DC Circuits 227</p> <p>C++ Control of GPIOs Using sysfs 229</p> <p>More C++ Programming 237</p> <p>An Enhanced GPIO Class 242</p> <p>Memory-Based GPIO Control 245</p> <p>GPIO Control Using devmem 2 246</p> <p>GPIO Control Using C and /dev/mem 248</p> <p>Changing the Internal Resistor Configuration 250</p> <p>WiringPi 252</p> <p>Installing wiringPi 252</p> <p>The gpio Command 253</p> <p>Programming with wiringPi 254</p> <p>Toggling an LED Using wiringPi 255</p> <p>Button Press—LED Response 257</p> <p>Communicating to One-Wire Sensors 260</p> <p>PWM and General-Purpose Clocks 263</p> <p>GPIOs and Permissions 270</p> <p>Writing udev Rules 270</p> <p>Permissions and wiringPi 272</p> <p>Summary 273</p> <p><b>Chapter 7 Cross-Compilation and the Eclipse IDE 275</b></p> <p>Setting Up a Cross-Compilation Toolchain 276</p> <p>The Linaro Toolchain for Raspbian 277</p> <p>Debian Cross-Toolchains 279</p> <p>Cross-Compilation Using Eclipse 282</p> <p>Installing Eclipse on Desktop Linux 282</p> <p>Configuring Eclipse for Cross-Compilation 283</p> <p>Remote System Explorer 286</p> <p>Integrating GitHub into Eclipse 289</p> <p>Remote Debugging 289</p> <p>Automatic Documentation (Doxygen) 294</p> <p>Building Linux 297</p> <p>Downloading the Kernel Source 298</p> <p>Building the Linux Kernel 299</p> <p>Deploying the Linux Kernel 303</p> <p>Building a Linux Distribution (Advanced) 305</p> <p>Summary 307</p> <p>Further Reading 308</p> <p><b>Chapter 8 Interfacing to the Raspberry Pi Buses 309</b></p> <p>Introduction to Bus Communication 310</p> <p>I<sup>2</sup>C 310</p> <p>I<sup>2</sup>C Hardware 311</p> <p>An I<sup>2</sup>C Test Circuit 315</p> <p>Using Linux I2C-Tools 318</p> <p>I<sup>2</sup>C communication in C 325</p> <p>Wrapping I<sup>2</sup>C Devices with C++ Classes 328</p> <p>Spi 330</p> <p>SPI Hardware 330</p> <p>SPI on the RPi 332</p> <p>A First SPI Application (74HC595) 334</p> <p>Bidirectional SPI Communication in C/C++ 339</p> <p>Multiple SPI Slave Devices on the RPi 346</p> <p>UART 347</p> <p>The RPi UART 348</p> <p>UART Examples in c 352</p> <p>UART Applications - GPS 357</p> <p>Logic-Level Translation 359</p> <p>Summary 361</p> <p>Further Reading 361</p> <p><b>Chapter 9 Enhancing the Input/Output Interfaces on the RPi 363</b></p> <p>Introduction 364</p> <p>Analog-to-Digital Conversion 364</p> <p>SPI Analog-to-Digital Converters (ADCs) 365</p> <p>ADC Application: An Analog Light Meter 368</p> <p>Testing the SPI ADC Performance 370</p> <p>The C Library for BCM2835 (Advanced) 373</p> <p>Digital-to-Analog Conversion 376</p> <p>An I<sup>2</sup>C Digital-to-Analog Converter 376</p> <p>An SPI Digital-to-Analog Converter 379</p> <p>Adding PWM Outputs to the RPi 381</p> <p>Extending the RPi GPIOs 387</p> <p>The MCP23017 and the I 2 C Bus 389</p> <p>The MCP23S17 and the SPI Bus 393</p> <p>A C++ Class for the MCP23x17 Devices 394</p> <p>Adding UARTs to the RPi 397</p> <p>Summary 403</p> <p><b>Chapter 10 Interacting with the Physical Environment 405</b></p> <p>Interfacing to Actuators 406</p> <p>DC Motors 407</p> <p>Stepper Motors 414</p> <p>Relays 418</p> <p>Interfacing to Analog Sensors 420</p> <p>Linear Analog Sensors 422</p> <p>Nonlinear Analog Sensors 423</p> <p>Analog Sensor Signal Conditioning 428</p> <p>Interfacing to an Analog Accelerometer 431</p> <p>Interfacing to Local Displays 433</p> <p>MAX7219 Display Modules 433</p> <p>Character LCD Modules 436</p> <p>OLED Dot-Matrix Display 440</p> <p>Building C/C++ Libraries 444</p> <p>Makefiles 444</p> <p>CMake 446</p> <p>Summary 452</p> <p><b>Chapter 11 Real-Time Interfacing Using the Arduino 453</b></p> <p>The Arduino 454</p> <p>An Arduino Serial Slave 457</p> <p>A UART Echo Test Example 457</p> <p>UART Command Control of an Arduino 461</p> <p>An Arduino I<sup>2</sup>C Slave 464</p> <p>An I<sup>2</sup>C Test Circuit 464</p> <p>I<sup>2</sup>C Register Echo Example 465</p> <p>I<sup>2</sup>C Temperature Sensor Example 467</p> <p>I<sup>2</sup>C Temperature Sensor with a Warning LED 469</p> <p>Arduino Slave Communication Using C/C++ 471</p> <p>An I<sup>2</sup>C Ultrasonic Sensor Application 473</p> <p>An Arduino SPI Slave 476</p> <p>Programming the Arduino from the RPi Command Line 478</p> <p>Summary 480</p> <p><b>Part III Advanced Interfacing and Interaction 481</b></p> <p><b>Chapter 12 The Internet of Things 483</b></p> <p>The Internet of Things (IoT) 484</p> <p>The RPi as an IoT Sensor 485</p> <p>The RPi as a Sensor Web Server 487</p> <p>Nginx 488</p> <p>GNU Cgicc Applications (Advanced) 494</p> <p>A C/C++ Web Client 498</p> <p>Network Communications Primer 499</p> <p>A C/C++ Web Client 500</p> <p>Secure Communication Using OpenSSL 502</p> <p>The RPi as a “Thing” 503</p> <p>ThingSpeak 504</p> <p>The Linux Cron Scheduler 506</p> <p>Sending E-mail from the RPi 510</p> <p>If This Then That (IFTTT) 512</p> <p>Large-Scale IoT Frameworks 513</p> <p>MQ Telemetry Transport (MQTT) 514</p> <p>IBM Bluemix Internet of Things 515</p> <p>An IBM IoT MQTT Node.js Publish Example 518</p> <p>An IBM IoT MQTT C++ Publish Example 520</p> <p>Visualize Data Using IBM Quickstart 521</p> <p>The C++ Client/Server 523</p> <p>IoT Device Management 526</p> <p>Remote Monitoring of the RPi 527</p> <p>RPi Watchdog Timers 528</p> <p>Static IP Addresses 529</p> <p>Power over Ethernet (PoE) 530</p> <p>Summary 533</p> <p><b>Chapter 13 Wireless Communication and Control 535</b></p> <p>Introduction to Wireless Communications 536</p> <p>Bluetooth Communications 537</p> <p>Installing a Bluetooth Adapter 537</p> <p>Android App Development with Bluetooth 543</p> <p>Wi-Fi Communications 544</p> <p>Installing a Wi-Fi Adapter 544</p> <p>The NodeMCU Wi-Fi Slave Processor 547</p> <p>ZigBee Communications 559</p> <p>Introduction to XBee Devices 559</p> <p>XBee Configuration 561</p> <p>An XBee AT Mode Example 563</p> <p>An XBee API Mode Example 568</p> <p>Near Field Communication 572</p> <p>Summary 575</p> <p><b>Chapter 14 Raspberry Pi with a Rich User Interface 577</b></p> <p>Rich UI RPi Architectures 578</p> <p>The RPi as a General-Purpose Computer 579</p> <p>RPi with an LCD Touchscreen 582</p> <p>Virtual Network Computing (VNC) 583</p> <p>Fat-Client Applications 585</p> <p>Rich UI Application Development 586</p> <p>Introduction to GTK+ on the RPi 586</p> <p>Introduction to Qt on the RPi 590</p> <p>Qt Primer 592</p> <p>Qt Concepts 592</p> <p>Qt Development Tools 596</p> <p>A First Qt Creator Example 597</p> <p>A Qt Weather GUI Application 598</p> <p>Remote UI Application Development 602</p> <p>Fat-Client Qt GUI Application 603</p> <p>Multithreaded Server Applications 606</p> <p>The Multithreaded Weather Server 609</p> <p>Summary 612</p> <p>Further Reading 613</p> <p><b>Chapter 15 Images, Video, and Audio 615</b></p> <p>Capturing Images and Video 616</p> <p>The RPi Camera 616</p> <p>USB Webcams 619</p> <p>Video4Linux2 (V4L2) 621</p> <p>Streaming Video 627</p> <p>Image Processing and Computer Vision 628</p> <p>Image Processing with OpenCV 628</p> <p>Computer Vision with OpenCV 631</p> <p>Boost 633</p> <p>Raspberry Pi Audio 634</p> <p>Core Audio Software Tools 635</p> <p>Audio Devices for the RPi 635</p> <p>Text-to-Speech 643</p> <p>Summary 644</p> <p>Further Reading 645</p> <p><b>Chapter 16 Kernel Programming 647</b></p> <p>Introduction 648</p> <p>Why Write Kernel Modules? 648</p> <p>Loadable Kernel Module (LKM) Basics 649</p> <p>A First LKM Example 650</p> <p>The LKM Makefile 652</p> <p>Building the LKM on a Linux Desktop Machine 653</p> <p>Building the LKM on the RPi 654</p> <p>Testing the First LKM Example 657</p> <p>An Embedded LKM Example 659</p> <p>Interrupt Service Routines (ISRs) 661</p> <p>Performance 665</p> <p>Enhanced Button GPIO Driver LKM 665</p> <p>The kobject Interface 666</p> <p>Enhanced LED GPIO Driver LKM 673</p> <p>Kernel Threads 674</p> <p>Conclusions 675</p> <p>Summary 676</p> <p>Index 677</p>
<p><b>D<small>R</small>. DEREK MOLLOY</b> is a senior lecturer at the School of Electronic Engineering, Faculty of Engineering and Computing, Dublin City University, Ireland. He is also the author of the hugely popular book on the BeagleBone platform titled <i>Exploring BeagleBone</i>, also published by Wiley. His popular YouTube video series has introduced millions of people to embedded Linux and digital electronics topics. He has received several awards for teaching and learning, including the 2012 Irish Learning Technology Association (ILTA) national award for Innovation in Teaching and Learning. The same year, he was also awarded the Dublin City University President's Award for Excellence in Teaching and Learning.
<p><i>"Exploring Raspberry Pi</i> is THE book to go to if you are interested in learning about the impressive physical computing capabilities of the Raspberry Pi platform. Derek Molloy imparts the electronics, programming, and embedded Linux skills that are vital to today's innovators in building the next generation of Internet of Things applications.".<br/> <b>— <i>Eben Upton,</i></b> <i>Co-creator of the Raspberry Pi</i> <p><b>BUILD THE SKILLS YOU NEED TO INNOVATE</b> <p>Economical and versatile, the Raspberry Pi can be adapted for thousands of applications. Open up all its possibilities by applying engineering principles along with Linux programming techniques, and develop the skills you need to design and build an endless array of projects. <p><i>Exploring Raspberry Pi</i> first covers the basics of the hardware platform, recommended accessories, software, embedded Linux systems, and Linux programming techniques. Then it takes you deeper into interfacing, controlling, and communicating, with detailed information about Raspberry Pi GPIOs, buses, UART devices, and USB peripherals. You will learn to configure a cross-compilation environment in order to build large-scale software applications, as well as how to combine hardware and software to enable the Raspberry Pi to interact effectively with its physical environment. Finally, you'll discover how to use the Raspberry Pi for advanced interfacing and interaction applications such as the Internet of Things (IoT); wireless communication and control; rich user interfaces; images, video, and audio; and Linux kernel programming. <p>Instead of recipes for a few specific projects, <i>Exploring Raspberry Pi</i> arms you with the skills needed to build the projects that exist in your imagination. You'll learn to: <ul> <li>Develop essential Linux and programming skills</li> <li>Build Internet of Things (IoT) applications</li> <li>Master interfacing, controlling, and communication</li> <li>Design applications that interact with the physical environment</li> <li>Utilize the Arduino platform as a service processor</li> <li>Build wireless communication applications</li> <li>Write and install a custom Linux loadable kernel module</li> <li>Apply the Raspberry Pi 3 and Raspberry Pi Zero to your projects</li> </ul> <p>Visit the companion website at <b>www.exploringrpi.com</b>

Diese Produkte könnten Sie auch interessieren:

Chemie in Lebensmitteln
Chemie in Lebensmitteln
von: Johannes Friedrich Diehl
PDF ebook
61,99 €
Lebensmittelführer
Lebensmittelführer
von: Günter Vollmer, Gunter Josst, Dieter Schenker, Wolfgang Sturm, Norbert Vreden
PDF ebook
16,99 €
Lebensmittelführer
Lebensmittelführer
von: Günter Vollmer, Gunter Josst, Dieter Schenker, Wolfgang Sturm, Norbert Vreden
PDF ebook
16,99 €