Docsity

Understanding the Impact of Climate Change on Agriculture, Apuntes de Informática

Vista previa parcial del texto

¡Descarga Understanding the Impact of Climate Change on Agriculture y más Apuntes en PDF de Informática solo en Docsity!

BROUGHT TO YOU IN PARTNERSHIP WITH

THE DZONE GUIDE TO

Internet

of Things

Applications, Protocols, and Best Practices

VOLUME IV

DZONE’S GUIDE TO IoT: APPLICATIONS, PROTOCOLS, AND BEST PRACTICES

3 EXECUTIVE SUMMARY BY MATT WERNER 4 KEY RESEARCH FINDINGS BY G. RYAN SPAIN 8 PRIVACY AND CONSENSUAL IoT BY MANUEL PAIS 11 AN OVERVIEW OF IoT MONITORING SYSTEMS BY FRANCESCO AZZOLA 14 IoT STRENGTHENING UBIQUITOUS COMPUTING BY PRADEEP PEIRIS 17 DIVING DEEPER INTO IoT 18 INFOGRAPHIC: AN IoT TINKERER’S TIPS OF THE TRADE 20 CONTEXT IS KEY TO NEXT-GEN IoT BY YOUVAL VAKNIN 24 STRENGTHS AND WEAKNESSES OF IoT COMMUNICATION PATTERNS BY PAOLO PATIERNO 27 CHECKLIST: THE THREE SOFTWARE STACKS REQUIRED FOR IoT ARCHITECTURES BY IAN SKERRETT 30 EXECUTIVE INSIGHTS ON IoT TODAY BY TOM SMITH 32 IoT SOLUTIONS DIRECTORY 39 GLOSSARY

DEAR READER ,

We are living in a time where the Internet of Things is truly ubiquitous in every ecosystem and industry. There are use cases embedded in all industries that utilize technology from home automation to manufacturing, healthcare and smart grid development. It’s only set to get bigger as industry analysts Gartner forecasted in February this year that 8.4 billion connected things will be in use worldwide in 2017, up 31 percent from 2016, and will reach 20.4 billion by 2020. Total spending on endpoints and services will reach almost $2 trillion in 2017.

To date, IoT’s most compelling use case has been in the industrial workplace, where whole sectors have been transformed by its ability to solve problems that have plagued traditional industries for centuries, from machine repairs and supply chain processing to worker shortages and waste management. Similarly, today’s farmer is most likely to rely on a smartphone than a pitchfork as they utilize IoT data to get the most accurate information about the weather, growing conditions, and their farm’s soil quality – metrics previously unavailable or difficult to attain in real-time.

At the same time, we see a whole new field of intersectional technologies rubbing shoulders with IoT: such as AI, Big Data, and machine learning. Through this we get robots that not only respond to commands but can diagnose and treat their own technical problems and teach tasks to other robots, removing the need for human direction. In health science, wearable tech provides real- time physiological data that can be shared remotely with health professionals, changing not only the doctor-patient relationship but how health care is delivered. And before long, autonomous transport will become a reality, with the birth of new driverless vehicles that change our relationship with the car forever.

IoT will not only introduce new tech, but also new jobs, thanks to the growing list of hardware platforms, networks, operating systems, cloud services, endpoint management tools, and ecosystems. The demand for software engineers is substantial with career opportunities ranging from API design, data integration, and microcontroller programming, to name a few. In simple terms, data collection, storage, and analysis will feature highly in more and more jobs today and in the future.

However, like any sector, IoT is not without its growing pains. Each use case requires its own approach and protocol depending on what is being built and how it is to be powered with range, data, power and battery life all needing to be considered. As further use cases are constantly being refined and expanded and more and more products become connected, new protocols are needed. Yet poor physical environments, a lack of Interoperability, and power constraints challenge the effectiveness of the technology.

Then of course, there’s the elephant in the room: device and data security. At its best, a security breach is a minor inconvenience like your anonymized wearable data being posted online. At its worst, it’s botnet attacks and cyber hacking that could disable life-saving hospital equipment, shut down an entire city’s traffic lights or disable local utilities. Thus, we can expect to see just as many careers emerge in cyber security, insurance, and asset management as we will in data analytics and IoT architecture.

In this guide, we’ll provide you with a detailed understanding of the rapidly expanding sector that is IoT. We’ll cover AI, predictive maintenance, IoT software stacks, consensual software, and of course privacy to name a few areas. Research and use cases will give you a feel for where IoT is right now and where it will head in the future. Get ready to get excited and learn about this fascinating part of technology and its role in the future.

PRODUCTION CHRIS SMITH DIRECTOR OF PRODUCTION ANDRE POWELL SR. PRODUCTION COORDINATOR G. RYAN SPAIN PRODUCTION PUB. EDITOR ASHLEY SLATE DESIGN DIRECTOR MARKETING KELLET ATKINSON DIRECTOR OF MARKETING LAUREN CURATOLA MARKETING SPECIALIST KRISTEN PAGÀN MARKETING SPECIALIST NATALIE IANNELLO MARKETING SPECIALIST MIRANDA CASEY MARKETING SPECIALIST JULIAN MORRIS MARKETING SPECIALIST

