Chapter 1. From the Internet of Things to the Web of Things

This chapter covers

  • An introduction to the concept and history of the Internet of Things (IoT)
  • When and why we should digitally connect physical objects
  • The limitations of traditional approaches to the Internet of Things
  • How and why the Web of Things (WoT) is different and why it’s promising

If you’re holding this book in your hands, it’s very likely that you’ve already heard the terms Internet of Things (IoT) and Web of Things (WoT). Maybe you want to understand what this trend is all about. Or maybe you already understand why this topic has become so popular and you’d like to be part of it, but you’re not sure where to start. Or—even further than that—you realize what the IoT could mean for your industry and you’d like to gain the hard technical skills needed to build web-connected products and services. If any of those ring true, you’re in for a treat!

What is the IoT, anyway? When and where was it invented? What new types of applications and scenarios does the IoT enable? How will this change the technology and business landscape for the coming years? The next chapters will answer all these questions and many more. But don’t throw away this book yet, because it won’t just discuss theory. It will also cover in detail all the web technologies and tools that will help you make the Internet of Things a reality. On the other hand, we believe that starting with some background will help you better understand what the IoT really is and how you can use it in your own projects, not just stick to the superficial and stereotypical descriptions of it. Diving into the history of the IoT will help you understand the subtle difference between the Internet of Things and the Web of Things and especially why this distinction matters.

In the last few years, the Internet of Things has become one of the most promising and exciting developments in technology and business. The vision of a world where tiny computers with sensors and communication interfaces that are embedded in the infrastructure of our cities or in cars, offices, or clothes is likely to revolutionize every area of our lives—how we play, how we work and do business, and how we live. Until recently, IoT projects mostly focused on building small-scale, closed, and isolated deployments where devices were not designed to be easily accessible or reprogrammable. The bespoke coupling between devices and applications in a given use case means that any change to an existing deployment is complex and expensive. This limits both the maintenance and evolution of the Internet of Things because considerable resources (time, money, and technical skills) are required each time a new function is added.

In contrast, the web has become widely successful in the last two decades because it’s simple to learn and use and it also emphasizes loose coupling between servers, browsers, and applications. The simple and clearly defined programming model of HTTP makes it possible for anyone to change pieces of the system without breaking the whole system. Therefore, building new web applications has been relatively inexpensive and accessible to a much larger group of technology enthusiasts.

The Web of Things is a specialization of the Internet of Things that uses what made the web so successful and applies it to embedded devices in order to make the latest developments in the Internet of Things accessible to as many developers as possible. On the Web of Things—just like on the web—anyone with a text editor and the basic understanding of web standards (HTML and HTTP) can quickly start connecting devices and objects to the web. But it also enables going to the next level and helps you to effectively build interactive and innovative real-world applications that blend the physical and digital worlds.

1.1. Defining the Internet of Things

Capturing the essence of the Internet of Things in one sentence is nearly impossible. The concepts have been around for decades and there are no clear boundaries to what the IoT is or isn’t. Nevertheless, the broad definition of the Internet of Things vision is a world where the internet is much more than the collection of multimedia content it is today: it extends into the physical, real-time world using a myriad of small or even tiny computers. In short, the simplest definition we can offer for the Internet of Things is the following.

Definition

The Internet of Things is a system of physical objects that can be discovered, monitored, controlled, or interacted with by electronic devices that communicate over various networking interfaces and eventually can be connected to the wider internet.

Two decades ago, a world where everyday objects could feel the world through sensors and then analyze, store, or exchange information existed only in science-fiction novels or in the Jetsons. Today, such scenarios are increasingly becoming reality, thanks to the colossal progress in embedded devices that brought into the world a new class of objects: smart things. A smart thing (which we’ll refer to as a Thing—with a capital T—in the rest of this book) is a physical object that’s digitally augmented with one or more of the following:

  • Sensors (temperature, light, motion, and so on)
  • Actuators (displays, sound, motors, and so on)
  • Computation (can run programs and logic)
  • Communication interfaces (wired or wireless)

Things extend the world we live in by enabling a whole new range of applications; see figure 1.1. By deploying a bunch of tiny and cheap—yet increasingly powerful—computers everywhere around us, it becomes possible to monitor and interact with the physical world with a much finer spatial and temporal resolution than ever before.

Figure 1.1. The Internet of Things landscape. The IoT is a network of Things, which are anything that can be connected in some form to the internet. From a box of oranges with an RFID tag, to a smart city, to every Thing in between, all digitally augmented objects make up the Internet of Things.

Concretely, the Things in the Internet of Things can range from simple tagged products such as your FedEx package with an Auto-ID tag (Automatic Identification methods such as bar codes, QR codes, and NFC and RFID tags) attached to it so it can be tracked from the shipping center to your door; to more elaborate, complex, and wirelessly connected products, devices, or machines such as security systems, your car, or a factory assembly line; and all the way up to a building or even a city. The internet part of the term means that the Thing (or at least its services or data about/from it) can be accessed and processed by other applications through the existing internet infrastructure. Note that this does not imply that the Thing itself must be directly connected to the internet. The communication network used can be an Auto-ID method, short-range radio (Bluetooth, ZigBee, and the like), or the Wi-Fi network in a building.

Unfortunately, building a single and global ecosystem of Things that communicate with each other seamlessly is virtually impossible today. There’s no unique and universal application protocol for the Internet of Things that can work across the many networking interfaces available today. To put it bluntly, the Internet of Things of today is essentially a growing collection of isolated Intranets of Things that can’t be connected to each other.

