Hardware Foundational Elements of an IoT Solution The Edge, The Cloud, and Application Development Joe Biron and Jonathan Follett Foundational Elements of an IoT Solution by Joe Biron and Jonathan Follett Copyright © 2016 O’Reilly Media, Inc All rights reserved Printed in the United States of America Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472 O’Reilly books may be purchased for educational, business, or sales promotional use Online editions are also available for most titles (http://safaribooksonline.com) For more information, contact our corporate/institutional sales department: 800-998-9938 or corporate@oreilly.com Editors: Susan Conant and Jeff Bleiel Production Editor: Kristen Brown Copyeditor: Colleen Toporek Interior Designer: David Futato Cover Designer: Karen Montgomery Illustrator: Rebecca Demarest March 2016: First Edition Revision History for the First Edition 2016-03-30: First Release 2016-06-22: Second Release The O’Reilly logo is a registered trademark of O’Reilly Media, Inc Foundational Elements 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 subject 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-95101-9 [LSI] Chapter Introduction The Internet of Things (IoT) has a rich technological legacy and a bright future: ubiquitous connectivity has created a new paradigm, and the closed, static, and bounded systems of the past will soon be obsolete With the connection of low-cost sensors to cloud platforms, it’s now possible to track, analyze, and respond to operational data at scale The promise of the IoT is indeed wonderful: intelligent systems made up of smart machines that talk with each other and with people in real time, and data analytics driving optimization and transformation in industries as varied and far-reaching as aeronautics and agriculture, transportation and municipal services, manufacturing and healthcare, and even within our homes Building the Internet of Things The Internet of Things presents exciting opportunities to transform business, but the specific approaches and patterns remain somewhat ill-defined So, maybe it’s not entirely surprising that the recent tidal wave of marketing hype has engendered some well-deserved skepticism about the IoT’s true business and social value Questions about security and fears that such wide-ranging connectedness will make privacy all but extinct are commonplace These are legitimate issues that are being addressed, and will require continuing maturity of both the business and technology factors if the IoT is to achieve long-term, broad-based success Regardless, it’s clear that, in order to take on the challenges of design for this new connected world, engineers, designers, technologists, 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 networks 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 solution 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 What This Guide Is Not You’ll find a bevy of other IoT primers on the websites of technology vendors, standards groups, and industry consortiums, many of them extremely insightful, but all slightly biased towards either a technology or philosophical premise about how the IoT should work There isn’t anything wrong with these sources, and you are encouraged to check out what they have to say, but the goal of this guide is to provide you with the real-world tools and patterns that are in use, or on the near-term horizon, based on practical hands-on experience in hundreds of IoT solutions over the last decade This guide is about what works for the IoT today and what the considerations are for implementing something right now A Technologist’s Definition of the IoT In 1999, Kevin Ashton of the Massachusetts Institute of Technology (MIT) coined the term Internet of Things At the time, industrial automation technologies were starting to move from the factory into new environments like hospitals, banks, and offices This early form of intercommunication often involved machines of the same type — such as a one ATM machine talking to another in the same general location — hence the term, Machineto-Machine, or M2M As early M2M implementations grew increasingly more sophisticated, machines were connected to other kinds of devices like servers 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 virtual 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 solution, 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 Machine Learning and Predictive Analytics If we want the IoT data we collect and analyze to have real-world impact, machine learning, predictive modeling, and process adaptation are essential tools Through this learn-predict-adapt cycle, software for smart products and systems can turn intelligence into action, moving beyond simple monitoring to anticipate problems and take proactive steps to improve our systems (Figure 5-1) Figure 5-1 IoT data analysis requires machine learning, predictive modeling, and system adaptation Learning Machine learning is an important tool for data description and discovery, particularly if you have an incomplete understanding of the classifications, ranges, or kinds of device data that make up a particular 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 signal, or, in contrast, when you really should only care about discovering the outliers Additionally, by integrating and analyzing information from multiple data sets, including those from third parties 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 However, within any set of potential IoT events, the subset that we know what to 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 my devices, where’s the insight I’m looking for? Where we find it? In short, If This, Then What? IFTTW seeks answers to questions like: Is it time for preventative maintenance? Is it time to adjust a configuration? Is it time to order consumables? Is it time to procure a new part? Is it time to send a repair technician? Should we change the product? How? 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 examining 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 methods — heuristics derived from experience with similar issues or scenarios — 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 combined with significant precipitation and an average outdoor temperature 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 experience with the product to understand That discovery, made by a machine-learning algorithm, becomes a new input into the data model for the kiosk, a prediction that becomes part of its API Figure 5-2 A dashboard depicting data analysis for automated parking systems Adapting Not long ago, systems were designed with the pattern that looked like this: Dump data into a database Every night, run queries against the new data and apply some business logic Dump the output of the batch operation into a database Run a report explaining what happened Unfortunately, this pattern doesn’t get us very far in the fast-paced world of the IoT As we’ve seen, the store-then-query approach of the past is not tractable, and moreover, not timely We need to react to events in real time Predictive analytics can enable preventative action and facilitate real-time system adaptation, but only if the insights from machine learning are discoverable by users For this to happen, it’s important to create intelligent systems that are integrated tightly with the operational processes and technologies already in place In smart manufacturing, machine-learning algorithms automatically detect patterns and anomalies in complex production processes and flag machines for maintenance before downtime or manufacturing errors occur For instance, an algorithm might discover that when a facility experiences a drastic swing in humidity levels, machines operating above a certain temperature are most likely to fail It’s not enough for our IoT software to provide this heuristic in isolation; it must deliver the information at the right time to the right user This might be achieved by integrating predictive information as a continuous data feed in the factory’s existing production planning and supply chain management (SCM) systems On days when humidity becomes an issue, the software surfaces a series of alerts When the machines run at a higher temperature, workers can adapt operations accordingly by either increasing the dehumidifying processes or running the machines during cooler, evening temperatures In this way, manufacturers can adapt their processes to better manage potential inhibitors to successful production runs Rapid Application Development You may (or may not) remember the revolution in development that came about when Microsoft first launched Visual Basic in 1991 Prior to Visual Basic, if you wanted to develop a graphical user interface (GUI) for software, you submitted yourself to strange and arcane forms of coding, with complicated APIs to draw basic objects like lines and rectangles Visual Basic and other similar tools were responsible for the explosion of productive developers who were, for the first time, able to deliver consistent — if not particularly engaging — software interfaces In many ways, Visual Basic helped drive the desktop PC revolution So, aren’t software developers still using such tools today? Well, yes and no In many ways, we have taken a few steps back in productivity, not because we no longer value rapid application development (RAD) tools, but rather because the types of user experiences and accompanying rendering environments have increased dramatically: from desktop to tablet, mobile, devices, and everything in between Now engineers might require multiple sets of tools to create the same experience across platforms and devices With an application enablement platform (AEP), you can leverage the foundational elements of the edge, the cloud, and the model layers using a set of visual UI and functional design patterns designed specifically for the IoT, and pre-wired for connected devices produced by a wide range of manufacturers Leveraging an AEP shields designers and developers from a degree of complexity by providing abstractions that allow for rapid development A growing number of companies offer application enablement platforms, including ThingWorx (a PTC company) and Xively (from LogMeIn), among others, with Microsoft and SAP adding IoT capabilities to their product lines, as well To be business-agile and ready to respond to changes, it’s worth considering an AEP that’s tuned for the application-building requirements of the Internet of Things 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, Elizabeth Goodwin, Martin Charlier, Ann Light, and Alfred Lui O’Reilly Media, 2015 Appendix A Companies, Products, and Links Throughout this book, we’ve discussed a variety of companies and products to illustrate important concepts in and approaches to foundational solutions for the Internet of Things The following list of these companies and products, ordered alphabetically, contains relevant links to further information Product Company Link Arduino Uno Arduino https://www.arduino.cc/en/Main/ArduinoBoardUno AirPrime MC Series Communication Module Sierra Wireless http://www.sierrawireless.com/products-and-solutions/embedded-solutions/em-a Bathroom/healthroom Involution Studios http://www.goinvo.com CalAmp LMU 330 http://www.calamp.com/products/tracking-and-telemetry-devices/fleet-tracking-u CalAmp Corp Cisco Connected Grid Cisco http://www.cisco.com/c/en/us/products/routers/1000-series-connected-grid-route Router Systems, Inc Dell Edge Gateway 5000 Series Dell https://www.dell.com/learn/us/en/uscorp1/secure/2015-10-20-dell-edge-gateway FitBit Surge FitBit https://www.fitbit.com/surge Intel Galileo Intel http://www.intel.com/content/www/us/en/embedded/products/galileo/galileo-over JDLink Deere & Co https://www.deere.com/en_INT/products/equipment/agricultural_management_s K-Rain Indexing valve K-Rain Mimo Baby Monitor Rest http://www.mimobaby.com Devices, Inc Samsung Smart TV Samsung Grove water flow sensor Seed http://www.seeedstudio.com/depot/G12-Water-Flow-Sensor-p-635.html Development Limited Smart Body Analyzer Withings, http://www.krain.com/indexing-valves/6000-series-indexing-valves-6-outlet.html http://www.samsung.com/us/experience/smart-tv/ http://www.withings.com/us/en/products/smart-body-analyzer Inc Smart Pill Bottle AdhereTech http://adheretech.com/ Texas Instruments CC3200 Microcontroller Texas Instruments http://www.ti.com/product/cc3200 ThingWorx IoT Platform PTC, Inc http://www.thingworx.com/IoT-Platform Xively IoT Platform LogMeIn, Inc https://xively.com/whats_xively/ About the Authors As VP of IoT Technology at ThingWorx, a PTC business, Joe Biron leads a team that guides the technical architecture between the ThingWorx IoT platform and ThingWorx Ready partners Joe has broad knowledge of IoT solutions, has led engineering teams focused on edge technology as well as cloud services, and has been deeply involved in the solution architecture for many ThingWorx customers Jonathan Follett is a Principal at Involution Studios where he is a leader of the firm’s emerging technologies practice, working with clients like Partners HealthCare, the Personal Genome Project, and Walgreens His work has been featured in the Atlantic, Forbes, the Huffington Post, and WIRED Jon is an author of four books, including Designing for Emerging Technologies (O’Reilly Media, 2014), which offers a glimpse into what future interactions and user experiences may look like for rapidly developing technologies — from genomics and nano printers to workforce robotics and the IoT Introduction Building the Internet of Things What This Guide Is Not A Technologist’s Definition of the IoT Guide Outline Acknowledgments Solution Patterns for the Internet of Things Design Patterns and the IoT Pattern Elements Smart, Connected Products The New Product-Consumer Relationship Elements of Smart, Connected Products Smart, Connected Operations Agriculture Manufacturing Cities Energy Buildings Elements of Smart, Connected Operations New and Innovative Experiences Wearables Connected Environments for Work, Play, and Health Elements of Innovative Experiences The Edge of the IoT Living on the Edge An Abstract Edge Architecture Model Device Types Edge Architecture Examples Real-World Deployment The Cloud Cloud-to-Device Connectivity Messaging and the IoT Back to the Future: How Reliable Is Your Network? Device Ingress/Egress Data Normalization and Protocol Translation Data Consistency Infrastructure How Much Data Is Too Much Data? The Value of Small Data APIs The Topology of the Cloud IoT Applications The Semantic Model Software UX Design Considerations The Right Design Machine Learning and Predictive Analytics Learning Predicting Adapting Rapid Application Development A Companies, Products, and Links ...Hardware Foundational Elements of an IoT Solution The Edge, The Cloud, and Application Development Joe Biron and Jonathan Follett Foundational Elements of an IoT Solution by Joe Biron and Jonathan... registered trademark of O’Reilly Media, Inc Foundational Elements of an IoT Solution, the cover image, and related trade dress are trademarks of O’Reilly Media, Inc While the publisher and the authors... time, and data analytics driving optimization and transformation in industries as varied and far-reaching as aeronautics and agriculture, transportation and municipal services, manufacturing and