27,59 €
There is a lot of work that is being done in the IoT domain and according to Forbes the global IoT market will grow from $157B in 2016 to $457B by 2020. This is an amazing market both in terms technology advancement as well as money.
In this book, we will be covering five popular IoT platforms, namely, AWS IoT, Microsoft Azure IoT, Google IoT Core, IBM Watson IoT, and Kaa IoT middleware. You are going to build solutions that will use a Raspberry Pi 3, a DHT11 Temperature and humidity sensor, and a dashboard to visualize the sensor data in real-time. Furthermore, you will also explore various components of each of the platforms that are needed to achieve the desired solution.
Besides building solutions, you will look at how Machine Learning and IoT go hand in hand and later design a simple predictive web service based on this concept. By the end of this book, you will be in a position to implement an IoT strategy best-fit for your organization
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 236
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: Prachi BishtContent Development Editor: Trusha ShriyanTechnical Editor:Vishal K. MewadaCopy Editor: Safis EditingProject Coordinator: Kinjal BariProofreader: Safis EditingIndexer: Priyanka DhadkeGraphics: Jisha ChirayilProduction Coordinator: Shraddha Falebhai
First published: April 2018
Production reference: 1270418
Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK.
ISBN 978-1-78883-839-9
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.
Arvind Ravulavaru is a platform architect at Ubiconn IoT Solutions, with more than 9 years, experience in software development and 2 years, in hardware and product development. For the past 5 years, he has been working extensively on JavaScript, both on the server- and client-side. And for the past couple of years in IoT, building a platform for rapidly developing IoT solutions, named The IoT Suitcase. Prior to that, Arvind worked on big data, cloud computing, and orchestration.
Yatish Patil works with Saviant Consulting as a technical project manager. He has delivered enterprise IoT and analytics applications using Microsoft Azure, ASP.NET, MVC, C#, SQL Server, and NoSQL. He has worked in different domains, as IT, Utilities, manufacturing, and engineering.
He is a Microsoft Azure Certified professional and was among the industry speakers at India IoT Symposium, 2016. He has delivered a session on remote asset monitoring with Azure IoT Suite. Yatish is the Author of Azure IoT Development Cookbook and has reviewed Microsoft Azure IaaS Essentials.
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.
Title Page
Copyright and Credits
Enterprise Internet of Things Handbook
Packt Upsell
Why subscribe?
PacktPub.com
Contributors
About the author
About the reviewer
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Conventions used
Get in touch
Reviews
Introduction to IoT
Internet of Things
History
IoT and the market
IoT technology stack
Building blocks
Smart devices
Microcontroller versus microprocessor
Sensors
Actuators
Controllers
Integrated controllers
Assembled controllers
Possible combinations
System on Chips
Popular SoCs in market
Hardware communication protocols
GPIO
Analog reading
UART
SPI
I2C
Gateway and cloud communication
Device Management Software
Device to cloud communication protocols
Message Queuing Telemetry Transport
MQTT for Sensor Networks
Constrained Application Protocol
Simple Text Oriented Messaging Protocol
Advanced Message Queuing Protocol
Representational state transfer
WebSockets
Storage
MongoDB
Apache Cassandra
Time series databases
InfluxDB
KairosDB
Netflix Atlas
RIAK TS
API management
API gateway administration
Applications
Intelligence
Rules and alerts
IFTTT
Scheduling
Third-party integration
IoT and security
Mirai bot attack
Ransomware
End-to-end architecture
Using cloud computing
Pros and cons of using cloud computing in the IoT
Using fog computing
Pros and cons of using fog computing in the IoT
Edge computing
Which is better?
IoT standards
Summary
Further reading
Applications of IoT
IoT and its value proposition
Connected devices
Smart devices
Artificial intelligence
Healthcare and IoT
Remote diagnosis
AI doctors
Industrial IoT
Optimization
Predictive maintenance
Other applications of IoT
Agriculture
Smart city
Smart retail
Smart logistics
Summary
Getting Started with IoT Platforms
IoT platform or IoT middleware
Why platforms?
IoT platforms
Example implementation
Setting up the Raspberry Pi 3
Setting up Node.js on the Raspberry Pi 3
Setting up ThingSpeak
Creating an account
Creating a channel
Sending test data
Building the solution
Things needed
Schematic
Summary
AWS IoT
AWS IoT
AWS IoT Core
AWS IoT Device Management
AWS Greengrass
AWS IoT Analytics
Amazon FreeRTOS
Designing the sample application
Solution
Architecture
End-to-end communication
Data visualization
Pricing
Building the sample application
End-to-end communication
Setting up the IoT Thing
Setting up Raspberry Pi 3 on the DHT11 node
Things needed
Setting up Node.js
Developing the Node.js Thing app
Reading the data from the Thing
Building the dashboard
Elasticsearch
Kibana
Setting up Elasticsearch
Setting up an IAM Role
Creating an IoT Rule
Elasticsearch configuration
Running the Thing
Building the Kibana dashboard
Summary
Further reading
Azure IoT
Azure IoT
IoT hub
Stream analytics
Designing a sample application
Solution
Architecture
End-to-end communication
Data visualization
Pricing
Building a sample application
End-to-end communication
Setting up the IoT hub
Setting up Raspberry Pi on the DHT11 node
Things needed
Setting up Node.js
Developing the Node.js device app
Reading the data from the IoT Thing
Building a dashboard
Azure stream analytics
Power BI
Execution steps
Signing up to Power BI
Setting up events
Creating a stream analytics job
Running the device
Building the visualization
Summary
Google Cloud IoT
Google Cloud IoT
Designing a sample application
Solution
Architecture
End-to-end communication
Data visualization
Pricing
Building a sample application
End-to-end communication
Setting up a project
Enabling APIs
Enabling device registry and devices
Setting up Raspberry Pi 3 with DHT11 node
Things needed
Setting up Node.js
Developing the Node.js device app
Reading the data from the device
Setting up credentials
Setting up subscriptions
Setting up the client
Building a dashboard
Google Cloud Functions
Google BigQuery
Google Data Studio
Setting up BigQuery
Setting up Google Cloud Function
Running the device
Google Data Studio reports
Summary
IBM Watson IoT
IBM Watson IoT
Designing the sample application
Solution
Architecture
End-to-end communication
Data visualization
Pricing
Building the sample application
End-to-end communication
Creating a platform
Setting up a Raspberry Pi 3 with DHT11 node
Things needed
Setting up Node.js
Developing the Node.js thing app
Reading the data from the device
Building the dashboard
Creating a schema
Creating a board
Summary
Kaa IoT
Kaa IoT
How does Kaa work?
Designing a sample application
Solution
Architecture
End-to-end communication
Data visualization
Pricing
Building a sample application
Downloading Kaa
Setting up a project
Setting up a MongoDB log appender
Setting up a REST log appender
Node.js server - REST Logger
Downloading the SDK and running the app
Setting up a client app
Downloading the Kaa SDK
Setting up dependencies
Setting up the hardware
Things needed
Running the application
Validating MongoDB data
Validating the REST log appender
Building a dashboard
ThingsBoard.io
Setting up ThingsBoard
Adding a REST log appender
Building the dashboard
Summary
IoT and Machine Learning
What is machine learning?
Machine learning workflow
Types of machine learning algorithms
Supervised ML algorithms
Unsupervised learning algorithms
Reinforced learning algorithms
Machine learning platforms
Amazon machine learning
Azure Machine Learning Studio
Google Cloud Machine Learning
IBM Watson Machine Learning
Open source tools
Rain prediction
Setting up Azure Machine Learning Studio
Importing experiment
Weather dataset
Selecting columns in the dataset
Editing the metadata
Cleaning the missing data
Executing the R script
Splitting data
Train model
Algorithm selection
Score model
Deploying web service
Testing web the service
Summary
Platform Comparisons
What is an IoT platform?
Features of an IoT platform
Essential features
Security
Secure device communication
Device management
Device and cloud integration
Communication protocols
Storage
Beneficial features
Visualization
Third-party integration
Analytics and intelligence
Comparison between platforms
Summary
Other Books You May Enjoy
Leave a review - let other readers know what you think
The Internet of Things is one of today's hottest topics. There is a lot of work that is being done in this space, and, according to Forbes, the global IoT market will grow from $157 in 2016 to $457 billion by 2020. It is an amazing market both in terms of technology advancement and money.
This handbook covers almost all of the essential knowledge that is needed for an architect or a developer to build an IoT solution. Right from understanding what IoT is and exploring various off-the-shelf IoT platforms, this book has it all. This book also covers machine learning IoT at a basic level, using Azure Machine Learning Studio.
This book is targeted toward IoT architects and engineers and any stakeholders working with enterprise IoT solutions. This book also caters for decision makers and professionals from small- and medium-sized enterprises looking to build an IoT strategy for their venture.
Chapter 1, Introduction to IoT, introduces you to the concept of the Internet of Things or IoT and talks about how it all started. This chapter also elaborates on the IoT market and what it would be for an enterprise. Once we understand the market, we will be looking at various building blocks of IoT.
Chapter 2, Applications of IoT, covers various applications that are possible in the IoT space. This chapter showcases two major domains, healthcare and industrial IoT, and how enterprises can easily expand their horizons and penetrate the IoT market.
Chapter 3, Getting Started with IoT Platforms, talks about what off-the-shelf IoT platforms are and how they reduce the time and effort needed for anyone to quickly build enterprise-grade IoT solutions. This chapter introduces you to the five platforms that we are going to work with in this book. We will also be setting up Raspberry Pi 3, along with ThingSpeak platform to build an end-to-end solution that showcases the platform idea in its simplest form.
Chapter 4, AWS IoT, explains how to use the AWS IoT service to build an end-to-end solution with Raspberry Pi 3 as our main hardware. We will explore concepts such as Things, shadows, and rules services. To create a real-time dashboard, we will be working with Elasticsearch and Kibana.
Chapter 5, Azure IoT, explains how to use the Azure IoT service to build an end-to-end solution with Raspberry Pi 3 as our main hardware. We will explore concepts such as the IoT Hub and device twins. In order to create a real-time dashboard, we will be working with Power BI and stream analytics job.
Chapter 6, Google Cloud IoT, explains how to use Google Cloud IoT Core service to build an end-to-end solution with Raspberry Pi 3 as our hardware. We will explore concepts such as device registry, topics, and Pub/Sub subscriptions. To create a real-time dashboard, we will be working with BigQuery and Google Data Studio.
Chapter 7, IBM Watson IoT, explains how to use Watson IoT platform to build an end-to-end solution with Raspberry Pi 3 as our main hardware. We will explore concepts such as device registry, topics, and Pub/Sub subscriptions. In order to create a real-time dashboard we will be working with Watson IoT platform boards by creating schemas.
Chapter 8, Kaa IoT, explains how to use the most popular open source Kaa IoT middleware to build an end-to-end solution with Raspberry Pi 3 as our hardware. We will explore concepts such as applications, appenders, and Kaa schemas. In order to create a real-time dashboard, we will be working with REST appenders and the ThingsBoard platform.
Chapter 9, IoT and Machine Learning, demonstrates the true capability of IoT through the power of machine learning. In this chapter, we will understand machine learning at a high level and, using Azure Machine Learning Studio, we will build a simple web service that will predict the chance of rain based on the temperature, and humidity.
Chapter 10, Platform Comparisons, concludes this book by comparing the five IoT platforms we have worked on, based on various parameters. This chapter also talks about various IoT architectural solutions that can be built using these platforms.
To work with the content of this book, you will need the following hardware:
Raspberry Pi 3
DHT11 temperature and humidity sensor
Three jumper cables
One breadboard
For the software, we need a Raspberry Pi 3 with Raspbian OS installed and Wi-Fi or Ethernet configured. We will be installing Node.js as we work through the book.
You will also need another machine that supports the installation of Node.js. We will be installing Node.js as we work through the book.
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/Enterprise-Internet-of-Things-Handbook.In case there's an update to the code, it will be updated on the existing GitHub repository.
We also have other code bundles from our rich catalog of books and videos available athttps://github.com/PacktPublishing/. Check them out!
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.
When was the last time you felt that someone or something was watching you? Maybe after watching a horror movie or when you were home alone? Worry not! This is going to happen to you every day and every moment in the near future. Welcome to the world of Internet of Things (IoT), where everything around you is always watching and understanding you to make your life better.
In this book, Enterprise Internet of Things Handbook, we are going to look at these Things and understand what they are and how they contribute to making the next biggest revelation in technology.
In this chapter, we are going to get started with our journey by defining what IoT is then go through the history of IoT and understand how and why it is going to be a game changer for humans.
After this, we are going to get into the basics of the IoT technology stack. We are going to look at the end-to-end architecture of a typical IoT solution and deep dive into every section of it.
In this chapter, we will cover:
Introduction to Internet of Things
History of IoT
IoT enterprise market
IoT technology stack
Understand the building blocks of the IoT Stack
Understand cloud computing
Understand fog computing
IoT and security
The Internet of Things is a state where the things on the face of the earth connect to the internet and start talking to each other. Things here can be electronic, electrical, mechanical, or electro-mechanical objects.
Imagine waking up in the morning to your favorite music playing in the background; once you walk into the bathroom, the lights come on automatically and the mirror greets you with the latest Instagram or Twitter feed while it analyzes your sleep pattern to see how well you have slept to show you a feed based on your mood.
You wash and move to the kitchen to find the coffee machine has already turned on a few minutes ago to serve you a cup of hot coffee. Your toaster has auto-inserted the last couple of slices of bread from its tray and checked with the refrigerator to see there is any more bread. The refrigerator checks its inventory and discovers that it is out of bread and adds the bread to your shopping cart and places an order with an online grocery store.
Meanwhile, your self-driven car is reading your calendar for meetings that you need to attend across town and plans the routes for an optimal and smooth journey. The moment you walk out of your home, the environment sensors detect the lack of humans, shut down everything that is consuming power, and move into a hibernate mode.
Now, this is Internet of Things, where all the things talk to each other and make your life an absolute pleasure.
What I have described is no longer a vision or a dream. It is how we may live one day in the very near future. There are already things such as smart fridges, smart washing machines, and smart water purifiers on the market today and people are buying them one at a time to get acquainted with the technology. Soon, we will have a system in place that will interface with all these devices; that is when we will realize the true power of IoT.
The example I have given centers around a smart home. It is very important to understand that IoT is not limited to smart homes. The same technology that we used to make our refrigerator order groceries online can be used to tell us when our car needs to be serviced next, the duration of traffic light signals at a particular hour of the day, or when a conveyer belt in a factory floor needs to be changed.
With IoT, you no longer need to worry about a diet plan; you can tell your refrigerator, your stove, and your weighing scales that you are on a diet and they will take care of that for you.
There are two sides to any coin. IoT can be very helpful and at the same time can be very annoying.
Imagine every move of yours is monitored and relayed to other services so everything is connected and in sync; this may be a bit of a challenge at times. Imagine your doctor calling you when you are going to eat a second serving of a cake... pretty annoying, right?
We rely heavily on connectivity and synchronization between devices and if things don't sync well, then the chaos will be in the order of n, where n is number of devices that this device needs to sync with.
On the lighter side of things, imagine a world where all your smart devices have an active online presence posting information about themselves and all you need to do is follow them on social media and you will know everything about them.
And if any two devices do not want to talk to each other, because they have an ego issue, we are doomed for sure.
The next key thing in the world of IoT is data privacy and security. Since all the devices talk to each other and share this information over the internet there is always an onlooker who is interested in that data. They may be monitoring your door sensor data that is being transmitted and then may act in your absence. Or they can tamper with the data by intercepting the packet and sending a spoofed packet on behalf of the door sensor itself.
Imagine a time and age where you need to buy a firewall for your toaster, because someone is tampering with the crispness of your toast.
We will talk more about security and data privacy in the coming chapters.
All this loosely summarizes the major part of what IoT is. We will deep dive into various areas as we go along.
In the next section, we are going to look at the history of IoT.
In the last section, we have seen what IoT is and we have looked at a few examples as well. In this section, we are going to take a look at the history of IoT.
Even before Kevin Ashton coined the term Internet of Things in 1999, this technology existed in other forms and shapes, pretty much doing the same thing.
To put things into perspective, the first TCP/IP communication was made in 1974 (https://en.wikipedia.org/wiki/Internet_protocol_suite), which stemmed from the success of ARPANET (https://en.wikipedia.org/wiki/ARPANET) in 1969.
Automated Teller Machines (ATMs) one of the first connected devices, were launched in 1969. It was a very exciting time in the banking domain, where people could get instant cash.
Take a look at this demo of an ATM from 1969 named 'Instant money': ATM comes to Australia (1969): https://www.youtube.com/watch?v=yuClDSofyJs.
Then there came the famous Internet Coke Machine, built by four students of Carnegie Mellon University in 1982. This machine used ARPANET to communicate and could be queried in real-time remotely using a finger interface. This machine lets you know about the stock of Coke in the machine along with the information about the Coke's coldness.
The next notable and documented incident that happened in the connected devices space was The Internet Toaster in 1989. John Romkey connected a toaster to the internet using a TCP/IP protocol and controlled it using a Simple Networking Management Protocol Management Information Base (SNMP MIB). This internet toaster could be turned on remotely and the darkness of the toast was controlled by the duration of the toaster being powered on.
In 1991, Sir Timothy Berners Lee and CERN announced the World Wide Web (WWW) outside the CERN. Do note that until this time no one had seen a web page or HTML document in the outside world; it was all packets of data transmitted over wire.
With the invention of the WWW, people started working with the world of connected things with more ease.
The next event in history that brought in a new dimension to the connected things world was the Trojan Room coffee pot