Foundational Elements of An IoT Solution
Foundational Elements of An IoT Solution
m
pl
im
Foundational
en
ts
of
Elements of
an IoT Solution
The Edge, The Cloud, and
Application Development
With the ThingWorx IoT Platform, you have access to a powerful development engine and
a broad set of innovative technologies that extend the power of the IoT:
Learn more about how the ThingWorx IoT Platform is the right choice
to power your organization’s digital transformation.
http://www.thingworx.com/go/IoTFoundations
Foundational Elements of
an IoT Solution
The Edge, The Cloud, and
Application Development
Editors: Susan Conant and Jeff Bleiel Interior Designer: David Futato
Production Editor: Kristen Brown Cover Designer: Karen Montgomery
Copyeditor: Colleen Toporek Illustrator: Rebecca Demarest
The O’Reilly logo is a registered trademark of O’Reilly Media, Inc. Foundational Ele‐
ments of an IoT Solution, the cover image, and related trade dress are trademarks of
O’Reilly Media, Inc.
While the publisher and the authors have used good faith efforts to ensure that the
information and instructions contained in this work are accurate, the publisher and
the authors disclaim all responsibility for errors or omissions, including without
limitation responsibility for damages resulting from the use of or reliance on this
work. Use of the information and instructions contained in this work is at your own
risk. If any code samples or other technology this work contains or describes is sub‐
ject to open source licenses or the intellectual property rights of others, it is your
responsibility to ensure that your use thereof complies with such licenses and/or
rights.
978-1-491-95097-5
[LSI]
Table of Contents
1. Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Building the Internet of Things 1
4. The Cloud. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Cloud-to-Device Connectivity 40
Device Ingress/Egress 44
Data Normalization and Protocol Translation 45
Infrastructure 46
APIs 47
The Topology of the Cloud 47
5. IoT Applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
The Semantic Model 52
Software UX Design Considerations 54
Machine Learning and Predictive Analytics 55
Rapid Application Development 59
v
A. Companies, Products, and Links. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
vi | Table of Contents
CHAPTER 1
Introduction
1
and business people need to fundamentally shift their thinking. IoT
design will be quite different from design for other complex systems;
data will be the critical material, shared across open and flexible net‐
works. Making the most of IoT for your business requires strategic
thinking and careful planning.
If you don’t quite know where to start with the IoT, you’ve come to
the right place. This guide is for those who have heard both the
grand promise and the skeptical inquiries and nevertheless want to
get their boots on the ground. The guide introduces you to the high-
level concepts, components, and patterns for any type of IoT solu‐
tion. It will help you to understand the technology and architecture,
so that you, the technologist, can dispel misconceptions within your
organization and assess the opportunities for the IoT to advance
your business. The potential of the IoT may well be limitless—but in
order to get to that promise, we need to get started.
2 | Chapter 1: Introduction
Those servers ultimately moved from on-premise locations into data
centers and eventually “the cloud.”
We can appreciate the prescience of Kevin Ashton’s term. Yet while
the “IoT” is a catchy phrase, it doesn’t help us understand the full
implications of this new paradigm. While the Internet is, of course a
critical, enabling element, it is only a part of the essential concept—
the idea that we can connect our reality, part and parcel, to the vir‐
tual world of information systems—that is so truly transformational
for smart connected products and operations alike.
Today, the Internet of Things can include industrial and commercial
products, everyday products like dishwashers and thermostats, and
local networks of sensors to monitor farms and cities. In an IoT sol‐
ution, objects can be sensed and controlled through the Internet,
whether these objects are remote devices, smart products, or sensors
that represent the status of a physical location. And information can
be made available to applications, data warehouses, and business
systems.
Guide Outline
For some developers, the IoT may seem like a mishmash of technol‐
ogies arranged in a bewildering set of combinations. It’s true that
this is an area where embedded computing, MEMs, broadband and
mobile networking, distributed cloud computing, advanced dis‐
tributed database architectures, cutting-edge web and mobile user
interfaces, and deep enterprise integrations all converge. But thank‐
fully there are some clean layers that we can use to inform our men‐
tal model of IoT solutions.
Our guide is divided into four chapters:
Chapter 2, Solution Patterns for the Internet of Things
As we tackle other topics in the Internet of Things, it is helpful
to think about recurring architectural patterns—in smart, con‐
nected products versus smart, connected operations, new and
innovative experiences, and so on. The first section of the guide
gives you a mental framework to think about your solution.
Chapter 3, The Edge of the IoT
The edge of the IoT is where all the “Things” reside: from sen‐
sors to vehicles, everyday products to entirely new kinds of
Acknowledgments
This book would not have been possible without the contributions of
Linda Frembes, and the O’Reilly editorial team, especially Susan Conant
and Jeff Bleiel. Thank you for all your work.
4 | Chapter 1: Introduction
CHAPTER 2
Solution Patterns for the
Internet of Things
5
of-Four1 and Christopher Alexander’s Design Patterns2—and use
that understanding to help us place technical capabilities in the
proper solution context. Throughout this book, as we tackle other
topics related to the Internet of Things, we can use this initial solu‐
tion pattern language to build a mental framework that supports
other important details.
Pattern Elements
For our general IoT solution patterns, we’ll want some consistent
characteristics with which to evaluate advantages and disadvantages,
and compare and contrast between them. The five elements listed
below help us, as technologists, extract the initial patterns and then
analyze real scenarios:
Solution creator
Who designs, engineers, and builds this IoT solution?
Audience
Who buys the solution, and who will use it?
Position in the product/service lifecycle
Is the solution positioned as a product or service that is an end-
to-itself or does it enhance or augment an existing, mature
product or service?
Connection
How does the solution connect to the Internet?
Integration
Does the solution require integration with other business or
enterprise systems?
Armed with these characteristics for evaluation, let’s examine three
common, high-level recurring patterns that we see in the real world.
Solution creator
Product creators of every stripe—from big consumer electronics
firms like Samsung to manufacturers like Deere & Co. to startups
like Rest Devices, who produce the connected Mimo baby monitor
—are looking to differentiate their offerings by giving users more
compelling experiences. Often, this takes the form of features that
are only possible by integrating the product functions with an Inter‐
net connection. Samsung’s connected televisions, for instance, offer
applications and programming that are Internet-based, as well as
software updates to improve performance. Deere & Co., a leader in
agricultural machinery, provides farmers with connected tractors
that can be monitored in the field via their JDLink telematics system
(as in Figure 2-1), and the Mimo baby monitor delivers video, audio,
waking/sleep state, and even respiration information to the parent’s
smartphone anywhere in the world.
Figure 2-2 shows the Mimo IoT ecosystem: the “turtle” sensor talks
to the “lilypad” gateway, which in turn transmits data about the
infant to the cloud and eventually, the iOS or Android application.
In Figure 2-3, you can see the Mimo mobile monitoring application,
which displays infant position and respiration data, among other
factors that parents can access anywhere on their smartphones.
Audience
It’s important to understand who buys and uses the smart, connec‐
ted product. In the long run, the audience will likely adhere to the
same demographics as those who were buying the previous static,
disconnected version. From the manufacturer’s perspective, how‐
ever, it’s critical that the effort expended to design and build that
smart, connected product result in meaningful differentiation and
economic rent in the competitive marketplace.
Connection
Since 2012, the trend has been toward manufacturers designing con‐
nectivity directly into their products. Previously, when manufactur‐
ers were interested in connecting their high-value products—so
that, for instance, services teams could remotely troubleshoot and
react to product issues without the need for an engineer on site—
they were forced to retrofit them for the IoT.
Integration
Service monitoring aside, in most instances enterprise and business
system integration for smart connected products is likely to be light‐
weight, if it exists at all. However, from the consumer software side,
mobile applications, web portals, and analytics will be high value
drivers, along with the function of the connected product itself.
Business system integration, however, could become a common
addition to such products, particularly if initial product pilots prove
solution efficacy.
Agriculture
It should come as no surprise that agricultural operations face envi‐
ronmental conditions that can be highly unpredictable, requiring
ongoing management of potential outcomes. Smart agriculture solu‐
tions track and react to these conditions by monitoring sensors in
the field, managing information from weather and mapping serv‐
ices, and capturing actionable data, helping to spot potential issues
with crops before they happen.
Smart agriculture solutions can also leverage AI technology that
automatically learns from data, discovers patterns, and builds vali‐
dated predictive models. Such predictive analytics can, for example,
solve irrigation strategy challenges by maintaining crops within
ideal soil moisture range, reducing water costs, and even predicting
when water will be needed for irrigation. In this way, smart agricul‐
ture solutions cuts operating costs and increases a farm’s production
yield.
Cities
Across the United States, from New York to Los Angeles to Boston,
there are a variety of new initiatives to develop smart city services,
using sensor technology and connected public resources—from
street lights to trash bins to roads—to improve the quality of urban
living. Examples of these initiatives range from well-coordinated
transportation services using big data to reduce traffic congestion
and save commuters time and fuel, to public safety and security
services controlling police dispatch, municipal repairs, and even
snow removal.
Energy
Energy companies today face a whole raft of challenges: aging,
patchwork infrastructure, increased regulatory controls, complex
interconnected, interdependent systems—that make efficient, relia‐
ble delivery of energy increasingly difficult. IoT solutions help
enable a smart grid to manage and automate the flow of both energy
and information between utilities and consumers, leveraging a com‐
bination of sensors, smart meters and software controls, and
analytics.
Buildings
Commercial office buildings are increasingly becoming connected
environments that connect HVAC, lighting, security, and safety sys‐
tems with an array of embedded sensors that enable them to
respond to real-time building occupancy and usage scenarios. These
IoT solutions provide connected intelligence and automation to
Solution creator
Who is building the smart, connected operation? The answer varies
widely based on the operation in question. A manufacturer may
build a smart factory operation to streamline the production of the
product; a systems integrator may instrument a building or a plant
with sensors; or a city council may contract with multiple parties to
transform their city.
Audience
Typically an enterprise organization—whether it’s a corporation or
public sector agency—will contract with vendors or a systems inte‐
gration firm to build out a smart, connected operation. And while
smart, connected products may be designed and built prospectively,
hoping that the market reacts favorably, smart, connected opera‐
tions typically begin with a specific ROI target and objective in
mind.
Connection
To be sure, there are a wide variety of disconnected machines
involved in most operations: factories, for instance, are filled with
presses, riveters, and industrial robots. And while it’s possible that
the manufacturer of this equipment has already made them smart
connected products, it is, more often than not, a required exercise to
retrofit sensors to existing machines or to the environment itself. As
such, it will be typical to find a gateway device communicating with
sensors and/or existing data bus technologies that were already part
of the operation.
Wearables
Wearables, such as smart watches and fitness bands, are excellent
examples of products that typify this kind of innovation. The tradi‐
tional experience of wearing a watch is being transformed entirely
by a combination of sensors, connectivity, data aggregation, and
analysis. The wearable wrapped around your wrist can track your
steps, monitor your stress level, and even let your husband, wife, or
significant other know if you’ve gotten lost in the wilderness during
a long trail run.
In the near future, it’s conceivable that data obtained from a weara‐
ble could be streamed to your health care provider, your personal
trainer, and maybe even your boss, operating without any interven‐
tion from you, the user. And, as wearables further shrink in size and
increase in availability, they’ll be used to track employees at work,
children at play, and even the elderly in assisted living.
For instance, the FitBit Surge (Figure 2-4) provides distance, time,
and heart rate data to the user in addition to a host of other factors.
This is where machine learning, big data, and design merge with the
IoT. And your bathroom will be transformed into a healthroom,4 as
pictured in Figure 2-6, outfitted with a panoply of noninvasive diag‐
nostics for the early detection of chronic diseases. Talk about disrup‐
tion!
Solution creator
The innovators creating these experiences will run the gamut from
big technology players such as Apple with the Apple Watch, to start-
ups such as AdhereTech (the creator of the smart pill bottle for med‐
ication adherence, shown in Figure 2-7), who have the potential to
become market leaders of the future. Large companies, however,
with their set infrastructure and focus on existing products, may
find it more difficult to innovate than smaller, more nimble compet‐
itors who are not beholden to the past.
Audience
While innovative experiences can often be the result of unexpected
opportunities that are difficult to predict, inefficient, capital-
intensive markets and industries are prime targets. The health care
industry, for example is primed for disruption, and the retiring
Boomer generation is a major audience with increasing health needs
—a huge opportunity for the AdhereTech smart pill bottle or con‐
nected healthroom.
Integration
Are there many other business or enterprise systems to integrate
with? Perhaps, but an innovative experience could also be some‐
thing so paradigm-shifting that it stands on its own.
The edge of the IoT is where the action is. It includes a wide array of
sensors, actuators, and devices—those system end-points that inter‐
act with and communicate real-time data from smart products and
services.
By 2020, it’s projected there will be anywhere from 25 to 50 billion1
Things2 connected to the IoT—that’s up to seven connected Things
for every person on planet Earth. On our way to this milestone, we
can anticipate that these billions of connected objects will generate
data volume far in excess of what can easily be processed and ana‐
lyzed in the cloud, due to issues like limited bandwidth and network
latency (among others).
1 “Gartner Says 4.9 Billion Connected ‘Things’ Will Be in Use in 2015; In 2020, 25 Billion
Connected ‘Things’ Will Be in Use.” http://www.gartner.com/newsroom/id/2905717,
accessed Mar. 24, 2016.
2 “Cisco Global Cloud Index: Forecast and Methodology, 2014–2019.” http://bit.ly/
25wqkDN, accessed Mar. 24, 2016.
21
times, unencumbered by network latency, as well as reduced traffic,
selectively relaying the appropriate data to the cloud.
Regardless of whether system intelligence is ultimately located in the
cloud or the fog or some hybrid of the two, development for the
Internet of Things requires technologists to have a clear understand‐
ing of edge architecture and how information is both gathered from
devices and communicated.
Sensors
Sensors read and report on the real-world status of connected prod‐
ucts, machines, and local environments. They are the eyes and ears
of the system, monitoring environmental elements like temperature,
light, and moisture. Ongoing sensor innovation, an often-
overlooked area of IoT technology, will be critical for evolving and
improving solutions.
While we might think of sensors only as physical objects, anything
that can be read—from files to product-specific data—can and
should be considered sensor input. For example, a piece of indus‐
trial equipment may have hundreds of data points unique to that
product, and every one of them could be considered a sensor.
• Temperature sensors
• Light sensors
• Moisture sensors
• GPS receivers
• Vehicle on-board diagnostics
• Files
• Product-specific data
For instance, the Grove water flow sensor, shown in Figure 3-2, is
part of Seeed Studio’s hardware innovation platform for technolo‐
gists to take new ideas from prototype to production. It reads liquid
flow rate using a water rotor, whose speed changes depending on
how fast the water is moving. The signal output comes from a Hall
effect sensor, which pulses as the rotor turns.
Figure 3-2. The Grove water flow sensor (Photo courtesy Seeed Devel‐
opment Limited)
• Lights
• Valves
• Motors
• Commands (“soft” actions, file distribution, firmware updates)
For instance, the 6000 series indexing valve from K-Rain, pictured
in Figure 3-3, is a robust distribution valve that can be used for
high-flow city water, irrigation, and even wastewater applications.
The valve acts as a manifold, directing the flow of water from zone
to zone, and can be coupled in an IoT solution with an intelligent
valve monitor to ensure even water distribution and alert operators
to potential malfunctions.
Controller
The next layer in our stack is the controller, a hardware or software
component that interacts electrically or logically with sensors and
actuators. It is in the controller that we’ll find our low-level, short-
haul communication.
While in many instances the controller may be fused within other
elements of the stack, it is always present logically. For example, a
controller may be a simple circuit that reads an analog signal from a
temperature sensor and digitizes the signal into discrete transmis‐
sions that the upper layers of the stack can understand.
Over short distances, local communication from sensors can come
via a simple serial connection between devices, or short-haul wire‐
less technologies like ZigBee. Industries may define standard proto‐
cols for interfacing with equipment—for example, OBD-II for
automobiles, or DEX and MDB for vending machines. All of these
represent short-haul protocols, because they are meant for local
communication between sensors, control systems, and an agent.
Long-haul communication
On the top layer of our architecture, we find our long-haul commu‐
nication to the Internet. IoT solutions invariably require that envi‐
ronment or device status be made available to a cloud-based
application for consumption by a variety of stakeholders. Once an
agent has received information via short-haul, it must retransmit
that information to the cloud. The desired characteristics of these
long-haul protocols are much different than short-haul, particularly
in the categories of security, footprint, and reliability. There are a
wide variety of long-haul options for IoT solutions, dependent on
the use case; they include cellular and satellite, WiFi and wired
Ethernet, as well as subgigahertz options like LoRa and SigFox.
Networking protocols for long-haul communication are similarly
diverse; they include TCP (Transmission Control Protocol) and
UDP (User Datagram Protocol) for the transport layer, and HTTP
(Hypertext Transfer Protocol) and CoAP (Constrained Application
Protocol) for the application layer, among many others.
Modules
Communication modules are components for connecting to WiFi,
cellular, or long-range wireless networks. While modules typically
have little to no programmability, vendors do provide a variety of
configurable options and even lightweight scripting.
Original equipment manufacturers (OEMs) and custom solution
providers building IoT capabilities directly into their products often
incorporate communication modules into a custom board design.
For instance, the AirPrime MC Series communication module from
Sirerra Wireless, pictured in Figure 3-4, is incorporated into both
connected consumer electronics, as well as industrial grade solu‐
tions like Itron’s OpenWay Smart Grid.
Figure 3-6. The Cisco Connected Grid Router (Photo courtesy Cisco)
Figure 3-7. Dell Edge Gateway 5000 Series (Photo courtesy Dell)
Prototyping boards
This list of edge components would not be complete without a dis‐
cussion of prototyping boards and their impact on ideation and
design for the IoT.
Prototyping boards such as the Arduino Uno (shown in Figure 3-9),
Intel Galileo (shown in Figure 3-10), and Raspberry Pi are ideal for
proof-of-concept work. They have just about everything a designer
or engineer needs to start creating for the Internet of Things:
Connectivity
A prototyping board comes equipped with a wireless module or
an Ethernet chip and RJ-45 port to connect to the wired
Internet.
Figure 3-9. The Arduino Uno is used to quickly prototype IoT solutions
(Photo courtesy Arduino)
The sensors and actuators for the vending machine include the inter‐
nal electromechanical units, such as a bill validator for receiving
payment, and motors for manipulating and moving product inven‐
tory.
The controller layer uses the vending industry standard control
busses:
MDB (multi-drop bus)
Allows transactional devices like the aforementioned bill valida‐
tor to communicate with the vending machine’s brain.
DEX (digital exchange)
The means by which the product inventory is tracked.
The agent interfaces with the DEX and MDB control layer to deter‐
mine the amount of products the vending machine has in inventory,
as well as how much money it has collected over the course of the
day. It then relays that data to the cloud.
Real-World Deployment
From this point on, our two example architectures differ. Where the
agent resides and how it connects to the cloud is determined in part
by the topography and nature of the machines’ real-world deploy‐
ment.
The cloud is the central station of any IoT solution, and a critical
component. While it may be tempting to think about the IoT device
cloud as the equivalent of a web or mobile application, the Internet
of Things introduces its own unique characteristics and subsystems.
In this chapter, we’ll examine some of those characteristics, includ‐
ing cloud-device connectivity and security, device ingress and
egress, and data normalization and protocol translation.
In IoT technical diagrams such as Figure 4-1, it’s common to struc‐
ture visualizations of the architecture from the bottom up, reflecting
the mental model of edge devices being “on the ground” relative to
the cloud. Using this diagram, let’s follow the journey of a message
as it flows from the edge to the cloud.
39
Figure 4-1. The device cloud is the central station of an IoT solution,
processing and analyzing data received from the edge
Cloud-to-Device Connectivity
Making sure we get the right message from the edge device to the
cloud is paramount. When it comes to cloud-to-device connectivity,
security is increasingly a major area of concern, and rightly so. Even
a modest-sized IoT installation can provide numerous potential
intrusion points via edge devices that, unlike modern PCs or smart‐
phones, have limited computing resources. This combination of
traffic quantity, device constraints, and the wide variety of IoT solu‐
tion configurations makes for a bevy of challenges.
Device authentication prior to any data transmission is a critical
security measure (Figure 4-2). In a web or enterprise application
there are authenticated users, systems the users are authorized to
access, and roles that designate the users’ privileges. In the IoT, how‐
ever, we see a new kind of actor in the system: the device itself,
Cloud-to-Device Connectivity | 41
Once you’ve chosen an identifier, you’ll need to authenticate to the
cloud. But common techniques in consumer and enterprise systems
to solve this problem fall short when it comes to the IoT. For
instance, in the case of username/password combinations, how do
you update the password of an IoT device at the edge? And what if
there are millions of them? X.509 certificates that identify a client
securely to a communicating server are the best approach. However,
a public key infrastructure (PKI) is needed to produce these certifi‐
cates and sign, distribute, and revoke them when they’ve been chal‐
lenged.
Cloud-to-Device Connectivity | 43
tunnel. Suddenly, the truck disappears from the network and the
system receives a fragment of a message. The software waits on
those bytes, eating up resources in our cloud networking layer. The
truck may be gone for minutes, hours, or days. We have no way of
knowing. And then, as suddenly as it left, it returns, and the system
receives the rest of the message. This all-too-common scenario
needs to inform the design of IoT systems. Importantly, our soft‐
ware layer needs to understand and compensate for network unreli‐
ability, and not assume that we’ll receive complete messages or have
a well-behaved network client from connected devices.
Device Ingress/Egress
Next, as we move up our IoT cloud stack, is the device ingress and
egress layer. IoT solutions, the majority of the time, are concerned
with device ingress—receiving incoming messages from the edge to
the cloud. The sheer volume of data can challenge the scale of cloud
systems. A system might have hundreds of thousands of connected
devices, each sending multiple messages every minute. For example,
if every device in a 250,000-device system sent just 3 messages per
minute, it would result in over a billion messages per day. By way of
comparison, Twitter, as of this writing, has about 320 million
monthly active users who send about 900 million messages per day.
It’s feasible that the data ingress of just one IoT installation can easily
match or even surpass the total traffic of Twitter on a daily basis.
In contrast, once in a while, an IoT system needs to communicate
with one of the many connected devices. Cloud-to-edge messaging
may include sending notifications about new configurations, firm‐
ware, or commands to trigger actuation. While it’s far more infre‐
quent than device ingress, when you need device egress, it’s
important to have the right communication protocol and communi‐
cation infrastructure in place. Particularly when triggering actua‐
tion, it’s important that users see timely responses to their cloud-
based commands. Perhaps a smartphone user is asking their garage
door to close because they realize they left it open when they exited
the house. From a user experience perspective, if the command is
successful, the end result can seem almost magical—the ability to
instantly and remotely command one of many connected devices.
Of course, some classes of edge devices are not always powered on
or do not maintain a persistent network connection. Duty-cycled
Data Consistency
Message delivery consistency has a significant impact on your IoT
applications. The order in which messages are received and pro‐
cessed makes all the difference.
When scaling the messaging infrastructure for an IoT application,
be wary of dumping messages into a queue and processing them
later. When you start to distribute those queues and distribute your
architecture, it’s very easy to forget to connect the temporal locality
of a single device that sent us a series of messages being processed in
order. For instance, if a device has a status of “door open” and then a
Infrastructure
The next layer in our cloud stack is the Infrastructure layer. For
many IoT solution creators, the elastic compute resources of an
Infrastrucure-as-a-Service (IaaS) provider are a sensible alternative
to the substantial initial investment and ongoing maintenance cost
of constructing their own data centers. Infrastructure-as-a-Service,
whether public or a managed private cloud from an IaaS vendor, can
give solution creators the ability to automatically provision new
compute, storage, and network resources on demand. This is partic‐
ularly useful for IoT solutions that may have significantly large but
temporary workloads. For example, within the annual lifecycle of an
IoT system, there are certain events that demand more compute and
bandwidth resources than others—for instance, a firmware update
deployed to a million devices, or the seasonal launch of a new prod‐
uct. IaaS resources are convenient and scalable: the third-party ven‐
dor owns all compute resources, storage, and networking
capabilities, and handles all system maintenance.
APIs
The final layer in our IoT cloud device stack is the API, the lingua
franca of modern systems. The majority of API usage occurs at the
application layer, which is discussed in more detail in Chapter 5;
however, there are a few notable elements we should discuss here. In
particular, the device cloud stack should provide lower-level access
to insulate the application layer from the devices. Common API
functions may include:
APIs | 47
the physical nature of the Internet of Things and the resulting chal‐
lenges and limitations that brings.
For example, the physical location of cloud assets such as data cen‐
ters can be critical in an IoT system. It’s an all-too-common scenario
to have data generated by devices in one region that cannot leave a
certain geographic area for reasons of network latency, governmen‐
tal controls, or even industry regulations. As a case in point, it’s not
acceptable for medical device data generated in Central Europe to be
transmitted just anywhere in the cloud. The European authorities
will tell you the data cannot transgress European boundaries. In sit‐
uations like these, your abstraction of the cloud needs to be both
regionally and locally aware.
Importantly, as we’ve discussed in previous chapters, digital mes‐
sages are not immune from the inconvenient realities of the physical
world. Cloud processing is far from instantaneous, subject to
unforeseen delays and network unreliability.
The concept of fog or edge computing attempts to transcend some
of these physical limitations. According to Cisco’s “Fog Computing
and the Internet of Things: Extend the Cloud to Where the Things
Are”:
The Internet of Things (IoT) is generating an unprecedented vol‐
ume and variety of data. But by the time the data makes its way to
the cloud for analysis, the opportunity to act on it might be gone.
For example, when you have an edge device that needs to communi‐
cate with another entity—an application, business process, or even
the device right next to it—it must first send that message to the
cloud, which processes the information and transmits a response
back down to the edge. Communication with the cloud could very
well mean sending a data transmission thousands of miles away over
a network with questionable reliability. In contrast, with fog com‐
puting, that processing happens on nodes physically closer to where
the data is originally collected.
According to Cisco, fog computing provides intelligent infrastruc‐
ture at or closer to the edge that:
Over the next few years, as the Internet of Things brings billions of
new connected devices into the world, there is tremendous potential
to unlock previously hidden insight into physical processes for both
businesses and consumers. However, to access the value of all these
new connected things, we require a host of new software applica‐
tions that can make sense of the constant data flow.
Through embedded sensors and intelligence, we can give nerves to
products, services, and operations. Now we need to think about how
we’re going to process the signals from our newfound senses. We
certainly can’t look at every bit of data these systems generate: infor‐
mation overload is already a substantial problem. Well-designed
software and predictive analytics help us make some of those deter‐
minations, but we still must decide what machine and digital ele‐
ments will make up the autonomic nervous system of our IoT
solutions, and conversely, what will make up the somatic nervous
system, requiring human intervention for critical decision-making.
Creating applications that derive value from the IoT involves much
more than generating a user interface on a web or mobile device.
While it’s true that some IoT software may take the form of an app
that gives a user a new experience on a smart, connected product, it
could also consist of a prediction from an analytics model derived
through machine learning and assimilated after an examination of
multitudes of data, or it could mean the integration of a data feed
from a connected operation into another business system.
51
IoT application design begins by establishing a model of the connec‐
ted device and the worlds—both physical and digital—into which
the device fits. This model enables the APIs, user interfaces, enter‐
prise integrations, and analytics to access a common solution frame‐
work, even in the face of changing underlying technology. To
effectively design and develop IoT applications, we need to model
the specific problem domain, apply business logic, and surface that
information to users.
In this chapter, we explore some of the considerations for IoT appli‐
cation architecture, as well as principles of good application design.
A Collaborative Process
IoT application design and development is a collaborative process
that could involve a wide variety of people—from domain experts
and technologists to system designers and developers—all of whom
have unique skills and responsibilities. For example, the domain
expert possesses a deep understanding of the application subject
matter, the system entities, and the relationships between them. She
is responsible for the language of the application domain. The tech‐
nologist/system designer is responsible for understanding and
defining the application structure, and the developer is responsible
for coding the application.
While each person has a specific assignment, it’s important for
everyone on the application team to collaborate across disciplines
and understand the fundamentals of how the total system works.
This knowledge is critical for identifying the constraints that govern
an IoT solution, and ultimately providing a better experience for
the user. For example, understanding the reasons why the network
is unreliable gives the proper context for potentially faulty informa‐
tion flow that can up-end a user experience.1
1 For a complete discussion of these considerations, it’s worth having a look at Designing
Connected Products: UX for the Consumer Internet of Things, by Claire Rowland, Eliza‐
beth Goodwin, Martin Charlier, Ann Light, and Alfred Lui. O’Reilly Media, 2015.
Learning
Machine learning is an important tool for data description and dis‐
covery, particularly if you have an incomplete understanding of the
classifications, ranges, or kinds of device data that make up a partic‐
ular domain. Deciding which data aggregations make sense can
often require a depth of understanding about a problem domain,
which may or may not be available to you.
It can be difficult to understand exactly what a user needs to know,
which is why automated discovery can be so important. For example,
users may only care about a metric, like temperature, as an average
over the course of a day. A machine-learning algorithm can help you
understand when you need to consistently monitor a particular sig‐
nal, or, in contrast, when you really should only care about discover‐
ing the outliers. Additionally, by integrating and analyzing
information from multiple data sets, including those from third par‐
ties like weather and geographic information, automated discovery
algorithms can help find valuable patterns that would otherwise
remain hidden.
Predicting
You may be familiar with the popular IFTTT (If This, Then That)
service. The IFTTT pattern expects that a human has a priori
knowledge of what to do. However, within any set of potential IoT
events, the subset that we know what to do about is vanishingly
small. Here in the data, then, are mysteries to uncover. Which are
signals, and which are noise? Of the petabytes of data generated by
When you leverage an analytics engine with your IoT solution, you
get not only a rearview-mirror, historical log of events that have
occurred, you also get a predictive view of the future, based on an
analytical model trained by that history.
Machine-learning algorithms can convert overwhelming amounts of
data, billions of points of information, into clear patterns. By exam‐
ining historical system data to understand what has happened in the
past, machine-learning algorithms can discover predictive models
that a human would likely never find.
These predictions help generate problem solving policies and meth‐
ods—heuristics derived from experience with similar issues or sce‐
narios—which can lead to important system adaptations. We can
use this intelligence to affect the business process if we know that a
problem or undesirable outcome is imminent.
As an example of this, let’s look at an IoT solution for automated
parking kiosks (Figure 5-2). Predictive modeling can help inform
the parking lot’s operations manager if a kiosk is at risk of failing,
and alert him to take preventative action. In this scenario, a
machine-learning algorithm examining historical data could detect,
for instance, that a high volume of kiosk transactions per day com‐
bined with significant precipitation and an average outdoor temper‐
ature below a certain threshold signals that the kiosk’s credit card
acceptor is likely to fail within a short timeframe. This heuristic,
derived from a group of unique situational factors and long-term
data, would have taken a field service technician a decade of experi‐
ence with the product to understand. That discovery, made by a
Adapting
Not long ago, systems were designed with the pattern that looked
like this:
61
Product Company Link
Mimo Baby Monitor Rest Devices, http://www.mimobaby.com
Inc.
Samsung Smart TV Samsung http://www.samsung.com/us/experience/smart-tv/
Grove water flow Seed http://www.seeedstudio.com/depot/G12-Water-Flow-Senso
sensor Development r-p-635.html
Limited
Smart Body Withings, Inc. http://www.withings.com/us/en/products/smart-body-anal
Analyzer yzer
Smart Pill Bottle AdhereTech http://adheretech.com/
Texas Instruments Texas http://www.ti.com/product/cc3200
CC3200 Instruments
Microcontroller
ThingWorx IoT PTC, Inc. http://www.thingworx.com/IoT-Platform
Platform
Xively IoT Platform LogMeIn, Inc. https://xively.com/whats_xively/