EDITORIAL CAITLIN CANDELMO DIRECTOR OF CONTENT + COMMUNITY MATT WERNER PUBLICATIONS COORDINATOR MICHAEL THARRINGTON CONTENT + COMMUNITY MANAGER MIKE GATES SR. CONTENT COORDINATOR SARAH DAVIS CONTENT COORDINATOR TOM SMITH RESEARCH ANALYST JORDAN BAKER CONTENT COORDINATOR ANNE MARIE GLEN CONTENT COORDINATOR

BUSINESS RICK ROSS CEO

MATT SCHMIDT PRESIDENT + CTO JESSE DAVIS EVP & COO MATT O’BRIAN DIRECTOR OF BUSINESS DEV. CHRIS BRUMFIELD SALES MANAGER ALEX CRAFTS DIRECTOR OF MAJOR ACCOUNTS

JIM HOWARD SR ACCOUNT EXECUTIVE JIM DYER ACCOUNT EXECUTIVE ANDREW BARKER ACCOUNT EXECUTIVE BRIAN ANDERSON ACCOUNT EXECUTIVE ANA JONES ACCOUNT MANAGER

TOM MARTIN ACCOUNT MANAGER

SPECIAL THANKS to our topic experts, Zone Leaders, trusted DZone Most Valuable Bloggers, and dedicated users for all their help and feedback in making this guide a great success.

TABLE OF CONTENTS

WANT YOUR SOLUTION TO BE FEATURED IN COMING GUIDES? Please contact [email protected] for submission information. LIKE TO CONTRIBUTE CONTENT TO COMING GUIDES? Please contact [email protected] for consideration. INTERESTED IN BECOMING A DZONE RESEARCH PARTNER? Please contact [email protected] for information.

BY CATE LAWRENCE, ZONE LEADER, DZONE

DZONE’S GUIDE TO IoT: APPLICATIONS, PROTOCOLS, AND BEST PRACTICES

BY G. RYA N S PA I N P R O D U C T I O N C O O R D I N ATO R , DZO N E

535 people completed DZone’s 2017 Internet of Things survey. Demographics of these respondents include the following:

- 22% of respondents work at organizations with more than 10,000 employees; 21% at organizations between 1,000 and 10, employees; and 19% at organizations between **100 and 1,000 employees.

  • 38% of respondents work at organizations based in** **Europe, and 29% at organizations based in the US.
  • The average respondent has 14.3 years of** experience as an IT professional. 32% had 20 years of experience or more; 68% has 10 years or more. - 33% identify as developers or engineers; 19% as developer team leads; and 17% as software architects. - 80% work at companies that use Java; 75% work at companies that use JavaScript (either client- side, server-side, or both); 44% work at companies that use Python.

AS TIME GOES BY

Interest in working directly with IoT projects still revolves largely around hobby or personal development. 31% of respondents to our 2017 IoT survey said they have worked on one or more IoT projects before, showing little-to-no change from last year’s 30%, but another 62% of respondents, while they have not worked on IoT in the past, are interested in trying it out in the future. Of this 93% of survey respondents, 63% are interested in IoT for hobby or personal development, well ahead of the 48% interested in working on IoT projects in their organization, or the 36% interested in creating consumer products. However, the recognition of the significance of IoT within respondents’ organizations has increased since last year’s survey. This year, 65% of respondents believe that IoT is currently relevent in their organization, as opposed to 43% last year, and while last year almost one in four respondents did not think IoT would be relevent to their business in the future (24%), this year that ratio dropped to about one in ten (11%).

Challenges experienced while developing for the Internet of Things are shifting along with the technologies used

Key

Research

Findings

! How would you describe your relationship with IoT?! In which contexts are you interested in IoT?

62

31

2

I have not worked on any IoT projects in the past, but I am interested in working on IoT in the future

I have worked on IoT projects in the past, and I am interested in working on more in the future I have not worked on any IoT projects in the past, and I am not interested in working on IoT in the future

I have worked on IoT projects in the past, but I am not interested in working on more in the future (^) 0

20

40

60

80

63

31

36 30

48

Hobby/Personal Development

Building a Startup

Making Consumer Products

Making Industrial Products

IoT-Related Projects in My Company

DZONE’S GUIDE TO IoT: APPLICATIONS, PROTOCOLS, AND BEST PRACTICES

in the IoT technology stack. Unpredictable physical environments remain the number one challenge IoT developers face, with 45% of respondents experiencing that difficulty (compared to 48% last year). But concerns about device reliability have dropped 5% from last year, from 46% to 41%, now overtaken by power constraints (40% in 2016, 44% in 2017) as an IoT challenge. Device addressing and discovery dropped from 39% in 2016 to 31% in 2017, while there were increases in challenges with latency (35% in 2016, 39% in 2017) and the volume of unprocessed data (25% in 2016, 34% in 2017).

A BOARD BY ANY OTHER NAME

There are hundreds of single-board computers to choose from that can be used for a vast array of IoT projects, but by far the most popular boards among our IoT survey respondents were the Raspberry Pi (53%) and Arduino (28%) boards (note: our survey did not specify particular models of these boards, e.g. the Raspberry Pi 3 or Arduino Uno), but roughly half of respondents who said they own one of these boards (56% for Raspberry Pi, 51% for Arduino) also said they have not worked on IoT projects in the past. Arduino owners, however, are 5% more likely to be interested in hobby/personal IoT development than Raspberry Pi owners (71% vs. 66%). Arduino was also the most frequently mentioned technology when we asked respondents with IoT experience what they had developed on or for in the past, and outside of “smart home automation” and “drone” technology, Arduino and Rasberry Pi were the most mentioned IoT technologies respondents were interested in adopting within the next 6 months.