For the Internet of Things to become real, we need a single universal application layer protocol (think language) for devices and applications to talk to each other, regardless of how they’re physically connected. Rather than inventing yet another protocol from scratch (as many IoT projects have been—and keep—doing), why not reuse something that’s already widely used to build scalable and interactive applications, such as the web itself? This is what the Web of Things (and this book) is all about: using and reusing readily available and widely popular web protocols, standards, and blueprints to make data and services offered by Things more accessible to a larger pool of (web) developers.

1.2. Enter the Web of Things

As we’ll describe in detail in section 1.4, the limitations of the Internet of Things become visible as soon as one wants to integrate devices from various manufacturers into a single application or system. To illustrate how the Web of Things can deal with these limitations, let’s consider the life of Johnny B., the owner of a famous hotel chain in several cities around the world. Johnny would like to digitally connect all the appliances in all the rooms of all his hotels, so that he can monitor, control, and improve the management of his hotels from the deck of his yacht in the Bahamas via a single control center application. Meanwhile, this system could also offer a more pleasant and personalized experience to each guest in his hotels, as shown in figure 1.2.

Figure 1.2. Johnny would like to digitally connect the appliances in all rooms of his hotel. First, guests could have access to a variety of services from controlling their room (lights, air-conditioning, entertainment, and so on), to booking hotel facilities, to ordering food and drinks—all of this on their mobile phones. Second, this system would allow Johnny to coordinate and optimize all aspects of his hotel in a centralized and efficient manner, without having to use a variety of siloed applications and tools.

1.2.1. Web of Things scenario: connected hotel

Building this smart hotel system will likely require electronic door locks made by company Alpha, security cameras from company Beta, and a control application to manage all of this made by company Gamma. Making these devices and systems talk and work with each other will require lots of custom system integration. Johnny could contract with a specialized company and spend his well-earned resources on a substantial project that will take months to complete. Such a complex and bespoke project will have the robustness of a Jenga tower (touch the wrong piece and all hell breaks loose): it will be swamped with bugs and hacks and therefore will be a nightmare to maintain and to extend. In this scenario, there’s little doubt that Johnny will run out of money before he gets the system he wants.

If Johnny is into DIY (do it yourself), he can certainly decide to build the whole system himself. He’ll need to buy all the equipment from the same company so he won’t run into any incompatibilities. Unfortunately, it’s unlikely that he’ll find a single manufacturer that has all the sensors and equipment he needs. Even if he finds this perfect system, chances are high that the control application that comes with it won’t be what he wants: easy to use and to configure. He’ll likely have to write a whole new control center application himself, from scratch. Oh, and if he also wants the system to be scalable, reliable, and secure, he can easily double—if not triple—the time he’ll need to build it. Should we also talk about the mobile apps that will need to be built for the hotel guests? You get the idea.

Johnny’s life may seem surreal. Sadly, it’s pretty much what the IoT looks like today. We know this because we’ve had the chance to work with many Johnnies over the last decade, ranging from shop managers wanting to combine their existing security cameras with RFID gates to create smarter security systems, to LED manufacturers wanting their lights to be controlled from the web. We’ve experienced this scenario over and over.

Wouldn’t it be wonderful if any device could be easily integrated and consumed by any application, regardless of the networking protocols or standards they use? This is exactly what the Web of Things enables, as illustrated in figure 1.3.

Figure 1.3. In the Internet of Things, hundreds of incompatible protocols coexist today. This makes the integration of data and services from various devices extremely complex and costly. In the Web of Things, any device can be accessed using standard web protocols. Connecting heterogeneous devices to the web makes the integration across systems and applications much simpler.

1.2.2. Comparing IoT and WoT

Because more everyday objects will be digitally augmented, the next logical step is to use the World Wide Web ecosystem and infrastructure to build applications for the Internet of Things, effectively breaking this ongoing “one device, one protocol, one app” pattern. It would be particularly interesting to push down to each of those tiny devices the exact same technology that helped modern websites such as Facebook or Google scale to millions of concurrent users, without compromising on security or performance. The idea of maximizing existing and emerging tools and techniques used on the web and applying them to the development of Internet of Things scenarios is the ultimate goal of the Web of Things.

While the Internet of Things has been busy resolving networking problems, the Web of Things relies exclusively on Application-level protocols and tools (layer 7 of the Open Systems Interconnection (OSI) model described in chapter 5); see figure 1.4. Mapping any device into a web mindset makes the Web of Things agnostic to the Physical and Transport layer protocols used by devices. As you’ll learn to do in the next chapters, the good news is that pretty much any custom IoT protocol or standard can be linked to the web thanks to software or hardware bridges called gateways.

Figure 1.4. The Web of Things is concerned with only the highest OSI layer (7), which handles applications, services, and data. Working with such a high level of abstraction makes it possible to connect data and services from many devices regardless of the actual transport protocols they use. In contrast, the Internet of Things doesn’t advocate a single Application-level protocol and usually focuses on the lower layers of the OSI stack.

Abstracting the complexity and variety of the lower-level protocols behind the simple model of the web offers many advantages. Just like the web has become the global integration platform for distributed applications over the internet, the Web of Things facilitates the integration of all sorts of devices and the applications that interact with them. In other words, by hiding the complexity and differences between various transport protocols used in the IoT, the Web of Things allows developers to focus on the logic of their applications without having to bother about how this or that protocol or device actually works.

Coming back to our smart hotel scenario, if all devices (regardless of their manufacturer) could offer a standard web API, integration of data across devices and applications will pretty much come out of the box because all devices would speak the same language. In this case, the hotel owner (or system integrator) will only need to worry about building the control center application that’s likely going to be a web mashup—a single web application that combines data and services from various sources. He won’t have to bother learning the specifics of each protocol used by the various devices he wants to use.[1] This will not only take significantly less time to build but will also minimize the effort required to maintain the system each time a device or service is added, removed, or updated.

