Reader small image

You're reading from  Industrial Internet Application Development

Product typeBook
Published inSep 2018
Reading LevelIntermediate
PublisherPackt
ISBN-139781788298599
Edition1st Edition
Languages
Tools
Right arrow
Authors (4):
Alena Traukina
Alena Traukina
author image
Alena Traukina

Alena Traukina is IoT practice Lead at Altoros. She has over 12 years of experience in delivery and support of business-critical software applications, working closely with business owners and providing strategic and organizational leadership for software development. Over the years, Elena has served in different capacities, ranging from software engineer to software engineering manager and the head of Altoross Ruby Department. She is also one of the first GE's Predix Influencers.
Read more about Alena Traukina

Jayant Thomas
Jayant Thomas
author image
Jayant Thomas

Jayant Thomas (JT) is the director of software engineering for the IoT apps for GE Digital. He is responsible for building IoT SaaS applications using the Predix platform, and specializes in building microservices-based architecture, reactive, event-driven systems. JT holds a masters in technology from NIIT and MBA in technology from UC Davis, CA, and has 12 patents in the speech language processing, multimodal application, and cloud architectures. When not hacking code, JT spends time with kids and enjoys crossfit training and kickboxing.
Read more about Jayant Thomas

Prashant Tyagi
Prashant Tyagi
author image
Prashant Tyagi

https://www.linkedin.com/mynetwork/invite-connect/connections/ In discussion for Cloud agritech
Read more about Prashant Tyagi

Veera Kishore Reddipalli
Veera Kishore Reddipalli
author image
Veera Kishore Reddipalli

Kishore Reddipalli is a software technical director and expert in building IIoT big data and cloud computing platforms and products at ultra scale. He is passionate about building software for analytics and machine learning to make the authoring of algorithms at scale, from inception to production, a simpler process. He has been a speaker at global conferences on big data technologies. Over the years, he has provided leadership in various capacities. Throughout his career, his roles have ranged from software engineer to director of engineering and architecture for the development of platforms and products in domains such as clinical decision support systems, electronic medical records, Predix Platform, Predix Operations Optimization for IIoT, and etch-process control at nanometer level using big data and machine learning technologies in the semiconductor industry. He holds an MS in computer science from Texas A&M University Corpus Christi.
Read more about Veera Kishore Reddipalli

View More author details
Right arrow

IIoT Edge Development

This chapter describes the process of prototyping a device for beginners. We provide detailed instructions on how to assemble four different prototypes, and how to build and run simple IoT apps for the prototypes, together with sample source code. Finally, we explore the Predix services that can be used to store, analyze, and merge the sensor data from the prototypes.

In this chapter, you will learn about the following topics:

  • Choosing hardware for prototyping
  • The Open Systems Interconnection model and its layers
  • Application-layer protocols—HTTP and WebSocket
  • Industrial M2M protocols—Modbus and OPC UA
  • Assembling a device for a prototype
  • Preparing an SD card for a prototype
  • Building and running simple IoT apps using the HTTP, WebSocket, Modbus, and OPC UA protocols
  • Data management services in Predix
...

Hardware for prototypes

This section overviews the available variety of hardware that can be used for prototyping, and gives some tips on choosing the hardware and a data exchange protocol to ensure communication between the components of a prototype.

Variety and cost

One can find a variety of open source hardware for prototyping—Arduino, Raspberry Pi, Orange Pi, LinkIt, BeagleBone, and Tessel. Most of them are really cheap; you can buy an Orange Pi for just $33. The price usually depends on how powerful the board is and what interfaces it supports.

In addition to a board, it is possible to purchase a starter kit that usually costs about $70. It includes a few sensors, a small display, lamps, cables, and a breadboard...

Application-level protocols – HTTP

In this section, we will try to build a simple IoT application for sending data from a DHT-12 temperature and humidity sensor to a receiver device, using a Raspberry Pi hub and the HTTP protocol:

Data flow from a DHT-12 sensor to a receiver

Offering a variety of usage options, HTTP is one of most popular protocols on the web. Every time you open a website or run a mobile application, it is most likely the HTTP protocol you are using.

In the following table, you can find a more detailed description of the protocol to understand whether it is suitable for your needs:

Key

Value

Open source

Yes

OSI layer

Application

Data types

Text, HTML, script, style, font, JSON, XML, stream, binary

Limitations

Not suitable for large amounts of binary data

Possible operations

Send/receive data

Latency

Low

Usage...

Application-level protocols – WebSocket

In this section, we will try to build a simple IoT app for sending data from an XD-80 light sensor module to a receiver device, using a Raspberry Pi hub and the WebSocket protocol:

Data flow from an XD-80 sensor to a receiver device

WebSocket is most widely used in the case that one needs to enable fast transfer of real-time data. The protocol allows for two-way interaction between a client and a server, and for streaming multiple messages using the same TCP connection, which lowers the communications overhead.

