31,19 €
The Internet of Things market increased a lot in the past few years and IoT development and its adoption have showed an upward trend. Analysis and predictions say that Enterprise IoT platforms are the future of IoT. AWS IoT is currently leading the market with its wide range of device support SDKs and versatile management console.
This book initially introduces you to the IoT platforms, and how it makes our IoT development easy. It then covers the complete AWS IoT Suite and how it can be used to develop secure communication between internet-connected things such as sensors, actuators, embedded devices, smart applications, and so on. The book also covers the various modules of AWS: AWS Greengrass, AWS device SDKs, AWS IoT Platform, AWS Button, AWS Management consoles, AWS-related CLI, and API references, all with practical use cases.
Near the end, the book supplies security-related best practices to make bi-directional communication more secure. When you've finished this book, you'll be up-and-running with the AWS IoT Suite, and building IoT projects.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 159
Veröffentlichungsjahr: 2018
Copyright © 2018 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Commissioning Editor: Gebin GeorgeAcquisition Editor: Heramb BhavsarContent Development Editor: Abhishek JadhavTechnical Editor: Swathy MohanCopy Editors: Safis Editing, Dipti MankameProject Coordinator: Judie JoseProofreader: Safis EditingIndexer: Rekha NairGraphics: Tom ScariaProduction Coordinator: Nilesh Mohite
First published: January 2018
Production reference: 1250118
Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK.
ISBN 978-1-78839-611-0
www.packtpub.com
Mapt is an online digital library that gives you full access to over 5,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career. For more information, please visit our website.
Spend less time learning and more time coding with practical eBooks and Videos from over 4,000 industry professionals
Improve your learning with Skill Plans built especially for you
Get a free eBook or video every month
Mapt is fully searchable
Copy and paste, print, and bookmark content
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks.
Agus Kurniawan is a lecturer, researcher, IT consultant, and author. He has more than 16 years of experience in various software and hardware development projects for various companies. He also has been delivering materials in training and workshops, and delivering technical writing. He has been awarded the Microsoft Most Valuable Professional (MVP) award for 13 years in a row. He is currently doing some research related to software engineering, machine learning, networking and security systems at the Faculty of Computer Science, University of Indonesia, Indonesia.
Ruben Oliva Ramos is a computer systems engineer from Tecnologico of León Institute, with a master's degree in computer and electronics systems engineering, with a specialization in teleinformatics and networking from University of Salle Bajio in Leon, Guanajuato, Mexico. He has more than 5 years of experience of developing web applications to control and monitor devices connected with Arduino and Raspberry Pi using web frameworks and cloud services to build the IoT applications.
If you're interested in becoming an author for Packt, please visit authors.packtpub.com and apply today. We have worked with thousands of developers and tech professionals, just like you, to help them share their insight with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea.
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Download the color images
Conventions used
Get in touch
Reviews
Getting Started with AWS IoT
Introducing AWS IoT
Introducing IoT devices and platforms for AWS IoT
Arduino
Raspberry Pi
BeagleBone Black and Green
IoT boards based on ESP8266 MCU
IoT boards based on ESP32
IoT boards based on TI CC32XX MCU
AWS IoT Management Console
AWS IoT Device SDK
Setting up AWS IoT for your IoT project
Creating an AWS account
Selecting an IoT device
Creating a security certificate
Configuring security access for AWS IoT
Setting up the development environment
Building an AWS IoT program
How to work with the program?
Testing all
Summary
Connecting IoT Devices to AWS IoT Platform
Introducing a connectivity model for AWS IoT
Selecting your IoT devices for AWS IoT
Configuring IoT devices to AWS IoT
AWS IoT development for Raspberry Pi 3
AWS IoT development for Arduino
AWS IoT development for boards based on ESP32
Building an IoT project with AWS IoT
Configuring AWS IoT
Developing the Arduino program
Developing a sensor subscriber
Testing
Summary
Optimizing IoT Computing Using AWS Greengrass
Introducing AWS Greengrass
Exploring supported IoT devices for AWS Greengrass
Deploying AWS Greengrass on Raspberry Pi 3
Preparing Raspberry Pi 3
Configuring Raspberry Pi 3 and IoT devices to AWS IoT
Configuring AWS Greengrass security
Installing AWS Greengrass on Raspberry Pi
Accessing AWS Greengrass
Building IoT projects with AWS Greengrass
Preparing runtime libraries on AWS Greengrass Core
Creating AWS Lambda
Deploying AWS Lambda with AWS Greengrass
Testing Lambda from Greengrass
Summary
Building Local AWS Lambda with AWS Greengrass
Introducing AWS Lambda
Creating the AWS Lambda function
Testing the AWS Lambda function
Publishing the AWS Lambda function
Configuring AWS Lambda security
Invoking the AWS Lambda function
Deploying AWS Lambda with AWS Greengrass on Raspberry Pi 3
Accessing AWS Lambda from IoT devices
Building IoT projects with AWS Lambda and AWS Greengrass
Accessing local resources
Developing local AWS Lambda
Configuring AWS Greengrass Core
Testing the demo
Interacting with things within a group
Summary
Expanding IoT Capabilities with AWS IoT Button
Introducing AWS IoT Button
Reviewing a project scenario for AWS IoT Button
Setting up AWS IoT Button
Registering AWS IoT Button to AWS IoT
Connecting AWS IoT Button to a network
Testing
Interaction between AWS IoT Button and IoT devices
Building your IoT project with AWS IoT Button
Configuring AWS DynamoDB
Building Lambda and its rule
Building a Lambda program
Testing using IoT Button
Summary
Visualizing AWS IoT Data
Introducing IoT massive data
Introducing brief data visualization
Data visualization in the web
Data-Driven Documents (D3)
Chart.js
Flot
Consuming real-time sensor data in a web application
Visualizing data from AWS IoT
Configuring AWS IoT
Configuring AWS Cognito
Configuring AWS IAM
Developing a sensor publisher
Developing data visualization from AWS IoT
Running the project
Introducing Amazon QuickSight
Consuming sensor data from Amazon QuickSight
Building data visualization for your IoT projects
Summary
Building Predictive Analytics for AWS IoT
Introducing AWS Machine Learning services
Making your sensor speak
Introducing Amazon Polly
Developing a program for Amazon Polly
Integrating Amazon Echo into your IoT projects
Preparing the project
Adding user role
Configuring AWS IoT
Creating AWS Lambda
Building Amazon Alexa skills
Testing the project
Making image and video analysis
Introducing Amazon Rekognition
Working with Pi Camera on Raspberry Pi
Uploading images to Amazon S3
Performing image analysis
Make predictive analytics for IoT data
Build a simple predictive analytics for your IoT project
Defining a machine learning model
Preparing data
Building a machine learning model
Evaluating and testing the model
Summary
Securing AWS IoT
Introducing IoT security
Understanding IoT risks
Introducing AWS IoT identity and security
Securing communication between AWS IoT and IoT devices
Authentication and authorization
Managing AWS IAM
Building a secure AWS IoT for your IoT project
Designing and implementing
Performing regular security testing
Working with security best practices
Summary
Other Books You May Enjoy
Leave a review - let other readers know what you think
The Internet of Things (IoT) market has increased a lot in the past few years, and the adoption and development of IoT have an upward trend. Analysis and predictions say that enterprise IoT platforms are the future of IoT. AWS IoT is currently leading the market with its wide range of device support SDKs and its versatile management console.This book initially introduces you to the IoT platforms and how they make our IoT development easy. It then covers the complete AWS IoT suite and how it can be used to develop secure communication between internet-connected things, such as sensors, actuators, embedded devices, and smart applications. The book also covers the various modules of AWS—AWS Greengrass, AWS device SDKs, AWS IoT Platform, AWS Button, AWS Management consoles, AWS-related CLI, and API references, all with practical use cases.Toward the end, the book supplies security-related best practices in order to make bidirectional communication more secure. When you've finished this book, you'll be up and running with the AWS IoT suite and building IoT projects.
This book is for anyone who wants to get started with the AWS IoT suite and implement it with practical use cases. This book acts as an extensive guide, on completion of which you will be in a position to start building IoT projects using the AWS IoT platform and start using cloud services for your projects.
Chapter 1, Getting Started with AWS IoT, introduces the book and presents the platforms, hardware, and tools that will be used, getting started to use AWS IoT.
Chapter 2, Connecting IoT Devices to AWS IoT Platform, will show you how to build an IoT application that involves the AWS IoT platform.
Chapter 3, Optimizing IoT Computing Using AWS Greengrass, walks through how to deploy AWS Greengrass on local IoT devices to enable customers to build IoT devices that can execute local applications.
Chapter 4, Building Local AWS Lambda with AWS Greengrass, will teach the reader how to deploy local AWS Lambda with AWS Greengrass to enable IoT devices use a local AWS server.
Chapter 5, Expanding IoT Capabilities with AWS IoT Button, will show how to work with AWS IoT button and integrate it with their IoT projects.
Chapter 6, Visualizing AWS IoT Data, will build IoT data visualizations that are obtained from IoT devices.
Chapter 7, Building Predictive Analytics for AWS IoT, will explain how to manage AWS IoT data and make predictive analytics to get insight from data.
Chapter 8, Securing AWS IoT, will show how to secure AWS IoT between AWS IoT servers and IoT devices.
As the practical examples involve the use of AWS, an AWS account is required. The hardware requirements for this book include the following:
Raspberry Pi 3
Arduino Yún
AWS IoT Button
SimpleLink™ Wi-Fi® CC3220SF Wireless LaunchPad
DHT22 Sensor
LEDs
Breadboard
Jumper cables
The software requirements are as follows:
AWS License
Arduino Software
Python and its libraries
Node.js
You can download the example code files for this book from your account at www.packtpub.com. If you purchased this book elsewhere, you can visit www.packtpub.com/support and register to have the files emailed directly to you.
You can download the code files by following these steps:
Log in or register at
www.packtpub.com
.
Select the
SUPPORT
tab.
Click on
Code Downloads & Errata
.
Enter the name of the book in the
Search
box and follow the onscreen instructions.
Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:
WinRAR/7-Zip for Windows
Zipeg/iZip/UnRarX for Mac
7-Zip/PeaZip for Linux
The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Learning-AWS-IoT. We also have other code bundles from our rich catalog of books and videos available athttps://github.com/PacktPublishing/. Check them out!
We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it from https://www.packtpub.com/sites/default/files/downloads/LearningAWSIoT_ColorImages.pdf.
There are a number of text conventions used throughout this book.
CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "To install the AWS IoT SDK for JavaScript, you can do so through the npm package."
A block of code is set as follows:
device .on('connect', function() { console.log('connected'); device.subscribe('topic_1'); device.publish('topic_1', JSON.stringify({ test_data: 1})); });
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
device .on('message', function(topic, payload) { console.log('recv:', topic, payload.toString());});
console.log('Sensor subscriber started.');
Any command-line input or output is written as follows:
$ npm install aws-iot-device-sdk
Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "You can click on the Get started button in the Configuring a device section".
Feedback from our readers is always welcome.
General feedback: Email [email protected] and mention the book title in the subject of your message. If you have questions about any aspect of this book, please email us at [email protected].
Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.
Piracy: If you come across any illegal copies of our works in any form on the Internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.
If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.
Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!
For more information about Packt, please visit packtpub.com.
Deploying multiple Internet of things (IoT) devices on some locations and serving all requests from IoT devices needs more attention in order to obtain high availability and good performance. One of the approaches is to deploy a cloud server with high availability and advanced features. In this chapter, we will get started working with Amazon Web Services (AWS) IoT.
By the end of this chapter, you will know how to:
Introduce AWS IoT
Introduce IoT devices and platform for AWS IoT
Use AWS IoT Management Console
Use AWS IoT device SDK
Set up AWS IoT for your IoT project
Build a program to access AWS IoT
So, let's get started!
In recent years, there have been a lot of IoT boards built by either manufacturers or indie makers. Each IoT offers unique features to build IoT applications to address users problems. Sensor and actuator devices are attached to these IoT boards to generate data. There is a lot of sensor data from IoT devices that we can analyze.
Suppose we have various IoT boards that are deployed on some locations. Since these IoT devices generate sensor data, we need a backend server with high availability to serve incoming data. In particular cases, we also need to analyze the data to obtain insights. To perform this scenario, we need more computing engines, such as storage and machine learning engines.
The general design of AWS IoT architecture is illustrated in the following figure. There are several components inside AWS IoT, including its endpoints. IoT devices can access AWS IoT through the AWS message broker with their own SDK. AWS IoT also provides SDK for various IoT device platforms. Using AWS IoT SDK, IoT devices can access AWS IoT directly. We will review some AWS IoT SDK, including its protocol and API, throughout this book. The AWS IoT components are shown in the following image:
From the preceding figure, we can see the following AWS IoT components:
Message broker
: This is basically an AWS IoT endpoint where IoT devices can access the AWS server through the
Message Queuing Telemetry Transport
(
MQTT
) protocol. Message broker also supports primitive protocols, such as the HTTP protocol. Your IoT device can send data with AWS IoT through HTTP REST.
Thing Registry