1

A not so short list of automation protocols: https://en.wikipedia.org/wiki/List_of_automation_protocols

Making this vision a reality has been the objective of the Web of Things community we started in 2007.[2] Using HTTP and other web standards or tools to interact with embedded devices made perfect sense to us. At the time, this idea seemed unrealistic and even pointless to some, and we got our fair share of criticism, mainly because embedded web servers in an Internet of Things generally have more limited resources than the clients who access them (such as browsers or mobile phones). But things have changed: recent embedded web servers with advanced features can be implemented with only 8 KB of memory. Thanks to efficient cross-layer TCP/HTTP optimizations, they can run on tiny embedded systems or even smart cards. Also, thanks to the massive developments in the JavaScript community, it has become increasingly easy to shift a lot of the workload from devices to client applications and even to the cloud.

2

In the Web of Things, devices and their services are fully integrated in the web because they use the same standards and techniques as traditional websites. This means that you can write applications that interact with embedded devices in exactly the same way as you would interact with any other web service that uses web APIs—in particular, RESTful architectures.

As we’ll describe in chapter 6, REST is an architectural style for developing distributed applications and is the basis upon which the modern web is built. The essence of REST is to focus on creating loosely coupled services that can be easily reused, which are implemented using URIs, HTTP, and standardized media types. Abstracting the services from their application-specific semantics thanks to a uniform interface (HTTP verbs and response codes) makes it easy to build loosely coupled services because it provides a simple mechanism for clients to select the best possible representations for interactions. This makes the web the ideal substrate to build a universal architecture and application programming interface (API) to interact with Things, as shown in figure 1.5.

Figure 1.5. The Web of Things is the ability to use modern web standards on embedded devices. By using all these standards for Internet of Things scenarios, we both enable new types of interactive applications to be built and make sure that devices can be integrated with modern web applications and services with minimal effort.

In practice, this means you can start interacting with Things via web browsers and explore the Web of Things as you would surf the web (via links to other related Things). Real-time data collected from distributed sensors can then be easily retrieved, processed, and displayed on web pages using HTML, CSS, and JavaScript.

In contrast to many protocols and standards existing in the Internet of Things, the programming model behind the Web of Things is significantly easier to learn and to use. This is particularly interesting because it enables anyone with basic web programming skills to build websites and applications, not only around multimedia content but also with real-time data from the physical world, as figure 1.6 illustrates.

Figure 1.6. The Web of Things allows developers and applications to exchange data with any physical object or device using standard HTTP requests, regardless of how the device is connected.

Although the Web of Things emphasizes the use of web standards to exchange data between devices, it doesn’t imply anything about how the devices should be physically connected to each other. In other words, devices can (but don’t have to) be openly connected to the web and publicly accessible by anyone just like websites. The Web of Things works equally well in a local network (for example, the intranet of your company or your Wi-Fi network at home).

In some cases, it makes sense for Things to have a public URL and be openly accessible over the web—for example, traffic or pollution sensors in a city operated by the public authorities. In this case, devices could also be crawled and indexed by search engines like any other web page and allow users to literally Google the physical world or bookmark the URL of a smart object and share it with friends. Web-connected objects can also become active and participate in the web just like other users by publishing their own blogs or talking to each other using the APIs of services such as Twitter.

Using services such as IFTTT,[3] users can create small, logical rules that mix real-world devices such as sensors in their home with virtual services in the cloud; for example, an SMS gateway or a weather forecast service. Such applications are called physical mashups and are the topic of chapter 10, where you’ll learn the principles and tools that will allow you to create physical mashups on top of your Things.

3

To really understand why the Web of Things represents an interesting next stage in the evolution of the IoT, we first need to look at the history of this field up to today. Why did the idea of connected devices emerge in the first place? And if the vision of a global network of connected devices is so promising, why doesn’t it exist yet? We attempt to answer these questions in the next section.

1.2.3. The Internet of Things—a brief history

To understand where the notion of the Internet of Things comes from, we have to look into a field of computer science research that goes by many names, most commonly ubiquitous computing or pervasive computing. One of the founding fathers of this discipline was Mark Weiser. While leading the Xerox PARC research lab in the early ‘90s, Weiser started to think about the next wave of computers:

The most profound technologies are those that disappear. They weave themselves into the fabric of everyday life until they are indistinguishable from it.... Silicon-based information technology, in contrast, is far from having become part of the environment. More than 50 million personal computers have been sold, and nonetheless the computer remains largely in a world of its own. It is approachable only through complex jargon that has nothing to do with the tasks for which people actually use computers.

Mark Weiser, “The Computer for the Twenty-First Century,” 1991

What Weiser understood before anyone else was that computers were clearly evolving from the big, bulky boxes on desktops and in offices toward smaller and smarter devices that would soon be seamlessly embedded everywhere in the world around us and become invisible.

The years that followed 1991 were the early years of the internet we know today, which has grown into a massive public global network of computers, thanks to the invention, by Sir Tim Berners-Lee, and development of the web (HTTP and HTML)—the Application layer on top of the internet.

No wonder the stunning success of the internet had a strong impact on the ubiquitous computing research community. A number of researchers started to think about connecting physical objects to the internet. In particular, these included researchers from the Auto-ID Labs (an international cluster of research laboratories originally founded at MIT), such as Sanjay Sarma, Kevin Ashton, David Brock, and Daniel Engels at MIT and Friedemann Mattern and Elgar Fleisch at ETH Zurich. Their primary focus was on automatically identifying goods using radio frequency identification (RFID) tags in order to create a global network of electronically tagged products and to be able to optimize logistics and supply chains. Looking for a term to describe this global network, Kevin Ashton came up with the term Internet of Things.[4] The rest is history.