PROTOCOL POPULARITY

The relatively low number of respondents who have actually developed for the Internet of Things directly impacted usage numbers seen for IoT-related protocols. Even the most popularly used protocols — Bluetooth LE and Wi-Fi Direct — were used by only a minority of respondents. 14% of respondents said they have used Wi-Fi Direct in production, and 8% said they had used Bluetooth LE; for non-production environments, 24% had used Wi-Fi Direct and 23% had used Bluetooth LE. Protocols 6LoWPAN and CoAP were completely unknown to 71% and 70% of respondents, respectively. Looking at protocol usage for respondents who have developed for IoT before showed some protocol favorites: Wi-Fi direct was a particularly popular production protocol for respondents who had worked on drone projects and those who worked on environmental IoT projects, with 35% and 34%, respectively, using this protocol in production. MQTT was favored in production among respondents who had worked on geofencing projects and smart grid/city projects, garnering 33% and 32% for usage in production, respectively — much higher than MQTT’s 10% overall average for the survey. Respondents working on geofencing projects also used AMQP heavily, with 33% of projects using the protocol in production, compared to AMQP’s 14% overall survey average.

! Which of the following challenges have you encountered while developing IoT applications?

! What task(s) are you likely to perform while developing an IoT product?

44 39

41

45

34

25

0

20

40

60

31

Power Constraints Latency

Device Unreliability High Volume of Unprocessed Data Unreliable Data

Unpredictable Physical Environment

Device Addressing/ Discovery

0 20 40 60 80 100

88 Write Application Code

78 Design APIs

47 ETL and Data Integration

28 Program Microcontrollers Directly

22 Build and Maintain Networks

11 Build CPUs, Boards, Peripherals

DZONE’S GUIDE TO IoT: APPLICATIONS, PROTOCOLS, AND BEST PRACTICES

DZONE’S GUIDE TO THE DZONE GUIDE TO IoT: APPLICATIONS, PROTOCOLS, AND BEST PRACTICES

There are a seemingly unlimited number of wireless connectivity options for you to connect anything and everything to your IoT platform. Trying to wade through an ever-changing technology landscape can be very difficult but there are two significant technologies that have been through a lot of work to be fine-tuned for the IoT; Low-Power Wide-Area Networks (LPWANs) in Cellular and unlicensed bands and Long-Range Local Area Networks (LR-LANs) with advancements in Bluetooth and Wi-Fi. Typically, you will be forced to make a compromise in your technology decisions, but with all the options available do you really need to?

IOT BY 3GPP The 3 rd^ Generation Partnership Project, 3GPP, has put work into the last few user equipment specification releases to better enable IoT connectivity. Release 8 included LTE CAT-1, which enables a solid 3G replacement technology and is great for applications that need to be always on or require low latency. LTE CAT-M1 offers a reduced complexity transceiver that enables a lower cost design and power saving features to enable battery operation. M1 only requires a single antenna, which further reduces system costs. Most Mobile carriers have or will soon begin implementing M across their global networks.

UNLICENSED BANDS

Technologies like LoRa, Sigfox, and others are utilizing unlicensed bands in each region to enable Low-Power Wide Area Networks, or LPWAN. These technologies enable long range connections from a central base station, similar to Cellular networks. LoRa operates in the 10s of kbits/ second, while Sigfox is designed for very small packets of data (12 bits).

THE LAST FEW METERS With the ratification of Bluetooth v5.0 late in 2016, the Bluetooth SIG took a big step toward supporting more of the IoT. This latest version supports up to double the speed and up to four times the range of previous versions. These enhancements broaden the scope for Bluetooth significantly, and enable many phones and tablets to become a ubiquitous gateway. With mesh capabilities in the works for a future version release, Bluetooth becomes a promising and capable IoT connectivity option. The Wi-Fi alliance isn’t keeping quiet either, with the introduction of Wi-Fi HaLow in 2016 the 802.11 crowd now has a technology for long-range, low- power connectivity as well.

As the industry ramps up its focus on IoT connectivity, we now have technologies designed for the IoT, rather than form-fitting existing hardware for our needs. Prices are lower, integration is higher, and the future is bright for the IoT.

WRITTEN BY JOSH MICKOLIO

PRODUCT MANAGER, DIGI-KEY ELECTRONICS

LPWAN and

LR-LAN’s for the IoT

S P O N S O R E D O P I N I O N

NRF52840 Bluetooth 5 development kit from Nordic Semiconductor.

BT5.0 offers extended range and higher throughput.

Bluetooth 5 Dev Kit By Digi-Key Electronics

CASE STUDY

Nordic’s NRF52840 introduces features to enhance a connected experience such as pairing with two or more devices simultaneously, increased range and higher data transfer speeds. With the advertising packet size extension the NRF52840 allows greater connection-less communication capabilities. Applications that can benefit are location services and IoT connectivity, the data can be sent in the advertising packet rather than having to setup a Bluetooth connection. All of these features enable prolonged battery life and major functionality upgrades not only for cell phones, for any device you want to connect.