In the following table, you can find a more detailed description of the protocol to understand whether it is suitable for your needs:

Key

Value

Open source

Yes

The OSI layer

Application

Data types

String

Limitations

Not suitable for large amounts of binary data

Possible operations

Send...

Industrial M2M protocols – Modbus

In this section, we will try to build a simple IoT application for sending data from a sensor simulator module to a receiver device (a PC or a cloud), using a Raspberry Pi hub and the Modbus protocol:

Data flow from a sensor simulator to a receiver device

For devices with limited hardware resources, it makes sense to use the Modbus protocol for serial communication. While simple, it has several open and proprietary implementations that vary in functionality.

Note that this protocol can be used on the transport layer, but, in our example, we are going to use Modbus TCP, working on the application level.

In the following table, you can find a more detailed description of the protocol to understand whether it is suitable for your needs:

Key

Value

Open source

Yes*

The OSI layer

Transport or an application

Data types

...

Industrial M2M protocols – OPC UA

In this section, we will try to build a simple IoT app for sending data from a sensor simulator module to a receiver device (a PC or a cloud), using a Raspberry Pi hub and the OPC UA protocol:

Data flow from a sensor simulator to a receiver device

The OPC UA protocol is similar to Modbus, but works with more data types, and has no serious limitations, while providing for security, compression, and low latency.

The protocol was developed by the OPC Foundation as an industrial machine-to-machine communication protocol. OPC UA is an improved version of the Open Platform Communications (OPC) protocol, with one of the major changes being that the new protocol is available free of charge without any restrictions.

In the following table, you can find a more detailed description of the protocol to understand whether it is suitable for your needs...

Data management options in Predix

To ensure storing, analyzing, and merging the sensor data we have collected in our Raspberry Pi hubs, we need to use specialized data management solutions. Predix offers a good selection of services for this purpose, as listed here:

  • Asset
  • Event Hub
  • Time Series
  • Database as a Service
  • Blobstore
  • Message Queue (AMQP)
  • Key-Value Store:
Data management services in the Predix catalog

You can select any of the services, depending on your data type and the operations you need to perform. In particular, for our application that handles time series data, we can use the Time Series storage.

The following subsections describe the data management services offered by Predix (https://www.predix.io/catalog/services/) in more detail, highlighting their features and the purposes for which they are usually used.

...

Summary

In this chapter, we gave tips on choosing hardware and a data exchange protocol for a prototype. We also described how to assemble a prototype with different sensors and build and run four types of applications, one for each of the protocols—HTTP, WebSocket, Modbus, and OPC UA. In addition, we overviewed the Predix services for storing, analyzing, and merging the sensor data from the prototypes.

In the next chapter, you will learn about data management techniques and their implementations for the IIoT stack.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Industrial Internet Application Development
Published in: Sep 2018Publisher: PacktISBN-13: 9781788298599
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Authors (4)

author image
Alena Traukina

Alena Traukina is IoT practice Lead at Altoros. She has over 12 years of experience in delivery and support of business-critical software applications, working closely with business owners and providing strategic and organizational leadership for software development. Over the years, Elena has served in different capacities, ranging from software engineer to software engineering manager and the head of Altoross Ruby Department. She is also one of the first GE's Predix Influencers.
Read more about Alena Traukina

author image
Jayant Thomas

Jayant Thomas (JT) is the director of software engineering for the IoT apps for GE Digital. He is responsible for building IoT SaaS applications using the Predix platform, and specializes in building microservices-based architecture, reactive, event-driven systems. JT holds a masters in technology from NIIT and MBA in technology from UC Davis, CA, and has 12 patents in the speech language processing, multimodal application, and cloud architectures. When not hacking code, JT spends time with kids and enjoys crossfit training and kickboxing.
Read more about Jayant Thomas

author image
Prashant Tyagi

https://www.linkedin.com/mynetwork/invite-connect/connections/ In discussion for Cloud agritech
Read more about Prashant Tyagi

author image
Veera Kishore Reddipalli

Kishore Reddipalli is a software technical director and expert in building IIoT big data and cloud computing platforms and products at ultra scale. He is passionate about building software for analytics and machine learning to make the authoring of algorithms at scale, from inception to production, a simpler process. He has been a speaker at global conferences on big data technologies. Over the years, he has provided leadership in various capacities. Throughout his career, his roles have ranged from software engineer to director of engineering and architecture for the development of platforms and products in domains such as clinical decision support systems, electronic medical records, Predix Platform, Predix Operations Optimization for IIoT, and etch-process control at nanometer level using big data and machine learning technologies in the semiconductor industry. He holds an MS in computer science from Texas A&M University Corpus Christi.
Read more about Veera Kishore Reddipalli