4

Although the term Internet of Things was coined in 1999, this concept has remained under the radar of the general public until the last few years, when people realized it was more than just a trendy term. According to Google Trends, since December 2013 the term Internet of Things clearly took over Web 2.0 in news headlines (figure 1.7). Although Web 2.0 has been one of the most popular emerging web trends of the 2000s, in the last few years it has faded away from the spotlight as the popularity of the Internet of Things has grown exponentially.

Figure 1.7. Since December 2013, the term Internet of Things has become more popular in news headlines than Web 2.0. [Source: Google Trends, September 25, 2015]

When Google acquired NEST for a “modest” $3.3 billion USD in December 2013, a collective “Aha!” moment took place: Hold on! There is actually money to be made with the Internet of Things. And lots of it! In 2014, Gartner predicted a population of over 25 billion connected devices by 2020.[5] Cisco was a bit more optimistic and predicted that by 2020 there would be more than 50 billion Things connected to the internet.[6]

5

6

It doesn’t really matter who is right or wrong because one thing is certain: in the next decade, there will be a lot more internet-connected devices around us. A significant milestone was reached in 2008 when the number of Things connected to the Internet exceeded the number of people. In consequence, many of the largest companies in the world, from Cisco to Samsung to IBM, mentioned the IoT as a key strategic investment in 2014.[7]

7

We can learn two things from this sudden interest in the Internet of Things. First, regardless of whether you are a back-end guru, a front-end developer, or a hobbyist hacker, now is the ideal time to brush up on your Internet of Things skills. Second, the years of the Intranet of Things, where Things only ever communicate in their own little world, are numbered. But for the IoT to become a reality and unleash its potential, all those objects need to speak the same language. For devices and applications to interact with each other easily, securely, and in an ad hoc manner, we need a universal and open standard that promotes loose coupling, scalability, and flexibility.

1.3. Use cases—why connected objects?

It would be incorrect to ask when the IoT will be here because it already is. Countless examples can be found everywhere today. Your smart TV connects to the internet and records the shows you prefer to watch. The Nike+ sensor in your shoes uploads all your runs to the internet so you can compete with your friends. And your mobile phone streams your location so you can track it or disable it remotely if it gets stolen.

Nonetheless, the IoT is still in its early teenage years and will certainly influence our world in a much more profound way than these early use cases did. Let’s look at the areas where the IoT will most likely have a big impact. This is an opportunity to see what benefits the Web of Things can bring to multiple areas. Hopefully, this will inspire you for your future weekend hacks or more serious product developments.

1.3.1. Wireless sensor networks and distributed sensing

The incredible progress in computing in the ‘80s and ‘90s, especially the miniaturization of embedded computers and radio networking chips, led to the emergence in the early 2000s of wireless sensor networks (WSNs). Those networks are composed of tiny, single-board computers such as the ones shown in figure 1.8.[8] Those devices, being cheap and battery-powered, could be deployed in large areas to continuously monitor various physical environments or structures using a multitude of sensors. For example, WSNs have been used to monitor the structure of historical buildings such as the Torre Aquila in Italy,[9] to understand the impact of humans on bird habitats,[10] and to monitor agricultural crops for food production.[11]

8

9

10

11

Figure 1.8. Three generations of wireless sensor nodes

Although early WSN deployments weren’t connected to the internet, these systems influenced the IoT in many ways because this prolific research community gave birth to innovative ideas that shaped IoT technologies. The techniques, tools, and protocols developed for WSNs made it possible to use low-power platforms for large-scale distributed sensing applications in the real world.

The requirements and operating context of those devices also gave birth to a number of operating systems optimized for low-power sensing, such as TinyOS[12] or Contiki.[13] Indeed, when battery-powered devices are deployed in natural and unpredictable environments, it’s essential to ensure robustness and minimal energy consumption because human intervention to debug or fix software and hardware problems—or even to change the batteries—is clearly impractical.

12

13

WSNs and the Web of Things

It’s clear that the majority of WSN devices weren’t designed for the public. Those platforms were intended to be mainly programmed by experts. Although web protocols are heavier (more verbose) than the optimized protocols used on embedded devices, there has been a lot of progress in optimized HTTP libraries that run on constrained devices.[14] Additionally, devices are becoming increasingly powerful and many come with Wi-Fi connectivity on board. The ability to interact with embedded sensors using standard web protocols makes the collection, storage, and analysis of data from heterogeneous sensors much simpler. Indeed, integrating data across several cloud services is much faster thanks to the simplicity and ubiquity of REST APIs.

14

1.3.2. Wearables and quantified self

Another interesting use case for the IoT is building tiny sensors that people can carry or wear to passively monitor their daily activities or even body factors such as heartbeats or chemicals in their blood or sweat. Heartbeat monitors have long been commercialized for long-distance runners to keep track of and regulate their heart activity. A major breakthrough in this domain was the Nike+, which was easy to use and could connect out of the box to an iPhone (see figure 1.9).

Figure 1.9. The Nike+ ecosystem was one of the pioneers in the quantified self or wearables trend. [Photo by ivyfield on Flickr licensed under CC BY 2.0]

This trend has experiences a boom in the last few years with many more products ranging from activity trackers,[15] to smart scales connected to your phone helping you to control your weight and body fat,[16] to smart pedals tracking your rides and working as antitheft devices,[17] to smart pillows, smart pill boxes, alarm clocks, and smart watches giving you access to a whole new world of information about yourself.

15

16

17

Wearables and the Web of Things