WHAT’S INCLUDED?

- SEGGER J-Link Debugger on-board - Arduino form factor I/O - NFC-A Listen Mode supported, NFC Antenna included - mbed™ enabled

CATEGORY Hardware Development NEW RELEASES Yes OPEN SOURCE Yes

WEBSITE www.digikey.com (^) TWITTER @digikey BLOG digikey.com/NRF52840-PDK

DZONE’S GUIDE TO IoT: APPLICATIONS, PROTOCOLS, AND BEST PRACTICES

Consensual IoT is the application of the idea of

consensual software to the Internet of Things.

Consensual IoT means that all IoT providers need

to respect and take all measures in their power

to protect users’ privacy and safety. They need

to explicitly ask for consent when in doubt. They

need to care not only about the safety of devices

and the physical environments around them but

also the safety of personal and location data.

CONSENSUAL SOFTWARE

According to Danielle Leong from GitHub’s Community & Safety Team, the term “consensual software” means getting explicit consent from users to interact with them and to disclose their personal data.

Assuming users’ consent to expose data or have them unwillingly participate in certain interactions must be actively discouraged not only because of the security risks, but also to ensure users are in control of their interactions with the software. On top of that, data exposure leaves the door wide open to abuse (for example, it used to be possible to add GitHub users to a repository without their explicit permission, so users could end up listed as contributors of repositories with racist names without there having been any action on their side).

Leong stresses the need to have meaningful discussions about consent and security in design phases. Thinking

about user wants, requesting explicit permissions (opt- in by default, not opt-out) to interact with them, and keeping audit trails are all crucial for building trust and safety in the software.

Trust will sustain the exponential growth of IoT. But fixing today’s frequent hacking and manipulation of devices won’t be enough. We need to aim for consensual IoT to (re)gain users’ trust.

Specifically, trust in IoT requires safe device data storage, secure data transmission, secure data center data storage, and controlled access to devices and third-party integrations.

WHY IoT SECURITY IS NOT THERE YET IoT security is difficult to implement due to the amount of factors to address. IoT backends require the same security as any web system, but we also need to care about the physical security of devices and the security of the networks they are connected to. However, the technical challenges are generally not hard to solve.

Although we might be tempted to point out negligence, the real reason why those challenges are not addressed is the lack of a coherent business model, as highlighted by Alasdair Allan during his QCon London 2017 keynote on “Security War Stories: The Battle for the Internet of Things.” When the financial value for IoT providers resides in selling the device, the incentive to deploy secure software is missing. Functional and “plug-and- play” are the differentiators today, not configurability and security.

Privacy and

Consensual IoT

BY MANUEL PAIS

DEVOPS CONSULTANT AND EDITOR, SKELTON THATCHER CONSULTING LTD

Explicit consent for data and interactions is important in all software

Strong IoT security is a key enabler of consensual IoT

Key capabilities to face IoT challenges and enable consensual IoT include configurability, testability, operability, and releasability

Q U I C K V I E W

DZONE’S GUIDE TO IoT: APPLICATIONS, PROTOCOLS, AND BEST PRACTICES

IoT testing to ensure data is secure and not exposed to attacks and to exercise device configurability, ensuring users have correct and sufficient control over how their data is being used.

The difficulty for IoT is mimicking the connectivity with external actors. In our test labs, we need to go for the lowest security denominator. This means, for example, assuming our device will connect to insecure wireless networks, or that an attacker can connect to the device via Bluetooth or even gain physical access to USB or other ports!

A good test pipeline needs to cover what’s “inside” the system border (for example, functional tests of the software running in the device or performance tests on the backend) as well as interactions with what’s “outside” our control (e.g. other devices in the same network or third parties that the device is sending data to). We need things like test rigs and digital twins in order to do this. But above all, we need proactive and continuous IoT testing skills.

We also need to test for operability, making sure our logging and monitoring works. Beware that this is a never-ending work in progress. As we face new issues in operation, we realize what pieces were missing in our logs and dashboards and amend and re-test them.

OPERABILITY

We live surrounded by complex sociotechnical systems. Forward-thinking organizations acknowledge that they can’t possibly pinpoint, much less test every possible failure scenario. That’s why they increasingly focus on operability (like centralized logging, event tracing using correlation IDs, and monitoring) of modern systems and actively invest in cultural acceptance of failures as sources of learning (post-mortems, blameless culture, and shift-right testing).

IoT adds even more complexity; thus, we need to apply the same ideas to allow quick diagnosis and recovery from incidents.

We need to actively explore potential failure modes of our software , both standalone and in interaction with other systems. Attackers will explore them if we don’t do it first.

In the worst-case scenario, where we fail to prevent data from being leaked or abused, we need to be able to quickly identify which interactions took place before and after the incident, look for deviations in usage patterns, and learn how could we have identified the problem earlier.

In short, minimize exposure as much as possible, but be prepared for abuse to happen and have the mechanisms in place to identify and diagnose them quickly.

RELEASABILITY

It’s not enough to identify and diagnose incidents. We also need to be able to take swift action. Often, fixing the problem requires a change in the software running on the device.

It might be a one-line change as in the energy meter example (stop sending location data) or it could be a more complex change requiring backend modifications (imagine that the energy provider was tracking customers’ consumption based on meter location, not on a customer ID).

