Programming the Internet of Things: An Introduction to Building Integrated, Device-to-Cloud IoT Solutions
- Length: 350 pages
- Edition: 1
- Language: English
- Publisher: O'Reilly Media
- Publication Date: 2021-08-17
- ISBN-10: 1492081418
- ISBN-13: 9781492081418
- Sales Rank: #0 (See Top 100 Books)
Learn how to program the Internet of Things with this hands-on guide. By breaking down IoT programming complexities in step-by-step, building-block fashion, author and educator Andy King shows you how to design and build your own full stack, end-to-end IoT solution–from device to cloud. This practical book walks you through tooling, development environment setup, solution design, and implementation.
You’ll learn how a typical IoT ecosystem works, as well as how to tackle integration challenges that crop up when implementing your own IoT solution. Whether you’re an engineering student learning the basics of the IoT, a tech-savvy executive with a company embarking on an IoT journey, or a programmer building your own smart house solution, this practical book will help you get started.
- Design an end-to-end solution that implements an IoT use case
- Set up an IoT-centric development and testing environment
- Organize your software design by creating abstractions in Python and Java
- Use MQTT, CoAP, and other protocols to connect IoT devices and services
- Create a custom JSON-based data format that’s consumable across a range of platforms and services
- Use cloud services to support your IoT ecosystem and provide business value for stakeholders
Table of contents
I. Getting Started
1. Getting Started
2. Initial Edge Tier Applications
II. Connecting to the Physical World
3. Data Simulation
4. Data Emulation
5. Data Management
III. Connecting to Other Things
6. MQTT Integration–Overview and Python Client
7. MQTT Integration–Java Client
8. CoAP Server Implementation
9. CoAP Client Integration
10. Edge Integration
IV. Connecting to the Cloud
11. Integrating with Various Cloud Services
12. Taming the IoT
Foreword Preface Who Is This Book For? To the Programmer To the Instructor To the Technology Manager or Executive What Do I Need to Know? How Is This Book Arranged? Part I, Getting Started Part II, Connecting to the Physical World Part III, Connecting to Other Things Part IV, Connecting to the Cloud Some Background on the IoT Complexity Redefined Creating Value Living on the Edge Conclusion Conventions Used in This Book Using Code Examples O’Reilly Online Learning How to Contact Us Acknowledgments I. Getting Started 1. Getting Started What You’ll Learn in This Chapter Defining Your System Breaking Down the Problem Defining Relevant Outcomes Architecting a Solution Setting Up Your Development and Test Environment Step I: Prepare Your Development Environment Configuring an integrated development environment (IDE) Set up your Gateway Device Application project Set up your Constrained Device Application project Application configuration Step II: Define Your Testing Strategy Unit, integration, and performance testing Testing tips for the exercises in this book Step III: Manage Your Design and Development Workflow Managing requirements Setting up your remote repositories Code management and branching Thoughts on Automation Automated CI/CD in the cloud Automated CI/CD in your local development environment Containerization Programming Exercises Testing the Constrained Device App Testing the Gateway Device App Conclusion 2. Initial Edge Tier Applications What You’ll Learn in This Chapter Design Concepts Tracking Your Requirements Programming Exercises Add System Performance Tasks to the Constrained Device Application Review the Constrained Device Application module Create and integrate the system performance manager module Create the system utility task modules Integrate the system utility tasks with the system performance manager Add System Performance Tasks to the Gateway Device Application Review the Gateway Device Application module Create and integrate the system performance manager module Create the system utility task modules Integrate the system utility tasks with the system performance manager Additional Exercises Conclusion II. Connecting to the Physical World 3. Data Simulation What You’ll Learn in This Chapter Simulating Sensors and Actuators Generating Simulated Data Using a Sensor Data Generator Class Programming Exercises Integrating Sensing and Actuation Simulation Within Your Application Design Representing Sensor and Actuator Data Within the Application Create Data Containers to Support Data Collection and Actuation Abstracting shared properties within a base class Implement the sensor and actuator data structures Implement the system performance data structure Simulating Sensors Simulating Actuators Connecting Simulated Sensors with the Sensor Adapter Manager Connecting Simulated Actuators with the Actuator Adapter Manager Create and Integrate the Device Data Manager Additional Exercises Hysteresis Management Conclusion 4. Data Emulation What You’ll Learn in This Chapter Emulating Sensors and Actuators Setting Up and Configuring an Emulator The Sense-Emu Sense HAT Emulator Programming Exercises Integrating Sensing and Actuation Emulation Within Your Application Design Emulating Sensors Emulating Actuators Connecting Emulated Sensors with the Sensor Adapter Manager Connecting Emulated Actuators with the Actuator Adapter Manager Additional Exercises Threshold Management Conclusion 5. Data Management What You’ll Learn in This Chapter Data Translation and Management Concepts Programming Exercises Data Translation in the Constrained Device App Update the system performance manager Add JSON translation using a data utility class Data Translation in the Gateway Device App Implement all data container structures Update the system performance manager Add JSON translation using a data utility class Create and integrate the device data manager Add local data persistence Additional Exercises Proactive Disk Utilization Management Conclusion III. Connecting to Other Things 6. MQTT Integration–Overview and Python Client What You’ll Learn in This Chapter About MQTT Connecting to a Broker Message Passing Control Packets and the Structure of an MQTT Message Adding MQTT to Your Applications Installing and Configuring an MQTT Broker Programming Exercises Create the MQTT Connector Abstraction Module Testing and validating the connection User Name and Password Will Retain, QoS Level, and Will Flag Dealing with callbacks Add Callbacks to Support MQTT Events Add Publish, Subscribe, and Unsubscribe Functionality Integrate the MQTT Connector into Your CDA What About Security? Additional Exercises Conclusion 7. MQTT Integration–Java Client What You’ll Learn in This Chapter Programming Exercises Create the MQTT Connector Abstraction Module Testing and validating the connection Add Callbacks to Support MQTT Events Add Publish, Subscribe, and Unsubscribe Functionality Integrate the MQTT Connector into Your GDA What About Security and Overall System Performance? Additional Exercises Subscriber Callbacks CDA to GDA Integration Conclusion 8. CoAP Server Implementation What You’ll Learn in This Chapter About CoAP Client to Server Connections Request Methods Message Passing Datagram Packets and the Structure of a CoAP Message Putting It All Together Programming Exercises Add CoAP Server Functionality to the Gateway Device Application Create the CoAP server abstraction and integrate it with DeviceDataManager Create resource handlers to support data update requests Create resource handlers to support data retrieval requests Create the resource handlers within the Gateway Device App CoAP server Add CoAP Server Functionality to the Constrained Device Application (Optional) A brief summary of the Constrained Device Application’s CoAP server abstraction Additional Exercises Add More Resource Handlers Add a Custom Discovery Service Add Dynamic Resource Creation Conclusion 9. CoAP Client Integration What You’ll Learn in This Chapter Concepts Programming Exercises Add CoAP Client Functionality to the Constrained Device Application Create the CoAP client abstraction and integrate it with DeviceDataManager Add the GET request method implementation Add the PUT request method implementation Add the OBSERVE (GET) request method implementation Add CoAP Client Functionality to the Gateway Device App (Optional) A brief summary of the Gateway Device Application’s CoAP client abstraction Additional Exercises Add a Robust OBSERVE Cancel Feature Add Support for DELETE and POST Conclusion 10. Edge Integration What You’ll Learn in This Chapter Concepts Security Exercises Adding TLS Support to Your MQTT Broker Add Security Features to Your Gateway Device App MQTT Client Connector Add Security Features to Your Constrained Device App MQTT Client Connector Functional Exercises Adding Business Logic to the Gateway Device App Adding Business Logic to the Constrained Device App Performance Testing Exercises Additional Exercises Add DTLS Support to Your CoAP Client and Server Conclusion IV. Connecting to the Cloud 11. Integrating with Various Cloud Services What You’ll Learn in This Chapter Concepts Programming Exercises Add the Cloud Client and Other Related Components Update the MQTT client connector implementation Add the Cloud Client Connector implementation Another design consideration (optional—sort of) Integrating with an IoT Cloud Service Provider (CSP) Ubidots Connectivity Overview Using MQTT Data sources and variables Topic names Auth tokens Connecting to the MQTT service using TLS Creating data sources and variables Publishing messages Subscribing to events Triggering actions Further information AWS IoT Core Connectivity Overview Using MQTT Provisioning a new device Topic names Authentication and authorization Connecting to the MQTT service using TLS Creating a function to handle incoming messages Triggering actions Further information Additional Exercises Analyzing and Acting on Time-Series Performance Data Conclusion 12. Taming the IoT What You’ll Learn in This Chapter IoT Ecosystem Enablers Security Capability Reliability Governance Sample IoT Use Cases Shared Enablers and a Common Notional Design Enablers (security, capability, reliability, and governance) Use Case 1: Home Environment Monitoring and Temperature Adjustment Measure, Model, and Manage Use Case 2: Garden Monitoring and Water Adjustment Measure, Model, and Manage Use Case 3: Pond Quality Monitoring Measure, Model, and Manage Conclusion A. Design Road Maps Part I, Getting Started—Design Road Maps Chapter 1 Designs Constrained Device Application design Gateway Device Application design Chapter 2 Designs Constrained Device Application design Gateway Device Application design Part II, Connecting to the Physical World—Design Road Maps Chapter 3 Design Constrained Device Application design Chapter 4 Design Constrained Device Application design Chapter 5 Designs Constrained Device Application design Gateway Device Application design Part III, Connecting to Other Things—Design Road Maps Chapter 6 Design Constrained Device Application design Chapter 7 Design Gateway Device Application design Chapter 8 Designs Gateway Device Application design Constrained Device Application design (optional) Chapter 9 Designs Constrained Device Application design Gateway Device Application design (optional) Chapter 10 Designs Constrained Device Application design Gateway Device Application design Part IV, Connecting to the Cloud—Design Road Maps Chapter 11 Designs Gateway Device Application design (basic) Gateway Device Application design (optional) Cloud Service Functions design (optional) Bibliography Index
Donate to keep this site alive
How to download source code?
1. Go to: https://www.oreilly.com/
2. Search the book title: Programming the Internet of Things: An Introduction to Building Integrated, Device-to-Cloud IoT Solutions
, sometime you may not get the results, please search the main title
3. Click the book title in the search results
3. Publisher resources
section, click Download Example Code
.
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.