Integrating wearable and quantified self devices on the web, so that the data is directly accessible by other devices and applications, will make it much easier to develop new classes of extensible applications for elder care, health and fitness, or fun and sports. It will also ensure you don’t need a separate app for each of them (with interesting security and privacy challenges that we’ll discuss in chapter 9).

As illustrated by Nike’s success story, early wearable devices focused on the social aspects of sports by sharing and comparing personal data such as race times, distances, and so on. Here again, the Web of Things helps because it allows a seamless connection between wearable devices and social networks on the web.

1.3.3. Smart homes and buildings

In the ‘60s and ‘70s, the house of the future was envisioned as an entirely automated and responsive system, like the ones you could see in The Jetsons or Star Trek. Doors would open automatically; food and coffee would be made by robots and readily served as soon as you pop out of your bed. Your environment would make your life easier and take care of everything you needed when you needed it.

Domotics—the technical term for smart and connected homes—became all the rage in the 2000s, and these systems included entertainment systems, lighting systems, heating, ventilation, air-conditioning systems (HVAC), and so on. But smart homes existed way before the Internet of Things was invented. The most important difference between the legacy systems and the second wave of smart homes is the use of internet or internet-friendly protocols, pushing home automation away from the world of proprietary systems by connecting devices directly to the internet or through residential gateways.

Interestingly enough, this trend toward digitalizing our homes went even further with the development of open-source hardware and software platforms such as Arduino.[18] Indeed, many amateurs started hacking around and connecting various bits in their houses. From energy and gas meters to lighting and presence detectors, amateur developers were suddenly interested and empowered to connect their houses to the internet.

18

Smart homes and the Web of Things

The smart home environment is probably symptomatic of the (too) vast number of standards and protocols that exist for connecting things to networks. Although all devices in your home should talk to each other, they can’t because those protocols are incompatible and you end up with more apps and remote controls than ever before. The Web of Things offers an alternative approach where web languages are the baseline, the minimal API that devices should offer either directly or indirectly through gateways. In our own company—EVRYTHNG[19]—we used the Web of Things approach to connect, at scale, a number of home automation devices from different manufacturers.

19

The Web of Things allows interoperability between devices from different manufacturers and fosters cross-device applications. It also makes it possible for a larger group of amateurs to buy all sorts of devices, build rapidly their smart home systems, and especially reuse and customize these systems easily for their unique needs and desires.

1.3.4. Smart cities and energy grids

One of the most promising use cases for the Internet of Things might well be the emergence of smart cities. As more humans move from rural areas to cities each year, it becomes clear that changes are necessary to the way large cities are designed and operate to ensure the safety and well-being of their inhabitants. The ability to monitor urban environments in real time thanks to a plethora of sensors and computers is an incredibly promising substrate to make our cities smarter and more efficient.

Smart cities have always been at the heart of what WSN researchers do: getting more insights about our environment based on data gathered by tiny computers. But most of this work was based on an asynchronous and linear workflow:

1.  Deploy wireless sensor nodes.

2.  Collect data.

3.  Analyze data in the lab.

4.  Write reports.

5.  Take actions based on these reports.

The Internet of Things gives new dimension to this domain by drastically short-circuiting the required steps. The data is now available on the internet as real-time streams upon which direct actions can be taken. These can be used to monitor safety, traffic, or utilities (water, waste disposal, and more) in real time and react rapidly when any anomaly is detected—ideally before a serious problem occurs.

The interest in smart cities has significantly increased in the past few years with a number of cities betting a lot on the potential of the Internet of Things, such as Milton Keynes in the UK,[20] Santander in Spain,[21] New York in the United States,[22] and Songdo in South Korea.[23]

20

21

22

23

As a stepping-stone to this vision of future cities, smart grids are using the Internet of Things to optimize the way we consume and distribute energy. Thanks to real-world services, home and industrial appliances can increasingly communicate their energy consumption in real time and raise consumers’ energy awareness. Furthermore, appliances can communicate with each other to make whole buildings smarter by optimizing HVAC among other things. Even more important, through composite applications using real-world services, industrial machinery and citywide infrastructures will be able to negotiate energy consumption and limit consumption peaks.

Smart cities and the Web of Things

Using web standards in the context of smart cities is particularly interesting because they make it much easier to share sensor data with the public and make it easy for developers to consume real-time data about traffic, pollution, or public transportation in their own urban applications.

1.3.5. Smart manufacturing and Industry 4.0

Manufacturing went through three main cycles of evolution. First came the mechanization of production processes using water and steam power in the Industrial Era during the 19th century. Afterwards, mass production of goods was enabled thanks to electric power. The third revolution was the digital age, where electronics and computers made it possible to further automate production, distribution, and communication processes.

The IoT is enabling a fourth revolution in manufacturing and industrial systems commonly referred to as Industry 4.0. Germany has been at the forefront of this change driven by companies such as Bosch, Siemens, and SAP. The IoT can bring two main benefits to traditional industries. First is access to unparalleled amounts of data. Connecting machines to the internet and feeding them real-time data is one step toward more transparent and efficient industrial systems. Second, the IoT brings services to machines. Rather than being bound to a single set of operations, industrial machines can now offer services, making it possible to use and reuse these machines in combination with other machines by connecting their respective services. This ability will transform manufacturing machines and plants into flexible ecosystems of reconfigurable production lines that can rearrange themselves to perform any given tasks as efficiently as possible. Industry 4.0 is an ongoing revolution and most of the activities in this field are still taking place in research labs all over the world. But in the last two years, most large companies have actively engaged in IoT projects and products, showing that this isn’t just a trend: it’s a massive opportunity to reinvent any business. And it’s here to stay.

Industry and the Web of Things