Regardless of the change size, being able to deploy frequently, quickly, and reliably is fundamental for IoT , either to fix a problem or to provide more control to users over their data and device interactions.

Modern mobile and web systems rely on Continuous Delivery techniques (such as deployment pipelines or canary releases) to test changes at multiple stages, from source control to a subset of instances running in production to a full rollout to the entire live environment. If a change fails to produce the expected results in production, it should be straightforward to redeploy the previous good version from an artifact repository.

CONCLUSION

Consensual software should be the norm in today’s world, including in IoT. We need strong security in place as a key enabler of consensual IoT. We also need strong capabilities to make our IoT systems configurable, testable, operable, and releasable.

There’s a wealth of techniques stemming from the Continuous Delivery and DevOps movements that we can apply when developing and operating IoT systems. Unfortunately, incentives for all the above won’t be there until IoT moves to a service-driven business model.

Manuel Pais is a team-first technologist at Skelton Thatcher Consulting. DevOps advocate with a diverse background as developer, build manager, and QA lead. Manuel enjoys helping organizations adopt test automation, Continuous Delivery, and cloud, from both technical and human perspectives. Co-author of the books “Team Topologies” and “Team Guide to Software Releasability.” Also InfoQ DevOps lead editor and co-organizer of DevOps Lisbon meetup. Tweets @manupaisable, blogs at skeltonthatcher.com.

DZONE’S GUIDE TO IoT: APPLICATIONS, PROTOCOLS, AND BEST PRACTICES

The Internet of Things will bring great benefits to

the manufacturing industry, and the use of sensors

will greatly improve the quality and speed of the

production process. Just think about the possibility

of smart production systems with the power to

make data-informed decisions and take corrective

actions to avoid damaging components they are

building or even the systems themselves. There are

several scenarios where there is the need to monitor

a process and send an alert every time a problem

occurs during this process. Monitoring systems

and sensors will help with solving these problems,

and that’s exactly what I plan to talk about here.

This article assumes some familiarity with Arduino

hardware and modules.

For instance, we may want to monitor the alignment of some component during a manufacturing process. Moreover, let’s say the IoT system we are building must be able to detect the acceleration or deceleration of this component. These aspects have a great importance in the overall process quality. A scenario where we can apply this monitoring system might include a component that moves from one machine to another during the production process. In this context, we are interested in monitoring its position—or even better, its alignment—and the forces acting on it.

Moreover, what if we want to send an alert as soon as something happens to the production machinery or the component that the machine is working on accelerates or decelerates on its way through a manufacturing process? In

order to achieve this, the IoT monitoring system will need to be integrated with an IoT cloud platform so that we can, for example, send a short message to a user’s mobile phone.

For the sake of simplicity, let’s suppose that a sensor is attached to the component we want to monitor. This sensor detects all the movement and angle or alignment of the component during the manufacturing process. It exchanges data with an Arduino that monitors the data returned by the sensor. If this date hits a certain a threshold, the IoT board sends an alert message using Twilio and TheThings.io. The picture below shows the project overview:

COMPONENT

PROCESS

ALERT

MESSAGE

SENSOR

BUILDING THE PROJECT

In order to build this project we need:

  • Arduino Uno (or compatible board)
  • MPU 6050
  • TheThings.io
  • Twillio account

MPU 6050 is a 6-axis (Gyro + Accelerometer) sensor with a built-in motion tracking system. In more details,

An Overview of IoT

Monitoring Systems

BY FRANCESCO AZZOLA

IT ARCHITECT

The Internet of Things will bring great benefits to the manufacturing sector, and the use of sensors can greatly improve the quality of the production process.

This project demonstrates how by using an IoT development board and sensors, it is possible to monitor a production process with a few development steps.

We can think about smart production systems that can decide to take corrective actions to avoid damaging the system itself or the component they are building.

01

02

03

Q U I C K V I E W

DZONE’S GUIDE TO IoT: APPLICATIONS, PROTOCOLS, AND BEST PRACTICES

values (stored in another variable). If the difference is bigger than the delta, we trigger the notification event.

  1. Using the same process, we can calculate the acceleration/ deceleration of a component through an assembly line.

BUILDING THE NOTIFICATION SYSTEM

Once, we have built the system that detects the motion and alignment we can focus on the notification part. As you may already know, Twilio is a platform that sends short messages. The first step is creating an account. Once the account is ready, you can access your dashboard and get information about your API credentials:

Your account SID and your AUTH Token is what you should be looking for because we will use them with TheThings.io. Before sending a short message, it is important that you create a virtual phone number which supports SMS features.

Here is how you can get a sender number:

You can configure your phone number here:

NOTE: for this example, we only used the free account to avoid paying any subscription fees. Now we have all the information needed to configure TheThings.io. The first step is creating a new product:

Next:

Once you have configured your sensor you have to activate it in order to send data. TheThings.io provides a simple sketch in order to activate your board. Remember to install the TheThings.io library before running the sketch.

The next step is creating a trigger:

A trigger monitors a variable that our IoT board sends to the TheThings.io platform. When the value of this variable goes over a certain threshold, the platform runs a script. In this context, when the deltas are over the threshold we have defined, we send a variable with a fixed value to the TheThings.io so that the trigger is fired. To implement this trigger, you can refer to this tutorial that describes step-by- step how to invoke Twilio.

