Build your own Internet of Things (IoT) projects for prototyping and proof-of-concept purposes.Updated for the Raspberry Pi 4 and other recent boards, this book contains the tools needed to build a prototype of your design, sense the environment, communicate with the Internet (over the Internet and Machine to Machine communications) and display the results.
Raspberry Pi IoT Projects, 2nd Edition provides several IoT projects and designs shown from the start to the finish including an IoT Heartbeat Monitor, an IoT Swarm, IoT Solar Powered Weather Station, an IoT iBeacon Application and a RFID (Radio Frequency Identification) IoT Inventory Tracking System.
The software is presented as reusable libraries, primarily in Python and C with full source code available, making this version a valuable learning resource for classrooms and learning labs.
What You'll Learn
• Create IOT projects with the Raspberry Pi
• Talk to sensors with the Raspberry Pi
• Use iBeacons with the IOT Raspberry Pi
• Communicate your IOT data to the Internet
• Build security into your IOT device
Who This Book Is For
Primary audience are those with some technical background, but not necessarily engineers. It will also appeal to technical people wanting to learn about the Raspberry Pi in a project-oriented method.
Author(s): John C. Shovic
Edition: 2
Publisher: Apress
Year: 2021
Language: English
Commentary: Vector PDF
Pages: 295
City: New York, NY
Tags: Cloud Computing; Swarm Intelligence; Security; Python; Internet of Things; Monitoring; Raspberry Pi; ESP8266; MQTT; Sensors; RFID; Do-It-Yourself; Sensor Networks; Bluetooth Low Energy; IBM Cloud
Table of Contents
About the Author
About the Technical Reviewer
Acknowledgments
Introduction
Chapters at a Glance
Chapter 1: Introduction to IoT
Choosing a Raspberry Pi Model
Choosing an IoT Device
Characterizing an IoT Project
Communications
Processor Power
Local Storage
Power Consumption
Functionality
Cost
The Right Tools to Deal with Hardware
Writing Code in Python and the Arduino IDE
In This Book
Chapter 2: Sensing Your IoT Environment
IoT Sensor Nets
IoT Characterization of This Project
How Does This Device Hook Up to the IoT?
What Is an ESP8266?
The LightSwarm Design
Building Your First IoT Swarm
Installing Arduino Support on the PC or Mac
Your First Sketch for the ESP8266
The Hardware
Reviewing the I2C Bus
Pullups on the I2C Bus
Sensor Being Used
3D Printed Case
The Full Wiring List
The Software
Self-Organizing Behavior
Monitoring and Debugging the System with the Raspberry Pi (the Smart Guy on the Block)
LightSwarm Logging Software Written in Python
Results
What Else Can You Do with This Architecture?
Conclusion
Chapter 3: Building an IoT Weather Station
IoT Characterization of This Project
How Does This Device Hook Up to the IoT?
Data Gathering
What Are Grove Connectors
The Project – SkyWeather2
The Architecture of SkyWeather2
What Do You Need to Build This Project?
Connecting and Testing the Hardware
Weatherization and the 3D Printed Box for SkyWeather2
The Software
Non-normal Requirements for Your Pi
The SkyWeather2 Python3 Software
The Scheduler Tasks
The Software-Defined Radio
The SkyWeather2 Configuration Software
The Dash App Local Display
SkyWeather2 and Blynk
Supplying Your Data to the World – WeatherSTEM
Tweeting Your Weather Data
A Little History and Science
Conclusion
Chapter 4: Changing Your Environment with IoT and iBeacons
The BeaconAir Project
IoT Characterization of This Project
How Does This Device Hook Up to the IoT?
Hardware List
iBeacons
Python3 Bluetooth iBeacon Scanner
Philips Hue Lighting System
Philips Hue Hub
BeaconAir Hardware, Software, and Configuration
BeaconAir Hardware Description
BeaconAir Software Description
BeaconAir Configuration File
iBeacon Software
Trilateralization
Issuing Commands to LightSwarm
Installing BlueZ and Phue on the Raspberry Pi
BlueZ
Phue
Startup Procedure
Making BeaconAir Start on Bootup
How It Works in Practice
Things to Do
The Classic Distributed System Problems
Conclusion
Chapter 5: Connecting an IoT Device to a Cloud Server: IoTPulse
IoT Characterization of This Project
The Internet of Things on the Global Network
Cloud Computing
Application Builders
Display and Report Generation
The IBM Cloud Internet of Things Solution
The IoTPulse Design
Building the IoTPulse
Plugging the FTDI Cable into the ESP8266
3D Printing Files for the IoT Case
Software Needed
The IoTPulse Code
IOTPulse.ino
Reviewing the Arduino IDE Serial Monitor Results
Joining IBM Cloud and the IoT Foundation
Sending Your Data to Cloud
MQTT
JSON Data Payload
Examining Real-Time Data on the IBM Cloud IoT Platform
Advanced Topics
Historical Data
Node-RED Applications
Watson Applications
Conclusion
Chapter 6: Using IoT for RFID and MQTT and the Raspberry Pi
IoT Characterization of This Project
What Is RFID Technology?
What Is MQTT?
Hardware Used for IoTRFID
Building an MQTT Server on a Raspberry Pi
The Software on the Raspberry Pi
Installing the MQTT “Mosquitto”
Configuring and Starting the Mosquitto Server
Starting the Mosquitto Server
Testing the Mosquitto Server
Building the IoTRFID
The Parts Needed
Installing Arduino Support on the PC or Mac
The Hardware
What Is This Sensor We Are Using?
3D Printed Case
The Full Wiring List
The Software for the IoTRFID Project
The Libraries
The Main Software
Testing the IoTRFID System
Setting Up the Mosquitto Debug Window
Set Up a Subscriber on the Raspberry Pi
Testing the Entire IoTRFID System
What to Do with the RFID Data on the Server
Conclusion
Chapter 7: Computer Security and the IoT
IoT: Top Five Things to Know About IoT Computer Security
Number 1: This Is Important. You Can Prove Your Application Is Insecure, but You Can’t Prove Your Application Is Secure
Number 2: Security Through Obscurity Is Not Security
Number 3: Always Connected? Always Vulnerable
Number 4: Focus on What Is Important to Be Secure in Your IoT Application
Number 5: Computer Security Rests on Three Main Aspects: Confidentiality, Integrity, and Availability
What Are the Dangers?
Assigning Value to Information
Building the Three Basic Security Components for IoT Computers
Confidentiality – Cryptography
Cryptography on the Arduino
Cryptography on the Raspberry Pi
Integrity – Authentication
Cryptographic Hashes on the Arduino/Raspberry Pi
Availability – Handling DOS/Loss of Server/Watchdogs
Key Management
Update Management
Conclusion
Appendix A:
Suggestions for Further Work
Parting Words…
Index