Using web standards to interconnect all the elements in a business process, such as the shop-floor machinery, enterprise software, employees in various departments, products, customer, and suppliers, will represent a significant change in how companies do business. Turning all the elements in a factory into easy-to-combine LEGO-like bricks will make it much easier and faster for companies to adapt to changing environments, get their products to market more quickly, optimize their business and manufacturing processes, and so on. When all the actors in those processes are able to automatically decide how best to perform their duty based on real-time data, there’s no doubt that the way we design, manufacture, and distribute physical products will be profoundly changed.

1.3.6. Smart logistics and supply chains

As explained before, the first mention of the Internet of Things comes from the world of Auto-ID of the everyday consumer packaged goods (CPGs) or even the cheaper and short-lived fast-moving consumer goods (FMCGs). It’s no wonder that the world of logistics and supply chains was the first to explore the connectivity between all kinds of real-world objects and the internet. Indeed, the Internet of Things isn’t limited to devices but can include any physical object. Even if the object itself doesn’t have any communication capabilities, one can use a mobile phone or an RFID reader to recognize the product and interact with it. In consequence, CPGs such as food products and also more expensive and long-lived items such as a luxury watch or a handbag only need a machine-readable tag to be part of the Internet of Things.

The EPCglobal network[24] was probably the first standardized system for applying the Internet of Things to logistics. The EPCglobal network is a set of standards that describe how to connect RFID-tagged objects to standard readers, which in turn are connected via the internet to RFID information systems and databases.

24

Passive RFID tags are tiny computers that harvest energy from the electromagnetic field generated by nearby RFID readers. RFID tags are certainly not the only way to identify FMCGs, but they present a key advantage over other technologies such as barcodes, image recognition, or QR codes: they can be read automatically, without human intervention or line of sight, and they’re already widely deployed in live systems throughout the whole supply chain.

The biggest barrier of adoption for RFID in logistics and supply-chain operations has always been the relatively high cost of RFID, making it expensive to tag every object. But recent developments are producing radical changes in this space: a number of companies in the world have managed to print RFID tags, sensors, and batteries (see figure 1.10). In a few years, it will be easy and cheap to print embedded computers and sensors on products and/or their packaging.

Figure 1.10. A Thinfilm[25] printed NFC tag and temperature sensor. RFID tags, sensors, and batteries can now be printed, reducing the costs and allowing packages to become smart. [Source: Thinfilm, used with permission]

25

Large-scale adoption of automated identification and tracking methods on products will have a massive impact on supply chains, allowing them to be much more efficient and also to offer better services to consumers.

Smart logistics and the Web of Things

Imagine a web-enabled supply chain that knows in real time the temperature of your strawberries and can send alerts as soon as the conditions change or even regulate automatically the temperature of trucks, ships, and warehouses according to the type of the products being stored and transported—all of that information accessible over web APIs. Sharing historical data about devices using web standards will make it much easier for multiple applications to work together across the whole lifecycle of products. This means much lower integration costs and high data integrity across the different systems that will process and handle those products.

1.3.7. Marketing 2.0

The ability to connect CPGs and FMCGs to the internet enables many interesting applications for product manufacturers and retailers, but beyond the supply chain, on the consumer side, it also allows new services, commonly referred to as Marketing 2.0. The ability to identify products with mobile phones using bar codes, QR codes, or image recognition makes it possible to launch personalized marketing campaigns by turning a product into a direct communication and service delivery channel between consumers and retailers. Typical applications in this field range from product personalization and gifting to customer loyalty, digital user guides and after-sales services, and personalized warranties and product recalls.

The use of IoT technologies for marketing purposes isn’t limited to tagged products. Smart devices can be used to fuel the craziest and most creative (we’ll let you be the judge of that.) marketing campaigns as well. Examples of those are the Evian Drop, a small device that lets you order water directly from your fridge for delivery to your doorstep,[26] the Dom Pérignon button (figure 1.11) that lets you order champagne at the push of a button in your hotel room at the prestigious Savoy Hotel in London,[27] and the Budweiser Red Light that glows bright red when your favorite team scores a goal.[28]

26

27

28

Figure 1.11. The Press for DP button manages the delivery of Dom Pérignon champagne in Savoy Hotel rooms within a few minutes. [Source: LVMH, used with permission]

Marketing and the Web of Things

Mobile applications can retrieve data about CPG and FMCG products, interact with them to attach digital content, and share information about them on social networks much quicker and more easily over the web. If every product in the world had its own URL and web API, it would be easy for any application to recognize a product and access its data without much integration effort. At EVRYTHNG we used our Web of Things platform to connect products to the web and deliver such Marketing 2.0 applications. As an example, Diageo in Brazil printed unique QR codes on its whiskey bottles so that their customers could attach a personalized message to each bottle; in that case, it was a video created on the customer’s smartphone for Father’s Day.[29]

29

1.4. The Web of Things—a supercharged Internet of Things

As described previously, the majority of IoT systems paid little attention to the issues of an open and large-scale system of heterogeneous devices talking to each other. This is partially because the IoT focused strongly on the lower layers of the networking stack (how data can be transmitted between actors) and much less on how to facilitate the development of new applications (how data can be collected, visualized, or processed). In particular, limited effort has been devoted to enable ad hoc interoperability, and consequently it’s still difficult to build scalable applications on top of heterogeneous devices.

The reason for that isn’t as much technical as it is commercial. A plethora of protocols for the IoT have been proposed in the last decade by standardization bodies, industrial alliances, and vendors. In essence this is a good thing. But the crude reality is that none of those standards has reached sufficient traction to be “the one” universal protocol for the IoT (see figure 1.12). Today, if you want a smart house, at best you’ll have to buy all components from the same manufacturer. Because of this, your only option to control that system will be through the application that comes with it. If that application has been designed mainly for iPhone and isn’t available on Android, well, that’s too bad. If that application is badly designed, is painfully slow, or doesn’t have half the features you need, you’re stuck with it.