Upon defining your threshold values for the delta acceleration and the delta angles, you can test the sketch. The delta is the difference between the two consecutive values. Run the sketch and then rotate the sensor. You will notice that you will receive a short message as soon as the delta retrieved from the sensor is over the threshold you have defined.

Francesco Azzola is an electronic engineer with over 15 years of experience in computer programming. He is SCEA, SCWCD, and SCJP certified. He loves creating IoT projects using Arduino, Raspberry Pi, Android, and other platforms. He is interested on the convergence between IoT and the mobile applications. You can read more from Francesco on Android and IoT at survivingwithandroid.com or on DZone.

DZONE’S GUIDE TO IoT: APPLICATIONS, PROTOCOLS, AND BEST PRACTICES

In the last two decades, the advancement of

computation technology has produced more

powerful processors, storage, memory, and

networking devices for low prices. Eventually,

many physical things will be embedded

with more computation capabilities and

interconnected via the Internet in a cost-

effective manner. The widespread adoption of

IoT technologies enriches the idea of ubiquitous

computing that Mark Weiser came up with in

1988 — that is, bringing computation into the

physical world and making effective use of

computer technologies.

UBIQUITOUS COMPUTING

Mark Weiser defined ubiquitous computing as “the method of enhancing computer use by making many computers available throughout the physical environment but making them effectively invisible to the user.” This definition highlights the following main properties:

  • Pervasive computers: The technology that makes computation capabilities available throughout our physical environment.
  • Invisible computers: Ubiquitous computing enables many computation capabilities throughout the physical environment, but makes them invisible to the user.
  • Enhanced computers: The objective of ubiquitous

computing is to enhance computer usage with the following characteristics:

− Expand human consciousness: Many physical things can be embedded with computation features that expand users’ consciousness. For example, smart homes automatically control electricity. Refrigerators inform you if an item is out of stock.

− Make context-aware and responsive environments: Ubiquitous computing enhances physical things with a new dimension of features without affecting the context of the actual usage. It enables other interconnected things to know the user’s current context so that the devices respond in a way that improves the overall activities of the user.

Altogether, ubiquitous computing improves the performance of human activities by moving technology into the background, which allows users to focus only on their natural activities towards the world. The technology drives users’ tasks in an optimized manner in the background.

ANALYSIS OF EXISTING IoT TECHNOLOGY There are many research and commercial IoT products available today; for example, smart wearables, homes, cities, factories, etc. A few common factors are apparent in existing IoT technology. A lack of standardization is a commonly seen concern in most of the ecosystem that

IoT Strengthening

Ubiquitous Computing

BY PRADEEP PEIRIS

SR. SOFTWARE ENGINEER, DIGITAL RIVER WORLD PAYMENTS

Ubiquitous Computing considers taking computer capabilities on ac- tual physical things and encouraging natural human behavior towards the physical world. IoT applications today follow the idea of virtualizing the devices on the Cloud, which is not scalable for the expected growth of IoT in upcoming years. The requirements for the next generation of IoT and Ubiquitous Computing are the need for stan- dard middleware and application protocols. An IoT platform with peer-to- peer middleware protocols and appli- cation protocols as multi-agents would help achieve the concept of Ubiquitous Computing.

01

02

03

04

Q U I C K V I E W

DZONE’S GUIDE TO IoT: APPLICATIONS, PROTOCOLS, AND BEST PRACTICES

MULTI-AGENT SYSTEMS

Michael Wooldridge defines an agent as “a computer system that is situated in some environment, and is capable of autonomous action in this environment in order to meet its delegated objectives.” An agent delegates its objectives toward the environment, and becomes intelligent with the following properties:

  • Reactivity: Intelligent agents are able to perceive their environment and respond in a timely fashion to the changes that occur in it order to satisfy their design objectives.
  • Proactiveness: Intelligent agents are able to exhibit goal-directed behavior by taking the initiative in order to satisfy their design objectives.
  • Social ability: Intelligent agents are capable of interacting with other agents in order to satisfy their design objectives.

A multi-agent system arises when multiple intelligent agents cooperate in a single environment. Like humans, intelligent agents are expected to communicate with each other and reach agreements in achieving their design objectives.

Agents can be designed to perceive information from sensors and to decide actions internally to take toward effectors or actuators. With a P2P middleware protocol, the agents are no longer limited to particular sensors or actuators. Figure 2 depicts how an agent’s view can be adapted to modern IoT applications.

ENVIRONMENT OF IoT

P2P MIDDLEWARE PROTOCOL

FEEDBACK

ACTIONS

AUTOMATED DECISION MAKING

Figure 2. Agents are open for many sensors or actuators over the P2P middleware protocol

SUMMARY

The following figure summarizes all the key aspects discussed previously for having a standard IoT platform.

As it presents, the environment will consist of many IoT devices that are supposed to grow rapidly over the next few years. A standard P2P middleware protocol will provide a reliable distributed system model, which is intrinsically scalable over the expected growth of IoT.

P2P (MIDDLEWARE) PROTOCOL ENVIRONMENT OF IoT

MULTI AGENT (APPLICATION) PROTOCOL

AGENT

AGENT AGENT

AGENT

