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

Developing Your First Application for IIoT

In this chapter, you will learn about the S95 standard (https://www.isa.org/isa95/) and how it applies to the exchange of asset data. We also provide an overview of databases to store asset data and a comparison of time series storage. Then, we demonstrate how to build a Node.js application that simulates the reading of time series data from sensors and how to enable analytics and visualizations of the data reads. Finally, we provide instructions on configuring Grafana alerts with visualizations, and email and Slack notifications about database values exceeding limits.

This chapter covers the following topics:

  • S95 standard and exchange of asset data according to the S95 standard
  • Choosing a database management system to store asset data
  • Comparison of the most common time series storage
  • Using InfluxDB as a time series storage
  • Building...

Developing and modeling assets using the S95 standard

The S95 standard, otherwise known as ANSI/ISA-95 (and in Europe IEC 62264), was developed by the International Society of Automation (ISA) to provide guidelines on integrating an enterprise system with a control one. The standard is applicable to all industries and all types of processes within them—batch, continuous, and repetitive.

S95 consists of the following parts, describing different aspects of integrating an enterprise control system:

  • ANSI/ISA-95.00.01-2000, Enterprise-Control System Integration, Part 1: Models and Terminology: The document overviews the object models that can help to identify the information to exchange and provides standard terminology
  • ANSI/ISA-95.00.02-2001, Enterprise-Control System Integration, Part 2: Object Model Attributes: This part of the standard relates to the attributes of the objects...

Selecting a storage

Each manufacturing facility contains a huge number of assets, from screwdrivers to machines. To track all of them, observing the S95 requirements, you need a suitable database storing asset data. Available storage options can be subdivided into the following groups.

Relational DBMS

A relational DBMS is a table-oriented store based on the relational model (originally described by Edgar F. Codd). Such databases comprise a number of records (entities), each corresponding to a row in a table. The records (entities) contain attribute values.

Relation schemas within a database table are defined by the table name, a fixed number of attributes, and fixed data types. The schemas are the product of normalization...

Time series storage

When we need to store information describing the operation of assets at certain moments over a period of time (for example, information from asset sensors), the best choice is a time series storage. Currently, there are dozens of such databases to choose from. The table here features a comparison of the most widely used ones:

DalmatinerDB

InfluxDB

Prometheus

Elasticsearch

Graphite (Whisper)

Data types

float62, int56

int64, float64, bool, and string

float64

string, int32, int64, float32, float64, bool, null

float64

Data compression ratio

1

2.2

1.3

22

12

Precision

millisecond

nanosecond

millisecond

millisecond

second

Ingest performance (metrics/sec)

3m

470k

800k

30k

300k

Data source

TCP (binary protocol), OpenTSDB (text), Graphite (text), Prometheus (text), Metrics 2.0 (text), InfluxDB...

Creating instances of assets and adding time series data

In this section, we will build a Node.js application that simulates reading of time series data from sensors. To store the data, we will use the InfluxDB time series database.

For building the application, we will need the following software:

To build a Node.js application that simulates reading of time series data from sensors, proceed as follows:

  1. Create a package.json file, describing software dependencies. If you use a cloud, specify localhost and mydb as the credentials for the host and database accordingly:
{
"name": "timeseries...

Understanding the analytics

Big data analytics aims at revealing patterns, correlations, and providing other valuable insights based on processing of large data quantities. By capturing and analyzing big data—large and varied datasets—businesses can better understand their workflows, customer behavior, market trends, growth opportunities, and so on.

Previously, to take an informed decision, a company would have to first gather data, then analyze it, and integrate it into the decision-making process. The whole cycle could take quite a long time to complete. With big data analytics, businesses can speed it up, which gives them the competitive advantage of being more agile.

It is possible to distinguish the following four types of analytics:

  • Descriptive analytics: It helps you to get a historical overview of events over a given period and prepare the resultant data...

Deploying your first analytics

In this section, we provide a selection of examples, illustrating how to apply some of the InfluxDB analytical functions to process the time series data from sensors collected using the Node.js application we built earlier.

To enable the analytics for the time series data from sensors read with the Node.js application, proceed as follows:

  1. Run a git clone command to copy the source code of the application:
git clone https://github.com/Altoros/iot-book.git
  1. Start the application, running the following command:
docker build -t timeseries  
docker run -p 8080:8080 -it --rm --name timeseries-container timeseries

The return will be as shown in this screenshot:

Console output after starting the Node.js app
  1. Now, you can start querying data with analytical functions. Data will be retrieved, using InfluxQL, which is a SQL-like query language for interacting...

Visualizing time series data and charts

In this section, we describe how to enable visualization of the time series data from sensors collected using the Node.js application we built earlier.

To prepare for visualizing the data from the application, perform the following actions:

  1. Run the following git clone to copy the source code of the application:
git clone https://github.com/Altoros/iot-book.git
  1. To start the application, run the following command:
docker build -t timeseries  
docker run -p 8080:8080 -it --rm --name timeseries-container timeseries

Visualizing time series data with Highcharts

Highcharts is a popular library for representing information in the form of charts and gauges. We will use it to visualize the...

Visualizing the outcomes of the analytics as alerts

This section outlines the procedure for setting up the notifications about database values exceeding preset limits. Such notifications can be received in one of the following ways—by email or via a Slack channel. Additionally, you can configure alerts in Grafana.

Configuring email notifications

To configure email notifications, proceed as follows:

  • Specify the credentials (email address, host) of the SMTP server
  • Change the alertFrom value in the index.js file to a required limit value

Once you have completed this configuration, you will start getting emails, whenever some of the values exceed a specified limit:

An alert displayed in a mail client
...

Summary

In this chapter, we looked into how the S95 standard addresses asset modeling and exchange of asset data between different levels of an enterprise control system. Then, we overviewed the existing database management systems (including blockchain) with a focus on the data types they can store. Furthermore, we compared the most widely used time series storage.

We provided a detailed instruction and a sample code to build a Node.js application that simulates reading of time series measurements. Touching upon different types of analytics, we highlighted the analytical functions of the InfluxDB database. Then, we demonstrated how to enable descriptive analytics with InfluxDB for the Node.js app we had previously built. In addition, we showed how to set up time series visualizations with Highcharts and Grafana and to configure email and Slack notifications and alerts from Grafana...

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