Using an open source IIoT gateway to speed Modbus device integration

Industrial internet of things (IIoT) applications typically require an edge gateway to integrate Modbus peripherals and other devices, but implementing a gateway can be costly and time consuming. An open source edge computing framework can significantly simplify deployment.

Industrial Internet of Things (IIoT) refers to interconnected devices, sensors and actuators networked together with industrial infrastructure and applications including manufacturing, transportation, energy, retail, healthcare and supply chain management. This connectivity allows for data collection, exchange, and analysis, potentially facilitating improvements in productivity and efficiency as well as other economic benefits. Edge computing emerged in response to the rise of industrial IoT applications. In edge computing, data is processed by the device itself or by a local computer or server, rather than being transmitted to a data center.

In industrial use cases, where a number of sensors need to be interfaced with edge gateways, solution architects and developers need to decide on software design and development of edge gateways; how to process data from various sensors; and how to perform data analytics during design and development phase. In such situations, if there is no open source framework, the new software development and bug fixes may consume a lot of effort and cost. These problems can be mitigated by using open source edge computing frameworks to develop edge gateway software during development phase. EdgeX Foundry is an open source edge computing framework that can be used in software development of an edge gateway, reducing latency and cost. Modbus is an open protocol used extensively in industrial systems and with the emergence of edge computing requirements, the ability to interface Modbus peripherals to an edge computing system is important. 

This two-part series describes EdgeX Foundry based edge gateway design and developing applications for edge computing functionalities. This first article describes industrial sensors with use cases and provides an overview of an edge gateway requirements along with a discussion about how EdgeX addresses edge gateway requirements.

Industrial Sensors Overview

In industrial automation, sensors and actuators play a crucial role in any intellectual products. Sensor let us to detect, analyze and process a variety of transformations. Actuators receive signals from sensors and perform actions based on an input.

Some of the sensors used in industries are temperature and humidity sensors, pressure sensors, proximity sensors, gas and chemical sensors, and others. Some of the use cases for these sensors include the following:

  • Temperature plays a key role in defining an integrity of biological samples. If the samples are not kept under strict temperature control, they will become useless and affect experimental conclusions or even worse, the patient’s health. The hospital’s IT system administrator can install temperature sensors to monitor the temperature in laboratories and clinics around the clock.
  • Some products are sensitive to humidity and temperature. Storing such products in a normal warehouse can result in their corrosion and thus need to be stored in a climate-controlled environment. The warehouse manager can place sensors to monitor the warehouse environment constantly.
  • Pressure sensors are used to sense the pressure changes in gases and liquids. The water pressure sensors can be fitted to the top of an open-ended tube submerged within the container and used to measure the level of water in a tank, or the rate of change in water level all the time.

In real-time industrial environments, the device to device communications, a one-way or two-way communications between devices occur systematically. Depending on the equipment manufacturer, a proprietary or open source protocol is used.  Many manufacturers adapt the open protocols to adapt to easily integrate their product in market. One of the most common automation communication protocol connecting industrial electronic devices and SCADA (Supervisory Control and Data Acquisition) is Modbus.

The advantage of Modbus protocol is that supports multiple manufacturer, software vendors, service organizations and has active community groups for support. Several versions of the Modbus protocol exist for the serial port and Ethernet and the most common are Modbus RTU, Modbus ASCII, Modbus TCP and Modbus Plus. It communicates over several types of physical media such as serial RS-232, RS-485, RS-422 and over Ethernet and able to support both peer-to-peer and multi-drop networks. With Modbus TCP/IP over Ethernet, Modbus and other types of mixed protocols can co-exist through the same physical interface at the same time. These features motivate the industries and users to opt the Modbus protocol supported sensors.

Edge Gateway Overview

Device Connectivity

A key requirement of an edge gateway is to enable connectivity with the sensors and actuators. There are many industry protocols that facilitate different methods of device communication. An edge solution should support the most common industrial protocols such as ZigBee, Bluetooth LE, BACnet, Modbus and Siemens S7.

Data Analytics and Rules Engine

Data can be computed locally with the gateway’s ability to run applications locally. Artificial intelligence services can locally process data coming from downstream devices, react to insights locally and send a subset of data to the cloud. Creation of rules is also an important one.

Data Storage

In addition to local processing, a gateway should have the ability to store data locally. This is key to allowing a gateway to run autonomously. The combination of local computation and local storage should allow the gateway to operate in an offline mode also.


Connected devices and applications running on an edge gateway should provide interoperability across other products or systems.


The data may need to be exchanged across different modules in an edge gateway, such modules and devices need to authenticate their connections to each other and hence security needs to be integrated into the edge solution. An edge solution should allow for permission-based access control, secure encrypted communication, certificate management and integration into existing security solutions.

Device Management

Edge gateways require a way to remotely manage and access each individual gateway. The remote management features should allow operators to remotely start, stop, configure, and update a gateway and the devices attached to it.

Cloud Connectivity

The connectivity between edge gateway and cloud system is an essential one. It may help in logging accurate data for deep analysis and transferring the collected data to other applications on demand.


The software for an edge solution should be portable to different operating systems and hardware platforms. It will help users avoid being locked into a specific vendor’s hardware and software solution.

EdgeX Foundry

Why open source rather than development?