AGENT AGENT

Figure 3. Overview of a next-level IoT platform

An application protocol based on a multi-agent system will allow for the implementation of autonomous applications capable of communication, cooperation, and negotiation with each other. Unlike general applications, agents are designed with goals to be fulfilled on behalf of their users — that is, agents will take necessary actions efficiently towards its environment over a P2P protocol. With a P2P middleware protocol, there are a lot of possibilities to understand the user’s context accurately. The agents will use all this information to make context- aware actions for users.

In this way, we can develop applications (agents) that perceive sensor data from one vendor device and make actions toward actuators from another vendor. The new platform opens many possibilities to produce novel (multi-agent) applications that enrich the idea of ubiquitous computing.

Pradeep Peiris is an experienced Software Engineer/Architect in diverse technologies and business domains. He is passionate about learning new concepts and technologies. Currently, Pradeep resides in Stockholm and works for Digital River World Payments as Senior Software Engineer.

DZONE’S GUIDE TO IoT: APPLICATIONS, PROTOCOLS, AND BEST PRACTICES

Diving Deeper

INTO INTERNET OF THINGS

TOP #IoT TWITTER FEEDS

@AmyxIoT

@adigaskell

@Doug_Laney

@DavidOro

@IoTchannel

@ToriMcClellan

@lornagoulden

@JoeSpeeds

@damian_pike

@theRab

IoT for Smart Cities ieeexplore.ieee.org/document/

IoT-Based Big Data Storage Systems in Cloud

Computing ieeexplore.ieee.org/document/

An IoT-Aware Architecture for Smart Health

Systems ieeexplore.ieee.org/document/

IoT Council theinternetofthings.eu

Postscapes postscapes.com

DataTau theinternetofallthings.com

IoT ZONES

IoT RESEARCH

IoT WEBSITES

IoT dzone.com/iot The Internet of Things (IoT) Zone features all aspects of this multifaceted technology movement. Here you’ll find information related to IoT, including Machine to Machine (M2M), real-time data, fog computing, haptics, open distributed computing, and other hot topics. The IoT Zone goes beyond home automation to include wearables, business-oriented technology, and more.

Big Data dzone.com/bigdata The Big Data/Analytics Zone is a prime resource and community for Big Data professionals of all types. We’re on top of all the best tips and news for Hadoop, R, and data visualization technologies. Not only that, but we also give you advice from data science experts on how to understand and present that data.

Cloud dzone.com/cloud The Cloud Zone covers the host of providers and utilities that make cloud computing possible and push the limits (and savings) with which we can deploy, store, and host applications in a flexible, elastic manner. The Cloud Zone focuses on PaaS, infrastructures, security, scalability, and hosting servers.

TOP IoT REFCARDZ

Getting Started with the Industrial Internet

dzone.com/refcardz/getting-started-with-industrial-internet Introduces basic concepts and technologies of the Industrial Internet, including sensors and actuators, industrial control systems, human-machine interfaces, real-time streaming data, device security, and more.

IoT Applications with Java and Raspberry Pi

dzone.com/refcardz/iot-applications-with-java-and-raspberry-pi Covers hardware setup, Raspbian installation, and general-purpose I/O (GPIO) via two Java libraries. So where will your next project take you – a self-driving car, a portable gaming console, or...?

Getting Started With MQTT: A Protocol for the IoT

dzone.com/refcardz/getting-started-with-mqtt HTTP is too heavyweight for IoT devices, and request-response isn’t responsive enough. Learn MQTT instead. Refcard includes message types, QoS levels, client libraries, and security.

DZONE’S GUIDE TO IoT: APPLICATIONS, PROTOCOLS, AND BEST PRACTICES

When mentioning connected devices these

days, we immediately think about the cutting

edge. A refrigerator that can order more eggs

when you’ve just run out, or a speaker that gets

pizza to your door by just asking it to. The more

common ones are the smart watches, activity

trackers, smart light bulbs, and so on.

The western world is literally swarmed by

connected devices, but the most important one

is the smartphone. Packed with state of the art

sensors, each one of them benefits from the

always-on connectivity of their host device. But

that’s not all, your car’s Bluetooth entertainment

system is a connected device, and every single

Wi-Fi router you are connected to is a device

that can indicate something about your daily

routine.

IoT can be described as a data flow. For example, the data flow is from a controller (mostly a smartphone, but can be a sensor like a volume sensor) to a device (light bulb) is “smart” only because it can respond to commands sent through the network instead of an analog switch. Another example is the movement from an activity tracker sensor to your phone, where the “smart” part is the way this data is displayed on the dedicated app for that tracker.

Providing these bare minimum data flows is not what should be considered “smart”, they are just new interfaces which provide just a little less friction for the underactive among us. Combining data flows and making sure they are interconnected will create a true smart environment around the center of it all: humans.

The base of this human-centered data flow is a network of sensors, but not all sensors were born the same. Let’s compare single- and multi-channel data sensors. Single-channel sensors provide one data input. For example, a thermometer provides the temperature at a point in time; steps counter – cumulative steps in a time range; Glucometer – a person’s sugar level at the time of measurement. The smartphone is a multi-channel device

  • it has dedicated motion sensors like a gyroscope, and inferred motion sensors like the GPS receiver and the cellular tower’s reception level. It has location sensors — a dedicated one (GPS again) and an inferred one, the Wi-Fi antenna. The phone is also equipped with sensors that can detect its surroundings like light sensors, the microphone, camera, and sometimes even a barometer.