Figure 1.12. The problem with Internet of Things. The Web of Things builds upon and extends existing and widely used web standards so that it can use the whole web ecosystem in place. [Source: http://xkcd.com/927/ used under Creative Commons 2.5 license]

Put simply, most IoT solutions on the market today have little in common with the Internet—a unique, open, global network where everything is interconnected. The Internet of Things of today should rather be called the Intranets of Things, because it’s a set of isolated islands of functionality that weren’t designed to talk to each other. Even though an increasing number of networked devices offer APIs to control and access data about them, a custom application still needs to be developed specifically for each of those APIs. This is the case not only because different devices have different functionalities, but also because each API is implemented using different application protocols and has a different data model without a shared and standardized language.

The simplicity and openness of the web and its standards (URL, HTTP, HTML, JavaScript, and so on) is likely what enabled the web we know today. This lingua franca enabled any user in the world to read any other web page without installing anything and has been a major factor in the success of the web. By enabling web pages, browsers, servers, and services to all speak the same application language, the integration of a large variety of content was incredibly simplified. The equivalent enabler has unfortunately not yet been found for devices and applications in the Internet of Things.

In this section, we describe the limitations and problems with the existing approaches to IoT that don’t prioritize an open, universal, and simple Application layer protocol for devices. For each of those limitations, we show the benefits of using a Web of Things approach instead.

1.4.1. Easier to program

First, let’s look at the way Things are programmed.

Internet of Things

The first problem with existing solutions and products today is that many of those protocols are complex and difficult to use. Such a high barrier for adoption, like the internet had in the 70s, puts the IoT out of reach for most people. Learning to connect to various devices that use a variety of interfaces and protocols is an especially arduous task that will deter the most tenacious amateur who wants to get started with programming their smart house. If you have any doubt about this, we invite you to consult the specifications of the ZigBee[30] protocol or of the Devices Profile for Web Services (DPWS).[31]

30

31

Web of Things

Web protocols can easily be used to read and write data from/to devices, and are especially much simpler to use and faster to learn than the complex IoT protocols. In addition, if all devices could offer a Web API, developers could use the same programming model to interact with any of them. Once you get the basic skills needed to build simple web applications, you can rapidly talk to new devices with minimal effort.

1.4.2. Open and extensible standards

Next, we look at how open the standards are in both worlds.

Internet of Things

Another issue is that many of those protocols have been continually evolving as new use cases are made possible by new technological developments. Because some of those standards are funded and governed by one or a limited number of large corporations, they aren’t as neutral as a community-led open-source project. Besides, these companies could decide to introduce breaking changes as they wish, thereby rendering existing devices and applications unable to talk to each other.

Moreover, some of those standards aren’t publicly documented and can’t be simply used and implemented without paying a significant annual fee. This automatically limits, which automatically limits their adoption to only large industrial organizations. Closed and proprietary protocols also lead to vendor lock-in. Ensuring that switching to a different vendor is time- and cost-intensive is a well-known business strategy for big software players—nothing new here. But in an IoT context the barriers are much higher because switching protocols sometimes also implies changing the hardware (e.g. using a different radio chip). Similarly, switching application protocols requires firmware updates, which are hard to apply in the real world.

Web of Things

The reason web standards have reached such popularity is that they’re entirely open and free, so there’s virtually zero risk that they would change overnight. They ensure that data can be rapidly and easily moved across systems, hence HTTP and REST are an obvious choice when one wants to offer public access to some data.

1.4.3. Fast and easy to deploy, maintain, and integrate

Let’s look at the impact on deployment, maintenance, and integration for each approach.

Internet of Things

Because entire systems would need to use a single protocol, significant effort is required to write custom convertors for each new device or application that needs to be integrated. Maintenance of such a delicate assemblage of custom code is a risky task and in business applications would mean significant investments.

Web of Things

There’s no risk that the web will suddenly stop working and require an upgrade. Yet, the limits of what can be done on the web have not ceased to be redefined in a decade, such as the ability to capture images from a camera or share one’s location. In contrast, there are always new devices and protocols in the IoT world, and each time one of the many protocols changes, all the other pieces of the puzzle that use the device need to be updated.

1.4.4. Loose coupling between elements

Next, we look at the dependencies of each approach, focusing on reusability.

Internet of Things

The implication of the previous sections is most importantly a tight coupling between the devices and applications in the network. The system works well as long as all pieces behave as expected and are used as intended. Sadly, this doesn’t leave much space for ad hoc, unplanned interactions and repurposing of services into new use cases, which are essential requirements in large-scale open networks of devices.

Web of Things

HTTP is loosely coupled by design because the contract (API specification) between actors on the web is both simple and well defined, which leaves little room for ambiguity. This allows any actor to change and evolve independently from each other (as long as the contract doesn’t change). That’s why you can still visit a web page that hasn’t been updated since the early ‘90s (we’ll skip any comments about its visual design). The ability for devices on the Internet of Things to talk to new devices as they get added without requiring any firmware updates is essential for a global Web of Things.

1.4.5. Widely used security and privacy mechanisms

The issue of personal data, privacy, and security of IoT/WoT systems has always been a major concern when building and deploying real-world applications. The two angles to consider are these:

  • Security— How to ensure a system can’t be easily accessed or used in a harmful way by unauthorized users or systems. In other words, this is about ensuring that no one can access data or a device they aren’t supposed to have access to.
  • User privacy— Assuming security is in place and only authorized and authenticated parties or applications can access some data, how do we ensure that no private information about users (for example, personal information or behavioral data—where the user is, what the user is doing, and the like) could be accessed or derived from it? This is particularly difficult because even if a piece of data available about a user is harmless on its own, when combined with another piece of data available from another sensor or system, it can be used to unambiguously identify a user and their behaviors.

The truth is that even though there have been many projects and efforts to improve the security of those systems, as of today, the Holy Grail of security and privacy in the IoT world remains to be found. The real challenge is that capabilities of the IoT are relatively new at this scale, and the risks associated with those technologies are both largely unknown and hard to identify or measure in real-world applications.

Internet of Things

As explained earlier, because applications in the IoT are often developed individually, the security mechanisms for these deployments are too often written from scratch, not tested sufficiently in the real world, or simply non-existing. Even today, a number of IoT devices are being deployed without using a sufficient level of security, dangerously exposing their authentication keys to the world.[32] This is mainly because IoT-specific security systems have quite often been designed to work well in closed ecosystems, where every element is controlled.

32

Web of Things

The web can help here, too, and we’ll look into this in chapter 9. Looking back at the history of the web, we can see that we’ve made tremendous progress in building usable and reliable security mechanisms and protocols. These methods are not bulletproof—no security system is—but are a practical compromise of dependability, ease of use, performance, and availability.

The fact is that even today it isn’t uncommon to hear that a large and famous online company has been hacked and the data about millions of its users has been leaked publicly. Even worse, protocols that have been viewed as secure and trusted might still suffer from tiny unknown problems, making them vulnerable when found (SSL Heartbleed[33] anyone?). With a few exceptions, as long as those systems are implemented correctly, the possibility of them being hacked remains minor, especially given that those systems are used daily by billions of users. The advantage of using web-based common standards, as opposed to custom and novel ones developed for the IoT, is that they have been and still are extensively used and tested. Many implementations of such systems are open source (for example, OpenSSL), which means the code is constantly used, tested, updated, and fixed by thousands of developers. Using such established methods reduced the risk of failures as opposed to the bleeding-edge (pun intended) techniques being developed from scratch for the IoT that have been tested and used in the wild only marginally.

33

The Heartbleed Bug is a serious vulnerability that was found in the popular OpenSSL cryptographic software library (see more at http://heartbleed.com/)

1.4.6. WoT—the shortcomings

We realize that at this stage you might be thinking, “These guys got a little carried away with their WoT!” Maybe. But after using traditional IoT tools for over a decade, it’s hard to describe the pleasure we feel after creating the same type of applications directly in our browser with a few lines of JavaScript and with much less effort, time, and suffering.

Nevertheless, the Web of Things isn’t the “Answer to the Ultimate Question of Life, the Universe, and Everything” (aka 42).[34] As with every disruptive technology or approach, it comes with its own share of challenges. Security and general data privacy are some of these. Connecting all Things in our physical world to the internet and making them accessible on the web also means we potentially expose them to intrusive governments, viruses, or disreputable companies that could use this to run denial of service attacks or mine information about the real world. We should assume they will. Thinking about security is already a must for the IoT; the WoT adds a few more concerns, especially on the data privacy side of things. We’ll cover these advanced topics in chapter 9, but the short answer is that a largely connected system will always be more vulnerable than an isolated one. But a system connected using open standards is usually better off than one based on custom security mechanisms. Moreover, this isn’t the first time we’ve had to face such a dilemma: our computers could be isolated, but this would reduce their range of applications. The IoT and the WoT are no exceptions: we, as citizens, have a choice and should weigh each of these new technologies on the balance between risks and benefits. The WoT should be about making our lives easier and more enjoyable, not harder.

34

It’s important to realize that pushing web standards on every single device isn’t always the right thing to do, and in some cases it isn’t practical or feasible. Under certain constraints (such as when a battery-powered device needs to operate for a very long time), you might be better off using an optimized IoT protocol. In chapter 5, we’ll help you understand what these tradeoffs are and give you a framework to decide the best options for various situations. The good news is that the Web of Things is all about integration patterns: we’ll show you how to integrate non-web or even non-IP devices to the web via proxies, gateways, or clouds. This type of hybrid solution sometimes makes deployments more complex but is more practical because it allows for optimizations where needed. We’ll discuss these integration patterns in chapter 7.

1.5. Summary

  • The Internet of Things has been around for much longer than you think and certainly before it was called this.
  • Early IoT systems were designed to operate in isolation; therefore, the IoT today is a fragmented world—the Intranets of Things.
  • The Web of Things is different because it doesn’t care about underlying networking protocols or standards, only about how to weave various isolated systems and devices into a single, web-based ecosystem.
  • Using simple and ubiquitous web standards such as HTTP, Web Socket, and JSON to integrate all sorts of devices and applications makes it much easier to rapidly prototype all sorts of applications and then scale them for enterprise-grade solutions.
  • The IoT is still in its infancy, and there are many opportunities ahead for those who want to master the complexity of a world where the physical world becomes connected.
  • This book will teach you how to use the Web of Things to build a new generation of IoT solutions that are more flexible, scalable, and interoperable by building upon and using the infrastructure, tools, and experience accumulated since the web was invented in the early 90s.

In the next chapter, we’ll give you a first taste of what the Web of Things feels like. By working on a few hands-on exercises, you’ll experience first-hand how easy it is to build Web of Things applications that read sensor data, send commands to devices, and merge information from various sources to create hybrid applications where the real world becomes accessible on the Web. We kept the next chapter simple by hiding the complexity of the devices behind web standards so that you are able to rapidly build and customize your first Web of Things application without having to deal with how to implement it directly on devices (yet!). In the chapters after that, you’ll learn the details of how you can apply those principles to create elaborate applications and connectors for any device and scenario you might have in mind.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.218.55.14