Developing a new software framework will consume a lot of time, efforts and cost. It requires most time for each and every stage such as design, development and testing. EdgeX Foundry is an open source edge computing framework that already provides all micro services required for an edge gateway serviceability. This framework runs loosely-coupled micro services, and there is no need to run all the services together, so only dependent services need be run. Other services can be used as needed. Because of these benefits, an open source edge computing framework is preferred as the software foundation of the edge gateway.

The EdgeX Foundry project has been launched under the Linux Foundation. It is an open, interoperable platform for the IoT edge. The framework is structured in different layers, each one composed of multiple micro services. The modular architecture allows users to easily scale, update and distribute the logic into different systems, improving maintainability.

EdgeX is compatible with Windows, macOS and Linux systems. This platform architecture is designed in a way that any techie can learn it in short span of time, implement and contribute on their own.

EdgeX speeds time to market for complete edge solutions and/or edge SW/HW offerings by providing replaceable reference services for device-data ingestion, normalization, edge intelligence (AI/ML) and sharing support to new IoT data services and advanced edge computing applications.

EdgeX has already implemented in products such as EdgeXpert, EdgeXRT, HP Engage Edge, EdgeBox, and Dell gateways. EdgeX framework’s use in these many products further builds trust for use in other edge gateways.

How EdgeX address edge gateway requirements?

EdgeX Foundry is an open source, vendor neutral software platform that serves as edge middleware between physical sensing and actuating “things” and an information technology (IT) system.

Figure 1. EdgeX Foundry (Source:

Data Storage – Redis DB

EdgeX provides open source Redis as a database by default. Redis provides a different range of persistence options such as RDB, AOF. It is an in-memory data structure used to store and forward. This helps in cases of edge devices are switching between connected and disconnected modes.

Data Analytics – Kuiper Rules Engine

EdgeX provides EMQ X Kuiper, a lightweight open source software package for IoT edge analytics and stream processing. Kuiper can run on various resource constrained edge devices. Kuiper rules are based on Source, SQL and Sink.

  • Source: The data source of streaming data, such as data from MQTT broker.
  • SQL: SQL is where you specify the business logic of streaming data processing. Kuiper provides SQL-like statements allows user to extract, filter and transform data.
  • Sink: Sink is used for sending analysis result to a specified target such as MQTT broker, or an HTTP REST address.

The following four steps are required for using Kuiper:

  1. Create a stream where data source need to be specified
  2. Write a SQL/rule for data analysis
  3. Specify a sink target for saving analysis result
  4. Deploy and run rule

Device Connectivity – Device Services

EdgeX provides four loosely-coupled micro services layers. Among them, the device services layer interacts with device services. EdgeX device services translate information coming from devices via hundreds of protocols and thousands of formats and bring them into EdgeX.

Device services are the edge connectors interacting with the devices such as smart home appliances, sensors, actuators and any machines in industries. In addition to getting sensor data and actuating devices, device services also:

  1. Get status updates from devices/sensors
  2. Transform data before sending sensor data to EdgeX
  3. Change configuration
  4. Discover devices

Device services may service one or a number of devices at one time. The device could be an edge/IoT gateway (and all of that gateway’s devices), a device manager, a sensor hub, a web service available over HTTP, or a software sensor that acts as a device, or collection of devices, to EdgeX Foundry.

Inter-operability – MQTT Broker and REST API

EdgeX supports a lightweight MQTT messaging protocol. It enables user to publish or subscribe messaging transport that is ideal for connecting remote devices with a small code footprint and minimal network bandwidth.

EdgeX supports rest device service which provides an easy way for third party applications to push data into EdgeX via the REST protocol.

Security – Security Store and API Gateway

EdgeX provides two key security components. The first is a security store, which is used to provide a safe place to keep the EdgeX secrets such as password, certification and access key. The second is an API gateway, which is used as a reverse proxy to restrict access to EdgeX REST resources and perform access control related works.

Device Management – Device Management APIs

EdgeX provides an option to examine health periodically. The device management APIs used to get metadata about any device.

Cloud Connectivity

EdgeX provides support to connect to cloud platforms such as AWS, Microsoft Azure, and IBM Watson cloud.

The cloud connectivity in EdgeX is give in two ways:

  1. Application Services: These services need to be compiled to deploy for sending data to cloud services such as AWS and Microsoft Azure. It receives data directly from the message bus through which edgex-core-data publishes data events.
  2. Application Service Configurable: It provides a quick way to use configuration rather than compiling services to use build in SDK functions.

The second article will offer a case study of interfacing an industrial sensor with EdgeX for achieving edge computing functionalities.

Vediyappan Villali is a Lead Engineer with HCL Technologies. He is working in developing and testing embedded software products. He is a part of the Embedded Platform Lab COE.
Vijay Annamalaisamy is a Senior Technical Specialist with HCL technologies. He has extensive experience in developing embedded software for products from multiple domains. He is a part of the Embedded Platform Lab COE and has contributed for various projects.
Sathya Durai is a Senior Solutions Architect with HCL technologies. He has extensive experience in playing the architect role for embedded software development for products from multiple domains. He is a part of the Embedded Platform Lab COE and has contributed for various projects.

Related Contents:

For more Embedded, subscribe to Embedded’s weekly email newsletter.

The post Using an open source IIoT gateway to speed Modbus device integration appeared first on

Original article: Using an open source IIoT gateway to speed Modbus device integration
Author: Vediyappan Villali, Vijay Annamalaisamy and Sathya Durai