This differentiation is key when analyzing data and using it for various IoT-dependent products, because when you’re fighting for your users’ attention, context is king. Approaching them at the right time with the right messaging can change the way they relate to your product.

The smartphone, an always-on, always-connected, and almost always-carried device is the perfect choice for a daily routine descriptor. It goes wherever its owner goes

Context is Key

to Next-Gen IoT

BY YOUVAL VAKNIN

HEAD OF DEVELOPERS’ PROGRAM AT NEURA

IoT is everywhere, and you can use whatever is connected to you even if it’s not the device’s main purpose.

Use data flows wisely. Don’t get caught in the so called “smart” corner where the flip of a switch has been replaced with a button on your device.

Understanding your users’ routine can improve any interaction you have with them.

You don’t need huge infrastructures from the get go, baby steps can be taken even for connected devices.

01

02

03

04

Q U I C K V I E W

DZONE’S GUIDE TO IoT: APPLICATIONS, PROTOCOLS, AND BEST PRACTICES

during the day. Accumulating and aggregating the data from it would reveal amazing insights about the owner’s daily routine.

Looking deeper into the data and finding simple patterns can help realize more complex moments, such as when the user sleeps, when a device is idling for a long period of time, connected to a power supply, and is kept static, and when the user wakes up, the first time the device moves after being idle during the night (relative to the device’s time zone).

The next step would be to try and predict the user’s behavior. If I can identify when the person is asleep every night, I can try and see if something else is happening around that time, such as lights being turned off or an alarm system turned on. Now I know when the user is planning to go to bed. These tiny moments during the day are summed up in an actual image of someone’s daily routine. That image that influences the way we can analyze every new piece of data coming our way. All of this is directly connected to where the user is, which can be discovered by GPS and WiFi routers. An awesome example of a routine of seeing the same SSIDs all the time. For instance, my SSID at home is “It’s a trap!”. I’m always connected to it when I’m there and it can be quickly identified as my home network. This is easy to see, in part, when looking at how many times I’ve connected to that network, for what length of time, as well as how long it took for the device to connect.

While the smartphone helps us focus on the daily routine, it’s time to put single data channels to good use. For example, a connected thermometer indicates an elevated temperature of 38 degrees C/100F, which might translate to a health condition, but the daily routine of the person would show that they were outside all day, walking and running, and it was a hot day according to the weather conditions in that location. Instead of prompting the user to make a doctor’s appointment, the wellness app would suggest moving away from the sun and drinking some water. Messaging is provided with context to the real situation of the user.

And it can get more interesting. Connected devices can improve otherwise limited lifestyles and help make them as active as they can be. People with type 1 diabetes are constantly struggling with their sugar levels, from the discomfort of the hyperglycemia to the life-threatening hypoglycemia. When a person with diabetes finishes an exercise, he or she is probably in some level of hypo, and driving in that state might be dangerous. By understanding the current situation, with their fitness device connected to an Android Automobile, the diabetes app provides immediate advice to eat some fruit and make sure their glucose levels are suitable for the needed concentration levels for that activity.

Implementations are not only medical. What is a “Smart Home”? It should be a home where connected appliances are reacting to you. The smartphone identified that you arrived home? Turn the lights on, open the blinds, let the connected speaker let you know that the water heater made sure you can take a shower now. Your surroundings respond to you with minimal activity. All of this can be achieved by making sure your current “smart” devices are switched on by an event, in this case arriving home, rather than a finger tap.

In the world of content, demographics are the center of everything. Understanding the person’s location (Geography), age, and gender are considered keys to delivering the best conversion rate for ads and making sure content will get the most exposure possible. Google (based on searches) and Facebook (based on interactions and likes) are known by using these attributes for better segmentation. But at the end of March, Netflix’s VP of product said “Geography, age, and gender? We put that in the garbage heap”. Instead, they decided to concentrate on taste alone, using the thumbs up and down ratings for each show. It worked very well as a suggestion algorithm but it lacks context, which in this case is “What will I watch today?”. Some viewers will prefer some lightheaded short episodes after a busy day, while others might rather watch a food documentary if their day finished early. All based on their general preferences, but with relation to their daily routine.

Context is the invisible ingredient that turns clumsy interactions to frictionless behavior. And with even a superficial interpretation of data channels around the users, their experience will improve.

I avoided the term “Machine Learning” throughout this article to show that even a huge subject such as that can be approached with baby steps and lean thinking. By utilizing Wi-Fi, which is everywhere, GPS data, and motion sensors that are available on every smartphone out there, data can be input to a simple condition clause that can later grow into more complex decision trees and pattern matching. Eventually, to make the most out of the data provided, complex algorithms would be the next logical step. Huge leaps can be achieved by using the basic input from the data around us to actual actions right here, right now.

After more than 15 years of software development experience ranging from image processing using MATLAB and C++, security and authentication, digital health, and iOS development, Youval Vaknin is focused on making Neura’s mobile SDK for AI-as-a-service a streamlined product for developers. As Head of Developers’ Program, Youval engages developers, creates tools and samples for them to use, and learns what their limitations are when using this product.