1. Cirrus Link Documentation...3 /opt/jdk1.8.0_66/bin/java 4 /opt/jdk1.8.0_72/bin/java Enter to keep...

81
1. Cirrus Link Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.1 Chariot SCADA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.2 Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.2.1 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.2.1.1 Java Runtime Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.2.1.2 Ignition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.2.1.3 MQTT Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.2.1.4 Demo Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1.2.1.5 Sparkplug Sample Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1.2.2 MQTT Module Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1.2.2.1 MQTT Distributor Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.2.2.2 MQTT Engine Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.2.2.3 MQTT Injector Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 1.2.2.4 MQTT Transmission Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 1.3 Tutorials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 1.3.1 Simulating Live Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 1.3.2 Sparkplug Device Emulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 1.3.2.1 Standalone C Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 1.3.2.2 Standalone Java Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 1.3.2.3 Standalone JavaScript Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 1.3.2.4 Standalone Node-RED application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 1.3.2.5 Standalone Python Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 1.3.3 Sparkplug on Raspberry Pi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 1.3.3.1 Raspberry Pi Java Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 1.3.3.2 Raspberry Pi Python Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 1.3.4 Transmission Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 1.3.4.1 Sending OPC Tag Data with Transmission . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 1.3.5 Adding TLS Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 1.3.6 Installing Chariot MQTT Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 1.4 Ignition MQTT Module Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 1.4.1 MQTT Distributor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 1.4.2 MQTT Engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 1.4.3 MQTT Injector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 1.4.4 MQTT Transmission . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81

Transcript of 1. Cirrus Link Documentation...3 /opt/jdk1.8.0_66/bin/java 4 /opt/jdk1.8.0_72/bin/java Enter to keep...

1. Cirrus Link Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.1 Chariot SCADA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.2 Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

1.2.1 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.2.1.1 Java Runtime Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.2.1.2 Ignition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.2.1.3 MQTT Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.2.1.4 Demo Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61.2.1.5 Sparkplug Sample Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

1.2.2 MQTT Module Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61.2.2.1 MQTT Distributor Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.2.2.2 MQTT Engine Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81.2.2.3 MQTT Injector Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111.2.2.4 MQTT Transmission Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

1.3 Tutorials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131.3.1 Simulating Live Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131.3.2 Sparkplug Device Emulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

1.3.2.1 Standalone C Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161.3.2.2 Standalone Java Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201.3.2.3 Standalone JavaScript Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231.3.2.4 Standalone Node-RED application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261.3.2.5 Standalone Python Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

1.3.3 Sparkplug on Raspberry Pi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381.3.3.1 Raspberry Pi Java Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381.3.3.2 Raspberry Pi Python Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

1.3.4 Transmission Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461.3.4.1 Sending OPC Tag Data with Transmission . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

1.3.5 Adding TLS Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561.3.6 Installing Chariot MQTT Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65

1.4 Ignition MQTT Module Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 791.4.1 MQTT Distributor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 801.4.2 MQTT Engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 801.4.3 MQTT Injector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 811.4.4 MQTT Transmission . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81

Cirrus Link Documentation

Welcome to the home of Cirrus Link Solutions documentation!

In this manual, you will find reference information along with step-by-step tutorials. The final goal of the content and information provided here isto help you gain understanding in regards to enabling the Cirrus Link MQTT Modules for Ignition so that you can create MQTT Message OrientedMiddleware(MOM) solutions on the Ignition Application Platform.

The table of content is organized so you can easily find answers to your questions on all the features on the modules. Some of the things you willlearn in this manual are: how to install and configure the software, enable Ignition to be MQTT aware, and reference information on MQTT.

Let's GET STARTED!

Chariot SCADA

Chariot SCADA is a middleware infrastructure enabling the quick integration of data assets in SCADA and IIoT systems.  The Cirrus Link MQTTModules for Ignition enable Inductive Automation's Ignition platform to quickly set up a powerful and self contained solution.  Installation of theCirrus Link MQTT Modules into Ignition provides a solution as shown below.  This can be run in the cloud or on-premise with varying levels ofredundancy and distribution depending on requirements.

 

In this drawing the core platform that consists of the following components:

Inductive Automation's Ignition platformThis is base platform that allows for control, display, and analyzing data from remote devices and data sources.

MQTT EngineAn MQTT based receiver for converting MQTT messages into Ignition Tags so they can be used within Ignition for use indashboards and generating alerts.

MQTT DistributorAn MQTT Server as an Ignition plugin for remote devices and data sources to connect to.Limited to 50 simultaneous clients.Within the architecture this component can optionally be any 3.1.1 compliant MQTT server (or cluster of independent MQTTservers).  Cirrus Link provides more robust, redundant cloud and on-premise MQTT servers that will work as replacements toMQTT Distributor called   Chariot MQTT Server does not have a 50 client limit.Chariot MQTT Server.

MQTT InjectorA device/data simulator for testing and development.  This can be very useful in architecture testing, load testing, MQTT servertesting, and optimizing architectures.One or more MQTT Injectors can also be run on a different Ignition systems for creating additional system load intesting/development.

MQTT TransmissionA Ignition Tag to MQTT bridge.  This allows one to send Ignition tag data and tag change events over MQTT to be consumed inMQTT Engine and remotely viewed and controlled.

 

Additionally, the architecture shows remote device/data sources.  These sources/end points can be the following:

MQTT TransmissionMQTT Transmission is an Ignition module that acts as a Ignition Tag to MQTT Bridge.  It takes Ignition Tag change events andpublishes them as MQTT messages to an MQTT server.This is useful in using Ignition as a headless local OPC-UA to MQTT bridge for more efficient bandwidth usage over the largernetwork.  MQTT Transmission in conjunction with Ignition can do all of the polling locally and simply publish change events viaMQTT where they can are understood by MQTT Engine and show up as Ignition Tags.

Sparkplug Edge NodesSparkplug is a specification for using MQTT to effectively communicate with MQTT Engine for stateful delivery of data andremote command execution.This can be implemented using a variety of programming languages.  There are also examples and reference implementations h

.ereElecsys Edge Gateways

These are off the shelf industrial gateways already designed to work with the Cirrus Link MQTT Modules and Ignition.

 

The following pages are additional resources with more detailed information and tutorials.

Install the ComponentsMQTT Module ConfigurationTutorials

Simulating Live DataStandalone C ApplicationStandalone Java ApplicationStandalone Python ApplicationRaspberry Pi Java ApplicationRaspberry Pi Python ApplicationAdding TLS SecurityInstalling Chariot MQTT Server

 

 

Getting Started

Setup of the Chariot SCADA MQTT modules for Ignition includes the following steps.

Installation of the componentsTutorials showing step by step instructions for various MQTT Module usage in IgnitionReviewing options for more advanced architecturesconfiguration

Installation

To run Ignition with the MQTT Modules the following components must be installed:

Java Runtime EnvironmentRequired to run Ignition

IgnitionRequired base platform which supports the MQTT Modules

MQTT ModulesRequired for MQTT enablement of Ignition

Optionally these steps can be completed to run through some of the tutorials in this manual:

Demo ProjectShows MQTT Engine metrics, allows for sending of commands to devices, seeing device data, and controlling MQTT Injector viaa reference Ignition project

Sparkplug Sample CodeReference code showing how devices and data producers or control points can be implemented to work with Ignition and theMQTT modules via various programming languages

Once the components are installed MQTT Injector can be used to simulate data through Distributor and Engine using the guiSimulating Live Datade or for going through the step by step .tutorials

Java Runtime Environment

A Java Runtime Environment (JRE) v8 is required to run the Inductive Ignition platform.  Java can be downloaded for Linux, OSX, and Windowshere:

https://www.java.com/en/download/

After downloading follow the instructions to install the JRE.

 

Note for Linux platforms it may be preferable to use the package manager to perform the installation.  Instructions for some popular Linuxplatforms are below.

Red Hat Enterprise Linux, CentOS, and Fedora

Begin by using alternatives to install the JRE.  Note if you have multiple JREs installed you will be prompted to select one during the configurationphase.  Make sure to select the newly installed one.

# mkdir /opt/jdk1.8.0_72# cd /opt/jdk1.8.0_72/# alternatives --install /usr/bin/java java /opt/jdk1.8.0_72/bin/java 2# alternatives --config java

There are 3 programs which provide 'java'.

Selection Command-----------------------------------------------* 1 /opt/jdk1.7.0_71/bin/java + 2 /opt/jdk1.8.0_45/bin/java 3 /opt/jdk1.8.0_66/bin/java 4 /opt/jdk1.8.0_72/bin/java

Enter to keep the current selection[+], or type selection number: 4

The following commands are optional if you intend to use Java Development Kit (JDK) commands on the system as well

# alternatives --install /usr/bin/jar jar /opt/jdk1.8.0_72/bin/jar 2# alternatives --install /usr/bin/javac javac /opt/jdk1.8.0_72/bin/javac 2# alternatives --set jar /opt/jdk1.8.0_72/bin/jar# alternatives --set javac /opt/jdk1.8.0_72/bin/javac

 

Mint Linux, Ubuntu Linux

$ sudo add-apt-repository ppa:webupd8team/java$ sudo apt-get update$ sudo apt-get install oracle-java8-installer$ sudo apt-get install oracle-java8-set-default

 

Debian Linux

$ su -echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee/etc/apt/sources.list.d/webupd8team-java.listecho "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee -a/etc/apt/sources.list.d/webupd8team-java.listapt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886apt-get updateapt-get install oracle-java8-installerexit

 

Ignition

Ignition can be installed on Linux, Mac OSX, and Windows.  Instructions for installing on each of these platforms is shown below

Linuxhttps://inductiveautomation.com/resources/training/quickstart/downloading-ignition-linux

OSXhttps://inductiveautomation.com/resources/training/quickstart/downloading-ignition-mac

Windowshttps://inductiveautomation.com/resources/training/quickstart/downloading-ignition-windows

 

Note MQTT Modules support both 7.7.X and 7.8.X versions of Ignition.  Make sure to download one of these versions of Ignition.

The latest MQTT Modules do not require an external database in Ignition to be configured.

MQTT Modules

Cirrus Link's MQTT Modules can be downloaded here:

https://inductiveautomation.com/downloads/ignition

The MQTT Modules are built to work with specific versions of Ignition.  The following table shows which MQTT Module versions work with whichversions of Ignition.

  MQTT Modules Version

  1.7.x 1.8.x 2.0.x 3.0.x

Ignition v7.7.x X      

Ignition v7.8.x   X X  

Ignition v7.9.x       X

 

Inductive has a short video showing how to install modules into Ignition.  You can watch the video or read on to learn how:

https://inductiveuniversity.com/video/installing-or-upgrading-a-module

 

To install, browse to your Ignition Gateway's web UI and select 'Configure'.  The default URL is:  http://127.0.0.1:8088

The default username / password when clicking 'Configure' is .  Once in the Configuration menu select 'Modules' underadmin / password'Configuration' on the left navigation bar.

Once in the modules page, scroll to the bottom of the page and click 'Install or Upgrade a Module'

Once in the Install or Upgrade a module page, click the 'Choose File' button and browse to the MQTT Module to install.  Then click the Installbutton:

After clicking the Install button your will be asked to accept the license agreement.  If you accept, click the 'I accept' tick box and then click the'Accept License' button.

You may also be asked to add the module's trusted certificate.  If so, click the 'Add Certificate and Install Module' button.

The modules should now be successfully installed and appear in the list.

Repeat the above steps for each module that you are installing.

 

 

Demo Project

The Chariot Demo Project is used to demonstrate the status and data of the system.  It shows MQTT Engine's MQTT client connection status,remote devices connected to the system, metrics/data flowing from remote devices, and also allows control of simulated devices in MQTTInjector.

Download the demo project  .  Once downloaded, open the .zip file.  It contains the following two files:here

MQTTModulesDemo.projThis is the project file to be imported into the Ignition Gateway in this section

InjectorDefault.csvThis is the Injector CSV file to be used later in the sectionSimulating Live Data

To install the project, browse to the Ignition Gateway web UI and select the 'Configure' tab and then select 'Projects' under the 'System' header onthe left navigation bar.  Then click the 'Upload project from a *.proj backup file...' link.

Next, browse to the downloaded MQTTModulesDemo.proj file by clicking the 'Choose File' button and then browse to the downloaded project.After the file has been chosen, click 'Upload'

After uploading the project you should see the following

At This point, the MQTT Modules Demo project is installed and ready to use.  Proceed to the section to use it.Simulating Live Data

Sparkplug Sample Code

Overview:

The Sparkplug sample code can be downloaded .  In it are two base directories that both show the basics of utilizing the Sparkplugherespecification to enable applications to communicate with Ignition and the MQTT Modules

stand_alone_examplesThese are examples that can be run on a development system and have no specific hardware requirements

raspberry_pi_examplesThis is a set of reference implementations for use with the .Raspberry Pi Model 2 B

 

Implementation notes and useful tools:

GitThis is the primary tool used with Github which is where the source code is hosted.This is not explicitly required as Github allows for downloading of zip files as well.

C DevelopmentA C compiler for your target platform is required to build the examples.  Most examples developed here were developed usingLinux and OSX.

Python DevelopmentPython is required for running all Python examples.Pip is also very useful for installing module dependencies.

Java DevelopmentA JDK is required for compiling the Java examples.  Most development was done using .Oracle's JDKMaven is required for building the examples.The is not required but is a useful IDE for Java development.  It supports importing of Maven projects as well asEclipse IDEconnectors to git projects.  Most Java development was done using the 'Eclipse IDE for Java EE Developers'

MQTT Module Configuration

The Chariot MQTT modules for Ignition are configurable based on the system architecture.  Out of the box the modules are designed to work witheach other in an 'on-premise' setup as shown below.

 

       

Once in the configuration section there are two tabs.  Each has a number of configuration options as described below.

General Tab

These are the global MQTT Server configuration parameters

Port - This is the primary MQTT Server listening port.  By default it is port 1883 and is a reserved port with .IANAWebsocket Port - This is the Websocket listening port for the MQTT Server.  By default this is 8090Enable TLS - This denotes whether or not to enable TLS or not.  If TLS is used a Java Keystore file must be uploaded to secure theconnection.  This is not enabled by default.Keystore Password - This is the Java Keystore password to use if TLS is enabled and a Java Keystore file is provided.Secure MQTT Port - This is the secure MQTT Server listening port if TLS is enabled.  By default it is port 8883 and is a reserved portwith .IANASecure Websocket Port - This is the TLS enabled Websocket port for the MQTT Server.  By default this is port 9443 and is only enabledif the other TLS parameters are provided.Java Keystore File - This is the Java Keystore file that contains the server certificate and private key files

Users Tab

These are the username/password pairs that are allowed to connect to the MQTT Server and also contains the Access Control Lists (ACLs) foreach user.  MQTT Distributor requires that every client connecting to the MQTT Server must provide a valid username and password that isprovisioned here.  Any client attempting an anonymous connection will be rejected.  ACLs control what topics a given username/password pair isallowed to publish and subscribe on.  These are described later in this page.

Username - The username that must be provided in the MQTT Connect packetPassword - The password that must be provided in the MQTT Connect packetACLs - The comma separated list of ACLs that clients connecting with this username and password are allowed to publish and subscribeon

ACL Format

ACLs are defined by the following format: [R|W|RW] topic

where:

R = Read or 'subscribe' privileges

W = Write or 'publish' privileges

RW = Read and Write (subscribe and publish) privileges

topic = The topic or wildcard topic representing the scope of the privilege

 

Examples:

RW #

This allows clients connecting using this username/password to publish and subscribe on any topic

R #

This allows clients connecting using this username/password to subscribe on any topic but not publish on any topics

W #

This allows clients connecting using this username/password to publish on any topic but not subscribe on any topics

W device_one/temp/#,R state/#

This allows clients connecting using this username/password to publish on device_one/temp/# and subscribe on state/# topics

ACLs should be designed with a 'principal of least privilege' model while also considering device management and maintenance.  For examplegateways and devices in the field should be limited to publishing and subscribing only on the topics for which they should be expected to.  Thesame should be true of 'consumer' applications that will be either sending commands to devices in the field or consuming data coming from thosedevices.

It is also important to note that a username is not limited to a single MQTT client.  A username/password pair could be used for multiple MQTTclients.

If you are new to MQTT topics, Eclipse provides good information on the basics and wildcards.here

 

MQTT Engine Configuration

MQTT Engine provides a configuration section to the Ignition Gateway.  These can be seen in the Configure section of the Ignition Gateway webUI.                                                                      

Once in the configuration section there are three tabs: Servers, Advanced, and Namespaces.  Each of these tabs is described in detail in thefollowing sections.

Servers

The first tab is a list of MQTT Servers that MQTT Engine should connect to.  By default, MQTT Engine is configured to connect to the MQTTDistributor based MQTT Server.  It is set up to connect to localhost, port 1883, using the default username/password pair of admin/changeme. Out of the box MQTT Engine will work with MQTT Distributor and its default configuration.  The connection status of each server can be seen inthe 'Status' column.  Clicking on the 'Create new MQTT Server' link will bring up the following form for adding a new MQTT Server setting.

Additional or alternative MQTT Servers can be configured in MQTT Engine.  Often times more than one will be configured to handle fail-over or inredundant or geographically distributed systems.  The configuration options for servers are listed below.

NameThis is the friendly name of the MQTT Server used to easily identify it

URLThis is the URL of the MQTT server.  Its format is as follows: [protocol]://[location]:[port].  Each of these are shown below

protocol - Either tcp or ssllocation - The server location.  e.g. localhost, , , etcmyserver.chariot.io mydomain.comport - The port the MQTT Server is listening on.  Generally this is 1883 if using TCP or 8883 if using SSL

ServerTypeThis is the type of MQTT Server to connect to

Chariot - If connecting to a Cirrus Link Chariot on-premise or Chariot cloud based MQTT ServerMQTT_Distributor - If connecting to a Ignition MQTT Distributor serverThird_Party - If connecting to a third party 3.1.1 compliant MQTT Server

ClientIDOptional MQTT client ID to use.  If specified this will be used in the MQTT Engine connect packet when connecting to theserver.  If left blank, a random client ID will be create of the form ' xxxxxxxx-xxxx-xxxxIgnitionTarget-

UsernameThe MQTT username to use in the MQTT connect packet.  This is required if the MQTT Server to connect to requires it

PasswordThe MQTT password to use in the MQTT connect packet.  This is required if the MQTT Server to connect to requires it

CertificatesThe server certificates to use if required.  These are generally only required when connecting using TLS and the MQTT serverdoes not have a genuine certificate issued by a trusted certificate authority.

Clicking on the 'Create new MQTT Server...' link will bring up the following form to add a new Server.

Advanced

The second tab contains advanced settings which allows one to configure Application ID Filters and Cirrus Link Chariot Access Settings.  TheChariot access settings settings are used in conjunction with a Cirrus Link Chariot deployment and will be provided when purchasing ChariotCloud services.

These are the advanced settings:

Primary Host IDThe primary host ID to use for 'state' checks.  These checks are used to ensure that the primary backend MQTT Engine clientremains connected.  If the primary host ID is set, MQTT Engine will publish it's connection state on a topic that contains thePrimary Host ID.  In the event that MQTT Engine becomes disconnected from the server, a death certificate will be published onthe same topic, setting the state to 'offline'.  Any connecting client that subscribes on the state topic will then be notified of theMQTT Engine state and walk to the next server is MQTT Engine is offline.

Group ID FiltersA comma seperated list of group IDs to ignore.  If no group IDs are to be ignored, this should be left empty

Chariot Cloud Access KeyIf using Cirrus Link's Chariot platform, this is the provided Access Key

Chariot Cloud Secret KeyIf using Cirrus Link's Chariot platform, this is the provided Secret Key

Block CommandsWhether or not to block outgoing commands from MQTT Engine.  This is true by default and provides a security mechanism forpreventing accidental outgoing commands from MQTT Engine

Namespaces

The third tab is used for configuring namespaces.  Each namespace configuration represents a family of devices and/or data that MQTT Enginewill support.  A namespace defines the topics that each MQTT Engine client will subscribe on as well as indicates how the payload will behandled.  There are two types of namespaces: Default and Custom.  

Default Namespaces

Default namespaces are provided out of the box and can simply be enabled or disabled.  When MQTT Engine is first installed, all defaultnamespaces are enabled.  Each default namespace has the following properties:

NameA friendly name of the namespace to easily identify it.

Namespace TypeA namespace type.

EnabledWhether or not the namespace is enabled.

If a namespace is enabled, MQTT Engine will subscribe to the topics necessary to provide support for devices and data associated with thatnamespace.  If a namespace is disabled, MQTT Engine will unsubscribe from those topics and no longer support the devices and data associatedwith that namespace.

Custom Namespaces

Custom namespaces are used to provide support for generic MQTT messages with string based payloads.  If a custom namespace is configuredMQTT Engine will convert all messages received to tags.  The topic of each message will directly translate into the tag's path.  The payload of themessage will be that tag's value.   

Each custom namespace has the following properties:

NameA friendly name of the namespace to easily identify it.

SubscriptionsA comma separated list of subscriptions.

Root Tag FolderA optional name of a folder where all tags will be stored.  If configured, this folder will be the base folder where all tag paths willstart.

Tag Name An optional tag name to be used for all tags.  If not configured, the last token in the topic will represent the tag.

Note: if a Tag Name is not specified, care must be taken so that published messages do not end up overwriting previous tags. 

Clicking on the 'Create new Custom Namespace...' link will bring up the following form to add a new Custom Namespace.

Custom Namespace Example  

Let say we have a publish received on the topic "test/data/point" with value "12345".  If no Tag Value is configured, and a message is received,MQTT Engine will create a two folders "test" and "data" and a tag "point" with the value of "12345".

Alternatively if a Tag Name is configured, lets call it "payload", then MQTT Engine will convert each token in the topic to a folder and create a tagcalled "payload" with the value "12345"

In most cases it is useful to specify a Tag Name in order to prevent cases when a publish on a topic can overwrite a previously created tag,changing it into a folder.  Consider the case where you have the following two publishes:

1st publish on topic "one/two" will create a tag named "two" in the folder "one"

2nd publish on topic "one/two/three" will create a tag named "three" in the folder "one/two"

When the 2nd publish is received it will overwrite the first tag because "two" is now a folder instead of a tag.  This folder/tag name collision can beavoided by specifying the Tag Name to always use for tags. 

 

 

 

 

 

 

MQTT Injector Configuration

MQTT Injector does not have a configuration that is set up through the Ignition Gateway.  Instead it is configured using a sample project shown inthe section.Simulating Live Data

MQTT Transmission Configuration

MQTT Transmission provides a configuration section to the Ignition Gateway.  These can be seen in the Configure section of the Ignition Gatewayweb UI.                                                                            

Once in the configuration section there are three tabs: Servers, General, and Custom.  Each of these tabs is described in detail in the followingsections.  

Servers

The first tab is a list of MQTT Servers that MQTT Transmission should connect to.  By default, MQTT Transmission is configured to connect to alocal MQTT Distributor based MQTT Server.  It is set up to connect to localhost, port 1883, using the default username/password pair ofadmin/changeme.  So, out of the box MQTT Transmission will work with MQTT Distributor and its default configuration.

Additional or alternative MQTT Servers can be configured in MQTT Transmission.  Often times more than one will be configured to handlefail-over or in redundant or geographically distributed systems.  The configuration options for servers are listed below.

Name This is the friendly name of the MQTT Server used to easily identify it

URLThis is the URL of the MQTT server.  Its format is as follows: [protocol]://[location]:[port].  Each of these are shown below

protocol - Either tcp or ssllocation - The server location.  e.g. localhost, , , etcmyserver.chariot.io mydomain.comport - The port the MQTT Server is listening on.  Generally this is 1883 if using TCP or 8883 if using SSL

Server TypeThis is the type of MQTT Server to connect to

Chariot - If connecting to a Cirrus Link Chariot on-premise or Chariot cloud based MQTT ServerMQTT_Distributor - If connecting to a Ignition MQTT Distributor serverThird_Party - If connecting to a third party 3.1.1 compliant MQTT Server

Client IDOptional MQTT client ID to use.  If specified this will be used in the MQTT Engine connect packet when connecting to theserver.  If left blank, a random client ID will be create of the form ' xxxxxxxx-xxxx-xxxxIgnitionTarget-

UsernameThe MQTT username to use in the MQTT connect packet.  This is required if the MQTT Server to connect to requires it

PasswordThe MQTT password to use in the MQTT connect packet.  This is required if the MQTT Server to connect to requires it

CertificatesThe server certificates to use if required.  These are generally only required when connecting using TLS and the MQTT serverdoes not have a genuine certificate issued by a trusted certificate authority.

Clicking on the 'Create new MQTT Server...' link will bring up the following form to add a new Server.

General

The General Settings tab contains advanced configuration options for the default MQTT Server settings created in the Servers tab.  These aredescribed below.

Tag Provider NameThe name of the tag provider that Transmission will monitor.  By default this is the Ignition 'default' provider.

Tag Pacing PeriodThe buffer period for outgoing Transmission messages in milliseconds.  The default is 1000ms.  This means when a tag changeevent is detected 1000ms will elapse before an MQTT message is sent.  This allows additional tag change events to be bufferedand put into the message and in turn reduce the number of generated MQTT messages.

Custom

The third tab provides the ability to define custom Transmission settings.  By default, Transmission will only monitor tags in the 'Edge Nodes'folder under the provider specified in the General tab.  A custom Transmission setting will allow the user to define additional monitors within

Transmission with their own provider, folder settings and IDs for the Group, Edge Node, and Device associated with the tags.  This allows theuser to point to any folder in any provider (regardless of how the folder hierarchy is arranged) and have the complete set of tags pulled in andpublished with Transmission using the IDs specified in the custom configuration. 

Each Custom Setting has the following fields

Tag Provider NameThe name of the tag provider that Transmission will monitor.

Tag PathAn optional folder path under the tag provider where the root folder of the tags can be found.

Tag Pacing PeriodThe buffer period for outgoing Transmission messages in milliseconds.

Group IDAn ID representing a logical grouping of MQTT Edge Nodes and Devices into the infrastructure.Of Network (EoN) 

Edge Node IDAn ID that uniquely identifies the MQTT Edge Of Network (EoN) Node within the infrastructure.

Device IDAn optional ID that uniquely identifies a Device within the infrastructure.

Note that if a 'Device ID' is not specified, the tag values published by Transmission will represent metrics associated only with an Edge Node. 

Clicking on the 'Create new Custom Settings..' link will bring up the following form to add a new Server.

 

Tutorials

The tutorials are exercises to show how to utilize the Cirrus Link MQTT Modules within Ignition.  Each contains the prerequisites for completingthe exercise as well as detailed step by step instructions.

Simulating Live DataShows how to use MQTT Injector to send simulated data via MQTT Distributor to MQTT Engine and see the Ignition Tagsrepresenting the simulated data.

Standalone C ApplicationA non-hardware dependent C program showing a simple implementation of the Sparkplug specification.  It shows how tosend/receive data to/from MQTT Engine via MQTT Distributor.

Standalone Java ApplicationA non-hardware dependent Java program showing a simple implementation of the Sparkplug specification.  It shows how tosend/receive data to/from MQTT Engine via MQTT Distributor.

Standalone JavaScript ApplicationA non-hardware dependent JavaScript program showing a simple implementation of the Sparkplug specification.  It shows howto send/receive data to/from MQTT Engine via MQTT Distributor.

Standalone Node-RED applicationA non-hardware dependent NodeRed program showing a simple implementation of the Sparkplug specification.  It shows how tosend/receive data to/from MQTT Engine via MQTT Distributor.

Standalone Python ApplicationA non-hardware dependent Python program showing a simple implementation of the Sparkplug specification.  It shows how tosend/receive data to/from MQTT Engine via MQTT Distributor.

Raspberry Pi Java ApplicationA Raspberry Pi hardware dependent Java program showing a simple implementation of the Sparkplug specification.  It showshow to send/receive data to/from MQTT Engine via MQTT Distributor.

Raspberry Pi Python ApplicationA Raspberry Pi hardware dependent Python program showing a simple implementation of the Sparkplug specification.  It showshow to send/receive data to/from MQTT Engine via MQTT Distributor.

Sending OPC Tag Data with TransmissionShows how to send Ignition Tag data via MQTT to/from MQTT Engine via MQTT Distributor.

Adding TLS SecurityShows how to TLS enable MQTT connections within the various MQTT components for Ignition.

Installing Chariot MQTT ServerShows how to install Chariot MQTT Server as a virtual machine

Simulating Live Data

Prerequisites:

Installing the Java Runtime EnvironmentInstalling IgnitionInstalling the following MQTT Modules

MQTT Distributorv2.1.x if using Ignition 7.7.x or 7.8.x

v3.0.x if using Ignition 7.9.xMQTT Engine

v2.1.x if using Ignition 7.7.x or 7.8.xv3.0.x if using Ignition 7.9.x

MQTT Injectorv2.1.x if using Ignition 7.7.x or 7.8.xv3.0.x if using Ignition 7.9.x

Installing the Demo Project

 

Overview:

This tutorial will show how MQTT Injector can simulate device data being published into MQTT Engine via MQTT Distributor.  MQTT Injectorsimulates devices using real MQTT messages as a actual device would.  It allows for starting and stopping devices by group or id.  It also allowscontrol of publish rates of devices, which MQTT servers they're connected to, and writing to simulated registers attached to the simulated device. In addition this uses a sample Ignition project to show some basic dashboards highlighting some of the features of MQTT Engine.  The dashboardshows metrics like connected devices, on/off line MQTT servers, server latencies, and more.

 

Simulating Live Data:

Simulating live data is done using the demo project that was installed as a prerequisite  .  To run the project, you must be running a live/validheretrial or have an officially licensed Ignition and MQTT modules.  If you are using the trial, make sure the 'Trial time remaining' in the Licensingsection of the Ignition Gateway web UI is not zero.  See below for an example of a valid gateway trial.

 

 

It is also important to note that once the trial expires, the MQTT modules will automatically be disabled.  In the case of each module the followingoccurs:

MQTT Distributor - The MQTT Server stops runningMQTT Engine - The MQTT Client connections to each configured MQTT Server disconnectsMQTT Injector - The MQTT Simulator process stops running

If using a trial license, the trial is expired, and the 'reset trial' button is clicked in the Ignition Gateway web UI the MQTT modules will all resumenormal operation.  Once the trial expires, the process will repeat.  If using a official license the modules will not cease operation.

 

With a valid running license, the 'Standard Demo Dashboard' can be launched from the Ignition Gateway web UI Home screen.  Click the 'Launch'button for the the Standard Demo Dashboard launch project on the lower right of the screen as denoted in the following screen shot.

 

 

Once the jnlp file is downloaded, open it.  You may be asked to run the application or to bypass OS security settings depending on your OperatingSystem and security settings.  You will end up at a log in screen as shown below.  Use the Ignition Gateway login credentials.  Unless they'vebeen changed on your gateway, they will be the defaults of admin/password.  Enter the credentials and click 'Login'.

 

 

 

After logging in you will see the following screen.  This shows the overall system.  At this point, the MQTT Engine client is connected to the MQTTDistributor server and shows a status of 'Online' in green.  However, we don't have any devices yet so there isn't much going on or to see yet.

 

 

The next step is to add some simulated devices.  Select the 'Injector' tab on the left side of the screen and you will see the following.  This is theInjector control screen.

 

 

At this point we can import a set of simulated devices.  When downloading and extracting the MQTTModulesDemo.zip file a CSV file was includedwith it.  We need to browse to it by clicking the 'Import' button shown in the screen shot below.  Browse to the InjectorDefault.csv file and thenclick open.  After doing so, you should see a list of devices appear in the table as shown below.  Feel free to modify the CSV file as desired butkeep in mind MQTT Distributor is limited to a maximum of 50 simultaneously connected MQTT clients.  Do not change the header line of the CSVfile or it will not properly import into the project.  This CSV file must remain in a Linux/Unix type format with regard to lineImportant Note:termination.  Many Windows based editors will change the line termination by default when opening the file.  If using Windows, this is an editorthat won't change the line termination: https://notepad-plus-plus.org/.

 

 

With the new device nodes now imported we can start the simulator by clicking 'Turn Director Simulator ON'.  At this point we can refresh thedevice groups.  Do so by doing a 'right click -> Refresh' in the middle browser.  After doing so you should see the two new groups of devicesimported in the last step as shown below.

 

 

Now we can direct the simulator to start or stop groups of devices or individual devices.  The screen shot below shows the result of selectingexpanding Group1, then selecting Group1, then selecting Node005.  Note Group1 and Node005 have shown up to the right.  This allows you tostart or stop a group of devices or a individual device node.  Now lets start some simulated devices by clicking the 'Start All Directors' buttonbelow the 'Group ID' field.  This will start the 20 devices in Group1 as well as the simulated PLCs attached to them.

 

 

We can browse to the IIoT View, as shown below, and see each green square denoting a device node that has been discovered and is online withit's attached PLC states.  These status squares update dynamically based on the device and PLC statuses.

 

 

We can now browse back to the 'MQTT Metrics' tab on the left.  As before we can see the single MQTT Distributor MQTT Server is online.  But, inaddition we also now see there are 20 gateway device nodes connected as well as 40 attached PLCs.  Further more, to the right we can see thelists of all of the attached devices.  In the center we can also see the total number of TX and RX bytes as well as the total number of messagesflowing through the MQTT Server.

 

 

We can also drill down into individual gateway device nodes.  Do so by double clicking any device node in the 'Node Details Selector'.  This willopen the following popup window.  The popup will provide details on that specific device as shown below along with dynamically updating registerinformation associated with the attached PLCs.

 

 

Just as we can drill into specific device nodes, we can also drill into specific PLCs.  This can be done by selecting a PLC in the 'Field Unit DetailsSelector' and double clicking it.  This also shows connection history, published message count, and dynamically updating register values.

 

 

At this point feel free to explore the interface and try stopping and starting simulated devices.  Keep in mind since this project is now imported intoyour instance of Ignition, you can modify it in any way you want using the or use it as the basis for a new project.  Also, don'tIgnition Designerforget if you are using the trial version it will need to be reset in the Ignition Gateway web UI after the time limit is reached.  However, importedsimulated devices and other stateful data will be retained across trial expirations.

Sparkplug Device Emulation

Prerequisites:

Installing the Java Runtime Environment

Installing IgnitionInstalling the following MQTT Modules

MQTT Distributorv1.7.x if using Ignition 7.7.xv2.0.x if using Ignition 7.8.xv3.0.x if using Ignition 7.9.x

MQTT Enginev1.7.x if using Ignition 7.7.xv2.0.x if using Ignition 7.8.xv3.0.x if using Ignition 7.9.x

Downloading the  onto a development systemSparkplug Sample Code

 

Overview:

Sparkplug is an open source project developed by Cirrus Link Solutions which shows how devices or projects can be enabled to communicatewith MQTT Engine and Ignition.  These examples will show how data can be published via MQTT from an emulated device running on adevelopment machine.  In addition, it will show how devices or applications can be controlled by writing to tags in Ignition.  It will also show thecaveats associated with establishing/ending an MQTT session and ensuring that the tag values in Ignition are valid.

 

Programming Language Variations:

Standalone C ApplicationStandalone Java ApplicationStandalone Python ApplicationStandalone JavaScript ApplicationStandalone Node-RED Application

 

 

Standalone C Application

Prerequisites:

Installing the Java Runtime EnvironmentInstalling IgnitionInstalling the following MQTT Modules

MQTT Distributorv1.7.1 or greater if using Ignition 7.7.Xv1.8.1 or greater if using Ignition 7.8.X

MQTT Enginev1.7.3 or greater if using Ignition 7.7.Xv1.8.3 or greater if using Ignition 7.8.X

Downloading the  onto a development systemSparkplug Sample Code

 

Overview:

Sparkplug is an open source project developed by Cirrus Link Solutions which shows how devices or projects can be enabled to communicatewith MQTT Engine and Ignition.  This example will show how data can be published via MQTT from an emulated device running on adevelopment machine.  In addition, it will show how devices or projects can be controlled by writing to tags in Ignition.  It will also show thecaveats associated with establishing/ending an MQTT session and ensuring that the tag values in Ignition are valid.

 

Standalone C Application:

This tutorial assumes:

Ignition is running and in active trial mode or using a purchased license.MQTT Distributor is installed and running, using the default configuration, and in active trial mode or using a purchased license.MQTT Engine is installed and running, using the default configuration, and in active trial mode or using a purchased license.

With the standalone Sparkplug example downloaded onto your development machine, change into the directory and build the application.  Inorder for this to work you must have a C compiler installed for your development system.  Also, this example assumes the MQTT Server runningis MQTT Distributor running with it's default configuration.  If you are using a different MQTT Server, edit the following file to reflect your MQTTServer configuration:

sparkplug_a/stand_alone_examples/c_example/example.c

The most likely candidates for change are the host, username, and password.  For simplicity this example does not use or support TLS overMQTT without modifications.

 

There are two library dependencies on the application.  Each must be installed on your development machine before building the sampleapplication

MosquttoCan be downloaded .  Included in the link are instructions for various platforms.  Make sure in the end of installation theheredevelopment libraries are available on your build path.This is how one would do it in Ubuntu Linux 14.04

Enter the following commands:sudo apt-get updatesudo apt-get install build-essential libssl-dev libc-ares-dev uuid-dev mkdir ~/devcd ~/devwget http://mosquitto.org/files/source/mosquitto-1.4.8.tar.gztar zxvf mosquitto-1.4.8.tar.gzcd mosquitto-1.4.8makesudo make install

Protobuf-cCan be downloaded .  Included in the link are instructions for various platforms.  Make sure in the end of installation theheredevelopment libraries are available on your build path.This is how one would do it in Ubuntu Linux:

Enter the following commands:sudo apt-get updatesudo apt-get install build-essential git autoconf unzip libtool pkg-configcd ~/devgit clone https://github.com/google/protobuf.gitcd protobufgit checkout v2.6.1./autogen.sh./configuremakesudo make installcd ~/devgit clone https://github.com/protobuf-c/protobuf-c.gitcd protobuf-c./autogen.shexport PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfigexport LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib./configuremakesudo make install

With the above steps completed, run the following commands to get the sample application:

cd ~/devgit clone https://github.com/Cirrus-Link/Sparkplug.gitcd Sparkplug/sparkplug_a/stand_alone_examples/c_example/

At this point the example.c file should be edited to properly reflect your MQTT server URL, port, credentials, etc.  Finally, build the application:

make

Now simply start the application with the following command:  

./sparkplug_example

At this point, the application will start, connect to the MQTT server, publish a Edge Node Birth Certificate, publish a Device Birth Certificate, andbegin periodically reporting random data values to Ignition via MQTT Engine.  This can be verified via Ignition Designer.  Using a Web Browser,browse to the Ignition Gateway on your Ignition Gateway.  If it is running on your development machine, that is: .  You shouldhttp://localhost:8088see this:

 

Near the upper right corner, click 'Launch Designer'.  This will open the following window after downloading the .jnlp file and executing it.  Note thedefault username/password is admin/password.  Type those into the appropriate fields and click 'Login'.

 

This will bring you to a new Window where you can select an Ignition Project or create a new one.  Create a new project by giving it a name andclicking 'Create New Project'.

 

Now you should be in designer.  In the left hand side of the main window is a 'Tag Browser' window.  In it, expand 'All Providers -> MQTT Engine-> Edge Nodes -> Sparkplug Devices -> C Edge Node -> Emulated Device'.  You should see the following

 

You will see that MQTT Engine saw a new device attach to the MQTT Server and publish a Birth Certificate.  As a result, MQTT Engine createdthe Ignition Tags shown above.  These are also dynamically updated as the values change.  You can also write to the outputs.  This can be doneby putting designer into read/write and preview mode.  Do so by selecting these two buttons in the menu:

  

 

Then you can change any of the values on the outputs here:

 

You should see the output value change as well as one of the inputs.  In the Sparkplug sample code the outputs are virtually tied to the inputs. So, when modifying an output value, this causes an MQTT message to be sent from MQTT Engine, to the virtual device, which catches themessage and virtually writes the values, then publishes a MQTT message back to MQTT Engine where the two values are updated.  If you arenot seeing the output and input values update to reflect the change you have made, make sure MQTT Engine is not configured to block outbounddevice tag writes as described  .here

Standalone Java Application

Prerequisites:

Installing the Java Runtime EnvironmentInstalling IgnitionInstalling the following MQTT Modules

MQTT Distributorv1.7.1 or greater if using Ignition 7.7.Xv1.8.1 or greater if using Ignition 7.8.X

MQTT Enginev1.7.3 or greater if using Ignition 7.7.Xv1.8.3 or greater if using Ignition 7.8.X

Downloading the  onto a development systemSparkplug Sample Code

 

Overview:

Sparkplug is an open source project and methodology developed by Cirrus Link Solutions which shows how devices or projects can be enabled tocommunicate with MQTT Engine and Ignition.  This example will show how data can be published via MQTT from an emulated device running ona development machine.  In addition, it will show how devices or projects can be controlled by writing to tags in Ignition.  It will also show thecaveats associated with establishing/ending an MQTT session and ensuring that the tag values in Ignition are valid.

 

Standalone Java Application:

This tutorial assumes:

Ignition is running and in active trial mode or using a purchased license.MQTT Distributor is installed and running, using the default configuration, and in active trial mode or using a purchased license.MQTT Engine is installed and running, using the default configuration, and in active trial mode or using a purchased license.

With the standalone Sparkplug example downloaded onto your development machine, change into the directory and build the code.  In order forthis to work you must have a and installed.  Also, this example assumes the MQTT Server running isJava Development Environment MavenMQTT Distributor running with it's default configuration.  If you are using a different MQTT Server, edit the following file to reflect your MQTTServer configuration:

sparkplug_a/stand_alone_examples/java_example/src/main/java/com/cirruslink/example/SparkplugExample.java

The most likely candidates for change are the serverUrl, username, and password.  For simplicity this example does not use or support TLS overMQTT without modifications.

 

With the above steps completed, run the following commands to build the application: 

cd /stand_alone_examples/java_example/sparkplug_a

mvn clean install 

 

Now simply start the application with the following command:  

java -jar target/sparkplug_example-1.0.1-SNAPSHOT.jar

At this point, the application will start, connect to the MQTT server, publish a Edge Node Birth Certificate, publish a Device Birth Certificate, andbegin periodically reporting random data values to Ignition via MQTT Engine.  This can be verified via Ignition Designer.  Using a Web Browser,browse to the Ignition Gateway on your Ignition Gateway.  If it is running on your development machine, that is: .  You shouldhttp://localhost:8088see this:

 

Near the upper right corner, click 'Launch Designer'.  This will open the following window after downloading the .jnlp file and executing it.  Note thedefault username/password is admin/password.  Type those into the appropriate fields and click 'Login'.

 

This will bring you to a new Window where you can select an Ignition Project or create a new one.  Create a new project by giving it a name andclicking 'Create New Project'.

 

Now you should be in designer.  In the left hand side of the main window is a 'Tag Browser' window.  In it, expand 'All Providers -> MQTT Engine-> Edge Nodes -> Sparkplug Devices -> Java Edge Node -> Emulated Device'.  You should see the following

You will see that MQTT Engine saw a new device attach to the MQTT Server and publish a Birth Certificate.  As a result, MQTT Engine createdthe Ignition Tags shown above.  These are also dynamically updated as the values change.  You can also write to the outputs.  This can be done

by putting designer into read/write and preview mode.  Do so by selecting these two buttons in the menu:

  

 

Then you can change any of the values on the outputs here:

 

You should see the output value change as well as one of the inputs.  In the Sparkplug sample code the outputs are virtually tied to the inputs. So, when modifying an output value, this causes an MQTT message to be sent from MQTT Engine, to the virtual device, which catches themessage and virtually writes the values, then publishes a MQTT message back to MQTT Engine where the two values are updated. If you are notseeing the output and input values update to reflect the change you have made, make sure MQTT Engine is not configured to block outbounddevice tag writes as described  .here

 

 

Standalone JavaScript Application

Prerequisites:

Installing the Java Runtime EnvironmentInstalling IgnitionInstalling the following MQTT Modules

MQTT Distributorv1.7.1 or greater if using Ignition 7.7.Xv1.8.1 or greater if using Ignition 7.8.X

MQTT Enginev1.7.3 or greater if using Ignition 7.7.Xv1.8.3 or greater if using Ignition 7.8.X

Downloading the   onto a development systemSparkplug Sample Code

 

Overview:

Sparkplug is an open source project developed by Cirrus Link Solutions which shows how devices or projects can be enabled to communicatewith MQTT Engine and Ignition.  This example will show how data can be published via MQTT from an emulated device running on adevelopment machine.  In addition, it will show how devices or projects can be controlled by writing to tags in Ignition.  It will also show thecaveats associated with establishing/ending an MQTT session and ensuring that the tag values in Ignition are valid.

 

Standalone JavaScript Application:

This tutorial assumes:

Ignition is running and in active trial mode or using a purchased license.MQTT Distributor is installed and running, using the default configuration, and in active trial mode or using a purchased license.MQTT Engine is installed and running, using the default configuration, and in active trial mode or using a purchased license.

With the standalone Sparkplug example downloaded onto your development machine, change into the directory.  In order for this to run you musthave the JavaScript runtime installed.  Also, this example assumes the MQTT Server running is MQTT Distributor running with it's defaultNode.jsconfiguration.  If you are using a different MQTT Server, edit the following file to reflect your MQTT Server configuration:

/stand_alone_examples/js_example/example.jssparkplug_a

The most likely candidates for change are the serverUrl, username, and password.  For simplicity this example does not use or support TLS overMQTT without modifications.

 

With the above steps completed, run the following commands to change to the JavaScript Example directory: 

cd /stand_alone_examples/js_example/sparkplug_a

 

Before running the application we need to install the sparkplug-client library using the Node Package Manager (npm).  Issue the followingcommand:

npm install sparkplug-client 

Now simply start the application with the following command:  

node sparkplug-example.js

At this point, the application will start, connect to the MQTT server, publish a Edge Node Birth Certificate, publish a Device Birth Certificate, andbegin periodically reporting random data values to Ignition via MQTT Engine.  This can be verified via Ignition Designer.  Using a Web Browser,browse to the Ignition Gateway on your Ignition Gateway.  If it is running on your development machine, that is:  .  You shouldhttp://localhost:8088see this:

 

Near the upper right corner, click 'Launch Designer'.  This will open the following window after downloading the .jnlp file and executing it.  Note thedefault username/password is admin/password.  Type those into the appropriate fields and click 'Login'.

 

This will bring you to a new Window where you can select an Ignition Project or create a new one.  Create a new project by giving it a name andclicking 'Create New Project'.

 

Now you should be in designer.  In the left hand side of the main window is a 'Tag Browser' window.  In it, expand 'All Providers -> MQTT Engine-> Edge Nodes -> Sparkplug Devices -> Javascript Edge Node -> Emulated Device'.  You should see the following

 

You will see that MQTT Engine saw a new device attach to the MQTT Server and publish a Birth Certificate.  As a result, MQTT Engine createdthe Ignition Tags shown above.  These are also dynamically updated as the values change.  You can also write to the outputs.  This can be doneby putting designer into read/write and preview mode.  Do so by selecting these two buttons in the menu:

   

 

Then you can change any of the values on the outputs here:

 

You should see the output value change as well as one of the inputs.  In the Sparkplug sample code the outputs are virtually tied to the inputs. So, when modifying an output value, this causes an MQTT message to be sent from MQTT Engine, to the virtual device, which catches the

message and virtually writes the values, then publishes a MQTT message back to MQTT Engine where the two values are updated. If you are notseeing the output and input values update to reflect the change you have made, make sure MQTT Engine is not configured to block outbounddevice tag writes as described  .here

Standalone Node-RED application

Prerequisites:

Installing the Java Runtime EnvironmentInstalling IgnitionInstalling the following MQTT Modules

MQTT Distributorv1.7.1 or greater if using Ignition 7.7.Xv1.8.1 or greater if using Ignition 7.8.X

MQTT Enginev1.7.3 or greater if using Ignition 7.7.Xv1.8.3 or greater if using Ignition 7.8.X

Downloading the   onto a development systemSparkplug Sample Code

 

Overview:

Sparkplug is an open source project developed by Cirrus Link Solutions which shows how devices or projects can be enabled to communicatewith MQTT Engine and Ignition.  This example will show how data can be published via MQTT from an emulated device running on adevelopment machine.  In addition, it will show how devices or projects can be controlled by writing to tags in Ignition.  It will also show thecaveats associated with establishing/ending an MQTT session and ensuring that the tag values in Ignition are valid.

 

Standalone JavaScript Application:

This tutorial assumes:

Ignition is running and in active trial mode or using a purchased license.MQTT Distributor is installed and running, using the default configuration, and in active trial mode or using a purchased license.MQTT Engine is installed and running, using the default configuration, and in active trial mode or using a purchased license.

With the standalone Sparkplug example downloaded onto your development machine, change into the directory.  In order for this to run you musthave the   JavaScript runtime installed as well as the  tool.  This example also assumes the MQTT Server running is MQTTNode.js Node-REDDistributor running with it's default configuration.  For simplicity this example does not use or support TLS over MQTT without modifications.

With the above steps completed, run the following commands to change to the Node-RED Example directory: 

cd /stand_alone_examples/sparkplug_a nodered_example

Before running the application we need to install the library using the Node Package Manager (npm).  Issue thenode-red-contrib-sparkplugfollowing command:

npm install -g node-red-contrib-sparkplug

Now start the Node-RED application with the following command:  

node-red -v

Now you can open a browser to  to view the Node-RED visual tool.http://localhost:1880/

In the lower left there is a Sparkplug node.  Click and drag the Sparkplug node into the flow diagram.  This node will represent a Sparkplug EdgeNode.  It will establish and maintain a connect with the MQTT Server, publish NBIRTH messages, handle any received NCMD messages, publishDDATA and DBIRTH messages from connected device nodes, as well as send and received DCMD messages to the device nodes.

Double click the node to bring up the screen to edit the sparkplug node's properties.

Enter the MQTT Server URL and port number to connect to along with the username and password.  The remaining properties can be left as thedefaults.  Click "Ok".

Now click and drag a function node onto the flow diagram to the left of the sparkplug node.

Use a text editor of your choice to copy the contents of the following JavaScript file to the clipboard:

/stand_alone_examples/sparkplug_a nodered_example/emulated-device.js

then double click the function node in the flow diagram in Node-RED to bring up the the editor for the function node properties.  This node will beemulating a device by generating random data points, and sending "DBIRTH", "DDEATH", and "DDATA" messages to the Sparkplug Edge Nodeas well as respond to "command" and "rebirth" messages sent from the Sparkplug Edge Node .  Give the function node a name and pastejavascript (that was copied to the clipboard) into the "Function" editor, overwriting what was there by default.  Click "Ok".

We now need a way of triggering a DDATA publish even from the device.  Click and drag an input node to the flow diagram, to the left of theEmulated Device node.  Double click the inject node to edit it's properties.  Set the topic property to "timestamp" and leave the rest as defaults. This will allow us the ability to manually trigger a publish of device data.

Now we can wire the nodes together.  Connect the output of the timestamp node to the input of the Emulated Device node.  Connect the output ofthe Emulated Device node to the input of the Sparkplug Edge Node.  Finally Connect the output of the Sparkplug Edge Node to the input of theEmultated Device node.  This creates a way for the device to both publish messages and receive messages from the Sparkplug Edge Node.

Now it's time to click Deploy in the top right corner of the Node-RED tool.  You can monitor the command line window where you startedNode-RED and see log messages indicating that the Node-RED Edge Node's client has connected, subscribed to control and command topics,published a NBIRTH message, and emitted a "rebirth" event to the Emulated Device.  The Emulated Device then published a DBIRTH messagewith a payload containing all data points/values that the device will report.

 

This can be verified via Ignition Designer.  Using a Web Browser, browse to the Ignition Gateway on your Ignition Gateway.  If it is running on yourdevelopment machine, that is:  .  You should see this:http://localhost:8088

 

Near the upper right corner, click 'Launch Designer'.  This will open the following window after downloading the .jnlp file and executing it.  Note thedefault username/password is admin/password.  Type those into the appropriate fields and click 'Login'.

 

This will bring you to a new Window where you can select an Ignition Project or create a new one.  Create a new project by giving it a name andclicking 'Create New Project'.

 

Now you should be in designer.  In the left hand side of the main window is a 'Tag Browser' window.  In it, expand 'All Providers -> MQTT Engine-> Edge Nodes -> Sparkplug Devices ->  Node RED Edge Node -> Emulated Device'.  You should see the following-

 

You will see that MQTT Engine saw a new device attach to the MQTT Server and publish a Birth Certificate.  As a result, MQTT Engine createdthe Ignition Tags shown above.  These are also dynamically updated as the values change.  You can also write to the outputs.  This can be doneby putting designer into read/write and preview mode.  Do so by selecting these two buttons in the menu:

   

 

Then you can change any of the values on the outputs here:

 

You should see the output value change as well as one of the inputs.  In the Emulated Device sample code the outputs are virtually tied to theinputs.  So, when modifying an output value, this causes an MQTT message to be sent from MQTT Engine, to the virtual device, which catchesthe message and virtually writes the values, then publishes a MQTT message back to MQTT Engine where the two values are updated. If you arenot seeing the output and input values update to reflect the change you have made, make sure MQTT Engine is not configured to block outbounddevice tag writes as described  .here

Standalone Python Application

Prerequisites:

Installing the Java Runtime EnvironmentInstalling IgnitionInstalling the following MQTT Modules

MQTT Distributorv1.7.1 or greater if using Ignition 7.7.Xv1.8.1 or greater if using Ignition 7.8.X

MQTT Enginev1.7.3 or greater if using Ignition 7.7.Xv1.8.3 or greater if using Ignition 7.8.X

Downloading the  onto a development systemSparkplug Sample Code

 

Overview:

Sparkplug is an open source project developed by Cirrus Link Solutions which shows how devices or projects can be enabled to communicatewith MQTT Engine and Ignition.  This example will show how data can be published via MQTT from an emulated device running on adevelopment machine.  In addition, it will show how devices or projects can be controlled by writing to tags in Ignition.  It will also show thecaveats associated with establishing/ending an MQTT session and ensuring that the tag values in Ignition are valid.

 

Standalone Python Application:

This tutorial assumes:

Ignition is running and in active trial mode or using a purchased license.MQTT Distributor is installed and running, using the default configuration, and in active trial mode or using a purchased license.MQTT Engine is installed and running, using the default configuration, and in active trial mode or using a purchased license.

With the standalone Sparkplug example downloaded onto your development machine, change into the directory and install the necessary Pythonmodules for the application to run.  In order for this to run you must have and installed.  Also, this example assumes the MQTT ServerPython piprunning is MQTT Distributor running with it's default configuration.  If you are using a different MQTT Server, edit the following file to reflect yourMQTT Server configuration:

/stand_alone_examples/python_example/example.pysparkplug_a

The most likely candidates for change are the serverUrl, myUsername, and myPassword.  For simplicity this example does not use or supportTLS over MQTT without modifications.

 

With the above steps completed, run the following commands to install the application dependencies:

cd /stand_alone_examples/python_example/sparkplug_apip install protobufpip install paho-mqtt

Now simply start the application with the following command:  

python example.py

At this point, the application will start, connect to the MQTT server, publish a Edge Node Birth Certificate, publish a Device Birth Certificate, andbegin periodically reporting random data values to Ignition via MQTT Engine.  This can be verified via Ignition Designer.  Using a Web Browser,browse to the Ignition Gateway on your Ignition Gateway.  If it is running on your development machine, that is: .  You shouldhttp://localhost:8088see this:

 

Near the upper right corner, click 'Launch Designer'.  This will open the following window after downloading the .jnlp file and executing it.  Note thedefault username/password is admin/password.  Type those into the appropriate fields and click 'Login'.

 

This will bring you to a new Window where you can select an Ignition Project or create a new one.  Create a new project by giving it a name andclicking 'Create New Project'.

Now you should be in designer.  In the left hand side of the main window is a 'Tag Browser' window.  In it, expand 'All Providers -> MQTT Engine-> Edge Nodes -> Sparkplug Devices -> Python Edge Node -> Emulated Device'.  You should see the following

 

You will see that MQTT Engine saw a new device attach to the MQTT Server and publish a Birth Certificate.  As a result, MQTT Engine createdthe Ignition Tags shown above.  These are also dynamically updated as the values change.  You can also write to the outputs.  This can be doneby putting designer into read/write and preview mode.  Do so by selecting these two buttons in the menu:

  

 

Then you can change any of the values on the outputs here:

 

You should see the output value change as well as one of the inputs.  In the Sparkplug sample code the outputs are virtually tied to the inputs. So, when modifying an output value, this causes an MQTT message to be sent from MQTT Engine, to the virtual device, which catches themessage and virtually writes the values, then publishes a MQTT message back to MQTT Engine where the two values are updated. If you are notseeing the output and input values update to reflect the change you have made, make sure MQTT Engine is not configured to block outbounddevice tag writes as described  .here

Sparkplug on Raspberry Pi

Prerequisites:

Installing the Java Runtime EnvironmentInstalling IgnitionInstalling the following MQTT Modules

MQTT Distributorv1.7.1 or greater if using Ignition 7.7.Xv1.8.1 or greater if using Ignition 7.8.X

MQTT Enginev1.7.3 or greater if using Ignition 7.7.Xv1.8.3 or greater if using Ignition 7.8.X

Downloading the   onto a development systemSparkplug Sample Code

 

Overview:

Sparkplug is an open source project developed by Cirrus Link Solutions which shows how devices or projects can be enabled to communicatewith MQTT Engine and Ignition.  These examples will show how data can be published via MQTT from a Raspberry Pi.  In addition, it will showhow devices can be controlled by writing to tags in Ignition which in turn sends MQTT messages to the device.  It will also show the caveatsassociated with establishing/ending an MQTT session and ensuring that the tag values in Ignition are valid.

 

Programming Language Variations:

Raspberry Pi Java ApplicationRaspberry Pi Python Application

Raspberry Pi Java Application

Prerequisites:

Installing the Java Runtime EnvironmentInstalling IgnitionInstalling the following MQTT Modules

MQTT Distributorv1.7.1 or greater if using Ignition 7.7.Xv1.8.1 or greater if using Ignition 7.8.X

MQTT Enginev1.7.3 or greater if using Ignition 7.7.Xv1.8.3 or greater if using Ignition 7.8.X

Downloading the  onto a development systemSparkplug Sample Code

 

Overview:

Sparkplug is an open source project developed by Cirrus Link Solutions which shows how devices or projects can be enabled to communicatewith MQTT Engine and Ignition.  This example will show how data can be published via MQTT from an emulated device running on adevelopment machine.  In addition, it will show how devices or projects can be controlled by writing to tags in Ignition.  It will also show thecaveats associated with establishing/ending an MQTT session and ensuring that the tag values in Ignition are valid.

 

Raspberry Pi Java Application:

This tutorial assumes:

Ignition is running and in active trial mode or using a purchased license.MQTT Distributor is installed and running, using the default configuration, and in active trial mode or using a purchased license.MQTT Engine is installed and running, using the default configuration, and in active trial mode or using a purchased license.You have a running Raspbian Linux.Raspberry Pi 2 Model BYou have a .Pibrella I/O board

With the Sparkplug sample code downloaded onto your development machine, change into the directory and build the code.  In order for this towork you must have a and installed.  Also, this example assumes the MQTT Server running is MQTTJava Development Environment MavenDistributor running with it's default configuration.  If you are using a different MQTT Server, edit the following file to reflect your MQTT Serverconfiguration:

/raspberry_pi_examples/java/src/main/java/com/cirruslink/example/SparkplugRaspberryPiExample.javasparkplug_a

Since the IP address of the machine running the MQTT server (MQTT Distributor) is dependent on your network setup, the serverUrl must bechanged in this file.  Also, if not using MQTT Distributor you may need to modify the username and password.  For simplicity this example doesnot use or support TLS over MQTT without modifications.

 

With the above steps completed, run the following commands to build the application: 

cd /raspberry_pi_examples/java/sparkplug_amvn clean install 

 

Now with the application built it must be transferred to the Raspberry Pi.  This can be done at the command line with scp:

scp target/raspberry_pi_example-1.0.1-SNAPSHOT.jar pi@[RASP_PI_IP_ADDRESS]:/tmp/

Example if the Raspberry Pi IP address is 192.168.1.100:

scp target/raspberry_pi_example-1.0.1-SNAPSHOT.jar [email protected]:/tmp/

Default Raspbian password is: raspberry

With the application now on the Raspberry Pi, it can be run as follows:

java -jar /tmp/raspberry_pi_example-1.0.0-SNAPSHOT.jar

 

At this point, the application will start, connect to the MQTT server, publish a Edge Node Birth Certificate, publish a Device Birth Certificate, andbegin periodically reporting random data values to Ignition via MQTT Engine.  This can be verified via Ignition Designer.  Using a Web Browser,browse to the Ignition Gateway on your Ignition Gateway.  If it is running on your development machine, that is: .  You shouldhttp://localhost:8088see this:

 

Near the upper right corner, click 'Launch Designer'.  This will open the following window after downloading the .jnlp file and executing it.  Note thedefault username/password is admin/password.  Type those into the appropriate fields and click 'Login'.

 

This will bring you to a new Window where you can select an Ignition Project or create a new one.  Create a new project by giving it a name andclicking 'Create New Project'.

 

Now you should be in designer.  In the left hand side of the main window is a 'Tag Browser' window.  In it, expand 'All Providers -> MQTT Engine-> Edge Nodes -> Sparkplug Devices -> Java Raspberry Pi -> Pibrella'.  You should see the following

 

You will see that MQTT Engine saw a new device attach to the MQTT Server and publish a Birth Certificate.  As a result, MQTT Engine createdthe Ignition Tags shown above.  These are also dynamically updated as the values change.  You can also write to the outputs.  This can be doneby putting designer into read/write and preview mode.  Do so by selecting these two buttons in the menu:

  

 

Then you can change any of the values on the outputs here:

 

When you click on of the outputs, you should see the output on the Pibrella board change to reflect the state.  Also, if any inputs change on thePibrella you should see them update in the Tag Browser in the Ignition Designer. If you are not seeing the output and input values update toreflect the change you have made, make sure MQTT Engine is not configured to block outbound device tag writes as described  .here

Raspberry Pi Python ApplicationPrerequisites:

Installing the Java Runtime EnvironmentInstalling IgnitionInstalling the following MQTT Modules

MQTT Distributorv1.7.1 or greater if using Ignition 7.7.Xv1.8.1 or greater if using Ignition 7.8.X

MQTT Enginev1.7.3 or greater if using Ignition 7.7.Xv1.8.3 or greater if using Ignition 7.8.X

Downloading the  onto a development systemSparkplug Sample Code

 

Overview:

Sparkplug is an open source project developed by Cirrus Link Solutions which shows how devices or projects can be enabled to communicatewith MQTT Engine and Ignition.  This example will show how data can be published via MQTT from an emulated device running on adevelopment machine.  In addition, it will show how devices or projects can be controlled by writing to tags in Ignition.  It will also show thecaveats associated with establishing/ending an MQTT session and ensuring that the tag values in Ignition are valid.

 

Raspberry Pi Python Application:

This tutorial assumes:

Ignition is running and in active trial mode or using a purchased license.MQTT Distributor is installed and running, using the default configuration, and in active trial mode or using a purchased license.MQTT Engine is installed and running, using the default configuration, and in active trial mode or using a purchased license.You have a running Raspbian Linux.Raspberry Pi 2 Model BYou have a .Pibrella I/O board

 

With the Sparkplug sample code downloaded onto your development machine, copy the following files to the Raspberry Pi:

/raspberry_pi_examples/python/kurapayload_pb2.pysparkplug_a/raspberry_pi_examples/python/kurapayload_pb2.pycsparkplug_a/raspberry_pi_examples/python/raspberry_pi.pysparkplug_a

NOTE: The files can be copied to any directory on the Raspberry Pi that you wish. The following instructions copy the file to the temporary filesystem at /tmp. This should be changed to a development directory of your choice. 

For the WinSCP application (Windows https://winscp.net/eng/download.php) can be installed to connect and transfer files to the Raspberry Pi:

For / , the following commands can be used to copy each file:Linux Mac  

scp sparkplug_a/raspberry_pi_examples/python/kurapayload_pb2.py pi@[RASP_PI_IP_ADDRESS]:/tmp/scp sparkplug_a/raspberry_pi_examples/python/kurapayload_pb2.pyc pi@[RASP_PI_IP_ADDRESS]:/tmp/scp sparkplug_a/raspberry_pi_examples/python/raspberry_pi.py pi@[RASP_PI_IP_ADDRESS]:/tmp/

Example if the Raspberry Pi IP address is 192.168.1.100 (also the default password for the 'pi' user in Raspbian is 'raspberry'):

scp sparkplug_a/raspberry_pi_examples/python/raspberry_pi.py [email protected]:/tmp/

 

In order for this to run you must have and installed on your Raspberry Pi.  These should be installed by default.Python pip

Use pip to install the  and  dependencies with the following commands: protobuf paho-mqtt

sudo pip install protobufsudo pip install paho-mqtt

 

This example assumes the MQTT Server running is MQTT Distributor running with it's default configuration.  Since the IP address of the machinerunning the MQTT server (MQTT Distributor) is dependent on your network setup, the serverUrl must be changed in the main application file:

raspberry_pi.py

Also, if not using MQTT Distributor you may need to modify the username and password.  For simplicity this example does not use or support TLSover MQTT without modifications.

 

With the above steps completed, run the application with the following command:

python raspberry_pi.py

 

At this point, the application will start, connect to the MQTT server, publish a Edge Node Birth Certificate, publish a Device Birth Certificate, andbegin periodically reporting random data values to Ignition via MQTT Engine.  This can be verified via Ignition Designer.  Using a Web Browser,browse to the Ignition Gateway on your Ignition Gateway.  If it is running on your development machine, that is: .  You shouldhttp://localhost:8088see this:

 

Near the upper right corner, click 'Launch Designer'.  This will open the following window after downloading the .jnlp file and executing it.  Note thedefault username/password is admin/password.  Type those into the appropriate fields and click 'Login'.

 

This will bring you to a new Window where you can select an Ignition Project or create a new one.  Create a new project by giving it a name andclicking 'Create New Project'.

 

Now you should be in designer.  In the left hand side of the main window is a 'Tag Browser' window.  In it, expand 'All Providers -> MQTT Engine-> Edge Nodes -> Sparkplug Devices -> Python Raspberry Pi -> Pibrella'.  You should see the following

 

You will see that MQTT Engine saw a new device attach to the MQTT Server and publish a Birth Certificate.  As a result, MQTT Engine created

the Ignition Tags shown above.  These are also dynamically updated as the values change.  You can also write to the outputs.  This can be doneby putting designer into read/write and preview mode.  Do so by selecting these two buttons in the menu:

  

 

Then you can change any of the values on the outputs here:

 

When you click on of the outputs, you should see the output on the Pibrella board change to reflect the state.  Also, if any inputs change on thePibrella you should see them update in the Tag Browser in the Ignition Designer. If you are not seeing the output and input values update toreflect the change you have made, make sure MQTT Engine is not configured to block outbound device tag writes as described  .here

Transmission Examples

Prerequisites:

Installing the Java Runtime EnvironmentInstalling IgnitionInstalling the following MQTT Modules

MQTT Distributorv1.7.1 or greater if using Ignition 7.7.Xv1.8.1 or greater if using Ignition 7.8.X

MQTT Enginev1.7.3 or greater if using Ignition 7.7.Xv1.8.3 or greater if using Ignition 7.8.X

MQTT Transmissionv1.7.0 or greater if using Ignition 7.7.Xv1.8.0 or greater if using Ignition 7.8.X

 

Overview:

Transmission is an MQTT module for Ignition that can convert Ignition Tag data and tag change events into MQTT messages to be consumed byMQTT Engine or other MQTT clients.  These tutorials will show various ways of using MQTT Transmission.

 

Tutorials:

Sending OPC Tag Data with Transmission

Sending OPC Tag Data with Transmission

Prerequisites:

Installing the Java Runtime EnvironmentInstalling Ignition

Installing the following MQTT ModulesMQTT Distributor

v1.7.1 or greater if using Ignition 7.7.Xv1.8.1 or greater if using Ignition 7.8.X

MQTT Enginev1.7.3 or greater if using Ignition 7.7.Xv1.8.3 or greater if using Ignition 7.8.X

MQTT Transmissionv1.7.0 or greater if using Ignition 7.7.Xv1.8.0 or greater if using Ignition 7.8.X

A device that supports Modbus over TCP

 

Overview:

Transmission is an MQTT module for Ignition that can convert Ignition tag data and tag change events into MQTT messages to be consumed byMQTT Engine or other MQTT clients.  This tutorial will show how to configure MQTT Transmission to send OPC tag data in Ignition as MQTTmessages via MQTT Distributor to MQTT Engine where they will be displayed.

The topology of this example shows MQTT Distributor, MQTT Engine, and MQTT Transmission all running in the same Ignition instance.  This isdone for simplicity of the tutorial.  But, this isn't required or even intended to be a real use case.  In a more realistic scenario MQTT Transmissionand MQTT Engine would be located on separate machines.

 

Variations:

This tutorial shows how to use OPC tags and MQTT Transmission to generate MQTT messages based on tag change events.  However, the tagsource does not have to be an OPC tag.  Instead, as long as the tag structure for MQTT Transmission is followed, any Ignition tag can be used togenerate MQTT messages and/or be controlled via MQTT messages.

 

Sending OPC Tag Data with Transmission:

The first step is to configure the tag provider in Ignition in a way that MQTT Transmission understands.  Start by configuring your OPC server,client, and tags.  This can be done using the Inductive Automation documentation .  Once this is done, the Tag Provider needs to be set up inhereIgnition via the Ignition Designer.  Using a Web Browser, browse to the Ignition Gateway on your Ignition Gateway.  If it is running on yourdevelopment machine, that is: .  You should see this:http://localhost:8088

Near the upper right corner, click 'Launch Designer'.  This will open the following window after downloading the JNLP file and executing it.  Notethe default username/password is admin/password.  Type those into the appropriate fields and click 'Login'.

This will bring you to a new Window where you can select an Ignition Project or create a new one.  Create a new project by giving it a name andclicking 'Create New Project'.

In this example we're going to use the 'default' tag provider.  Do so by expanding 'All Providers' in the Tag Browser and select 'default'.

 

With 'default' selected, click the 'OPC' icon in the Tag Browser icon list:

 

This will open a new window as shown below.  If the OPC server and client were set up and configured properly, you should see somethingsimilar to the following:

 

Note there is a device with an attached PLC and two sets of registers.  Yours will look different based on the device you are using and how it isconfigured.  At this point, we can select the device (CLTEST002DIRECTOR in this case) and drag it into the Tag Browser under the 'default' TagProvider.  This is shown below:

 

The first level of folders is very important in terms of layout and how the tags will be understood and represented by MQTT Transmission.  Theseare the rules:

For terminology reference, please review the Sparkplug specification if you have not done so.Under the Tag Provider, the first folder must be exactly 'Edge Nodes'Under the 'Edge Nodes' folder a 'Group ID' must be next.  This can be anything you want but realize it represents a group of edge nodes. You can have as many group IDs as you want.Under 'Group ID' you can one or more Edge Nodes.Under each Edge Node, you can have one or more devices.Under each device, you can have any depth of folder/tag structure to represent the tags.

 

In our example, we have a single Edge Node of 'CLTEST002DIRECTOR', under it a single Device called PLC1, and under it, 15 registers in twodifferent folders.  We could rearrange this by renaming and moving folders and tags to a different representation as desired.  The layout below isalso valid as was done simply by moving/renaming the tags shown above.

 

Note while the folders and tags were moved and renamed, the required basic structure stayed the same with:

defaultEdge Nodes

Group ID (1 to n)Edge Node ID (1 to n)

Device ID (1 to n)Free form folders and tags

With our tags set up as we want them, we now must configure MQTT Transmission.  Do so by browsing to the the Configure section of theIgnition Gateway web UI and selecting 'MQTT Transmission -> Settings' on the left:

 

                                                                                                                              

 

In this example we're usiing the default MQTT Server of MQTT Distributor:

Under the General tab, we're also using the defaults:

Note the Tag Provider Name is the same Tag Provider we build out our Edge Nodes from in the Tag Browser earlier.  Now we can go back toDesigner and force MQTT Transmission to update.  MQTT Transmission does not dynamically look for changes in the tag structure and updatethem.  If it did, you could end up with a lot of improperly structured data while the changes to the tag tree are being made.  So, the update mustbe forced via 'Refresh'.  This is a tag under the MQTT Transmission tag provider as shown below in the Tag Browser.

 

In order to refresh, Designer must be in read/write and preview mode.  Do so by selecting these two buttons in the top menu of Designer:

  

Once this is done, click 'Refresh' in the Tag Browser.  This will force MQTT Transmission to read the default Tag Browser tree, find 'Edge Nodes',and begin sending MQTT messages based on tag change events.  You can see this by clicking the refresh icon in the Tag Browser menu:

At this point, you should be able to expand the MQTT Engine tag provider and see all of the tags in MQTT Engine:

In addition to the tags being displayed in Engine, they are also writable if this enabled in MQTT Engine.  By default, MQTT Engine blocks

command messages from being sent to devices.  To enable this feature, in the Ignition web console browse to the MQTT Engine ModuleConfiguration and make sure 'Block Commands' is not checked as shown below:

With this enabled and Designer in read/write and preview mode, you can write to the outputs of the modbus device from the Tag Browser:

Note there is some delay in the response.  This is due in part to MQTT Transmissions 'Tag Pacing Period'.  This is the delay for MQTT messagesto wait before being sent to allow multiple change events to buffer before putting them into a single MQTT message.  This can be changed in theMQTT Transmission module configuration in the Ignition web console.

Adding TLS Security

Prerequisites:

Installing the Java Runtime EnvironmentInstalling IgnitionInstalling the following MQTT Modules

MQTT Distributorv1.7.1 or greater if using Ignition 7.7.Xv1.8.1 or greater if using Ignition 7.8.X

MQTT Enginev1.7.3 or greater if using Ignition 7.7.Xv1.8.3 or greater if using Ignition 7.8.X

 

Overview:

MQTT Distributor can be enabled to use TLS for encryption of the communication between MQTT clients.  This is useful if MQTT Distributor isused on a public network.  Since MQTT communications are not encrypted by default, enabling TLS is highly recommended on a public network. There are two ways this can be done.  First is to certificate signed by a publicly trusted certificate authority (CA).  While there are nominal costsassociated with this, it is the proper and recommended way to go if communicating over the Internet.  Alternatively, it is possible to create and usea self-signed certificate.  This is useful for debugging and development.  However, it is not recommended in production scenarios over theInternet.  It is, however, a viable option if utilizing a private network in which encryption is a requirement.

 

Getting a Certificate from a Certificate Authority:

The first step is to get a certificate from a certificate authority (CA).  There are many available such as Verisign, Thawte and RapidSSL. There arealso a number of other certificate authorities available. The general process is as follows:

Generate a RSA keyThis is the private key and used for encryption/decryption of data.  Keep this private and don't share it with anyone including theCA.  However, the server (MQTT Distributor) will need it to encrypt/decrypt data.

Create a Certificate Signing Request (CSR)Generally the CA can provide instructions on how to generate a CSR.  Windows, Linux, and OSX all have tools available forgenerating a CSR and there is lots of documentation online about all of them.Make sure the Common Name specified in the CSR matches the server URL (i.e. example.com).  Also, do not include www.because this will used for MQTT.

Give the CSR to the CAThe CA will then provide back a public certificate for use with MQTT DistributorIn some cases depending on the CA an intermediate certificate may also be required.  If so, the CA will also provide this.

 

For creating the Java keystore in later steps, these files need to be in Base-64 encoded PEM format.  If the certificate issued by the CA was not inthis form, it must be converted to this form.  is one free tool that can do this.Openssl

 

Creating a Self-Signed Certificate:

Creating your own CA, intermediate CA, and generating your own signed certificates can be done following the following three steps using someopen source tooling.  Note creating an Intermediate CA is not explicitly required but is recommended if you will be using self-signed certs in aprivate network in production.  If this is simply for development that step can be skipped and the root CA can be used to sign server certificates. Again, using self-signed certs in production over the Internet is not recommended.

Create the Root PairCreate and Sign the Intermediate PairCreate and Sign the Server pair

Make sure the Common Name specified in the CSR matches the server URL that will be used by the clients (i.e.192.168.1.100).  It could also be the network hostname.

Using the Certificate to Secure Communication with MQTT Distributor:

Whether you are using a certificate issued by a trusted CA or a self-signed certificate, a Java keystore file must be created for use with MQTTDistributor.  This keystore will contain the public certificate, the private key, and possibly an intermediate certificate if applicable.  There are manyways to create a Java keystore.  In this example, we'll show how it can be done using .  It can run on Windows, OSX, or anyKeystore Explorerother OS that can run Java.  It provides an easy to use graphical interface for creating and manipulating Java keystores.  After installing KeystoreExplorer, open it and you should see something similar to the following.  It may ask you to modify some of your Java Security settings beforestarting.  If so, follow the instructions it provides.  Select 'Create a new Keystore'

 

 

Select a 'JKS' as the type as shown below:

 

As this point, we need to pull the required components into the keystore.  We'll start with the public/private keypair.  This is the public certificateand the private key that we originally generated.  Click the 'Import Key Pair' icon from the Keystore Explorer menu.  It is the icon with two keysand a blue downward arrow:

 

At this point, since the certificate we're using is in Base-64 encoded PEM format.  We select OpenSSL as the type and click OK:

 

Now we can browse to our key and certificate files as shown below and click import:

 

Now you will be asked to specify the alias.  You can leave this as the default.  It will reflect the Common Name that was specified during the CSRgeneration and the CA:

 

You will now be asked to specify a password for the keypair.  At this point MQTT Distributor requires that the Key Pair passwords match theoverall Keystore password.  So, make sure you note this password because we'll need to use it as the overall keystore password as well.

 

If your certificate also requires an intermediate certificate, it must be appended to the keypair.  Do so by right-clicking the keypair and navigatingto Append Certificate as shown below.  In the case of self-signed certs, this means clients only need to have the root CA certificate trusted ontheir system.  In the case of certificates signed by trusted CAs, the clients don't need to have any additional TLS configuration loaded on theirsystem.

Now browse to your intermediate certificate as shown below and click Append:

 

You should see the following.  Simply click OK.

At this point, you can save your keystore and specify a keystore password.  Do so by clicking the save icon in the upper left menu:

 

You will now be prompted for a password.  Provide the same secure password you used for the public/private keypair earlier.

 

Finally, give it a name and location on the filesystem and click Save:

 

At this point, the Java keystore simply needs to be set in MQTT Distributor's configuration.  Do so by browsing the the Ignition Gateway Web UIand select the Configure tab:

 

Then select MQTT Distributor settings on the left side menu:

 

You should see the following.  The bottom option is to specify a Java Keystore File.  Select the browse button and then browse to the JavaKeystore file you created above.

 

Also, make sure to enter the Keystore password and click the Enable TLS tick box as shown below and then click Save Changes:

 

At this point, all MQTT clients can now connect over TLS enabled connections.  Note the new port of 8883.  If using a certificate signed by apublicly trusted CA, the clients don't have to make any modifications to their list of trusted root certificates.  If using a self-signed certificate thereare a couple options:

The root CA cert can be added to the Operation System's list of trusted root certificatesThis means the application doesn't need to handle special cases (i.e. modifications to the Java Truststore)

The client side application can be modified to load the root CA certificate to validate the server certificate againstThis doesn't require OS changes

 

Using the Certificate to Secure Communication with MQTT Engine or MQTT Transmission:

In MQTT Engine or Transmission, there may be a need to specify the TLS components for the client configuration.  In the case of usingcertificates signed by a trusted CA that do not require an internediate cert don't need any special configuration other changing the form of theURL.  The form should be as follows:

ssl://[sever_url]:8883

An example is here:

 

If the trusted CA you purchased your certificate from requires an intermediate certificate or if you created a self signed certificate, you will need tospecify the CA certificate chain in the configuration.  If you received your certificate from a trusted CA and they require an intermediate certificate,it will be provided by the CA.  If you followed the tutorial above for a self-signed certificate and also created an intermediate CA, it will be the filecalled 'ca-chain.cert.pem'.  If you simply created a CA without an intermediate cert, it will be the public CA certificate.  Once you've identified theCA certificate chain based on these descriptions, copy it to a file called 'rootCA.pem' on your development system.  Note this filename change isimportant and required.  Them it needs to be uploaded via the configuration as shown here by clicking Save Changes:

Once the settings are saved, the MQTT client associated with MQTT Engine or MQTT Transmission will connect using TLS.

 

 

Installing Chariot MQTT Server

Prerequisites:

Have a computer/server capable of running VMWare or VirtualBox.Download the Chariot MQTT Server image.

 

Overview:

Chariot MQTT Server is a MQTT 3.1.1 compliant MQTT server.  It is capable of providing a functional replacement for MQTT Distributor in largerscale deployments.  Like Inductive Automation's Ignition platform, it comes with a two hour re-settable trail period.  It can also be set up with alicense key from Cirrus Link to enable it permanently.  Chariot MQTT Server provides a web based administration page for enabling and limitinguser access to the MQTT server via an Access Control List (ACLs).  Like MQTT Distributor it also supports TLS security and username/passwordauthentication in addition to ACLs for user authorization.

 

Installing a Virtual Machine Manager:

Chariot MQTT Server can be run in a number of different Virtual Machine managers.  Any Virtual Machine manager that supports importing of .ofvappliances should work.  Tested versions include the following:

Virtual Box 5.1.2VMWare Fusion 8.1.1

 

Installing Chariot MQTT Server:

Installation of Chariot MQTT Server is dependent upon the VM Manager being used.  Below shows basic instructions for the various testedmanagers.  First you will need to unzip the file to access the Cirrus Link Chariot_*.ovf file.Cirrus_Link_Chariot_1.0.1.zip

 

Installing Chariot MQTT Server into VirtualBox:First, open VirtualBox

Now, select 'Import Appliance...', browse to Cirrus Link Chariot_*.ovf (which came from ) and selectCirrus_Link_Chariot_1.0.1.zipOpen.  This will show the following window:

Change the Name to 'Cirrus Link Chariot' and select 'Import'.  The VM will take a few minutes to import depending on yourcomputer.

When this is complete, you will see the new VM in the list as shown below.

Simply click the Start button to start the VM.  You may get an error mentioning the lack of a configured sound card.  You canignore this.  You may also get some messages talking about keyboard capture and mouse pointer integration as shown below. These can also be ignored.  Once you see the following, the Chariot MQTT Server is up and running.

 

Installing Chariot MQTT Server into VMWare Fusion:First, open VMWare Fusion and select 'Import...'

Select 'Choose File...' and browse to Cirrus Link Chariot_*.ovf (which came from ) and selectCirrus_Link_Chariot_1.0.1.zipOpen.  This will show the following window.

Click 'Continue' and then click save to save the new Virtual Machine to your disk.  At this point, you may get the following error. If so, simply click 'Retry'.

At this point, the Chariot MQTT Server VM will be imported into your computer.  This will take a few minutes.

Once imported, you will something similar to the following.  Click Finish to finalize the import.

At this point you can start the VM.  Once you see the following, the Chariot MQTT Server is up and running.

Using Chariot MQTT Server:

At this point the Chariot MQTT server is up and running.  By default it has the hostname 'chariot' and is at the IP address 192.168.1.150 with asubnet mask of 255.255.255.0.  In order for you to be able to browse to it, the host computer OS must be on the same network.  Once you are onthe same network, you can browse to Chariot MQTT Server by going to   You will likely get security warnings from yourhttps://192.168.1.150.browser due to using a certificate that is not signed by a trusted Certificate Authority (CA).  This is fine, just accept the certificate (typically byclicking an 'advanced' button or something similar depending on the browser type).  Below is an example warning from Google Chrome.

Once you accept the security warning, you should see the following.

Log in using the default Instance Admin credentials:

username: adminpassword: changeme

After doing so you should see the following:

This shows a list of the users that are allowed to connect to the MQTT Server.  By default, there is only one which is 'admin'.  This user is anInstance Admin.  There are three different types of user roles:

Instance AdminIs allowed to connect to the MQTT server using the specified ACLs.Is allowed to create and make changes to all users in the system (Add, View, Edit, Reset Password, Delete).Is allowed to make changes to the VM instance such as setting the hostname, network settings, resetting the trial, and uploadinga license.Is not allowed to delete self.

Account AdminIs allowed to connect to the MQTT server using the specified ACLs.Is allowed to create and make changes to all Account Admin and Account User users in the system (Add, View, Edit, ResetPassword, Delete).Is not allowed any operations on Instance Admins - not even view.Is not allowed to delete self.

Account UserIs allowed to connect to the MQTT server using the specified ACLs.Is allowed to view self.Is not allowed any operations on any other users - not even view.Is allowed to Reset Password of self.

Basic Usage of Features

Adding a UserUsers can be added by Instance Admin and Account AdminsThe user being added must be at the role level of the creator or lowerDone by clicking 'Add User' which opens the following Window

Username and Password must be set as well as one of the three roles.ACLs must be defined.  This is a comma separated list of ACLs that define which topics users can publish and subscribe onACLs are defined by the following format: [R|W|RW] topic

where:

R = Read or 'subscribe' privileges

W = Write or 'publish' privileges

RW = Read and Write (subscribe and publish) privileges

topic = The topic or wildcard topic representing the scope of the privilege

Below are some example ACL definitionsRW #

This allows clients connecting using this username/password to publish and subscribe on any topicR #

This allows clients connecting using this username/password to subscribe on any topic but not publish on anytopics

W #This allows clients connecting using this username/password to publish on any topic but not subscribe on anytopics

W device_one/temp/#,R state/#This allows clients connecting using this username/password to publish on device_one/temp/# and subscribe onstate/# topics

ACLs should be designed with a 'principal of least privilege' model while also considering device management and maintenance. For example gateways and devices in the field should be limited to publishing and subscribing only on the topics for which theyshould be expected to.  The same should be true of 'consumer' applications that will be either sending commands to devices inthe field or consuming data coming from those devices.

It is also important to note that a username is not limited to a single MQTT client.  A username/password pair could be used formultiple MQTT clients.

If you are new to MQTT topics, Eclipse provides good information   on the basics and wildcards.hereEditing a User

This is the same as adding a user except does not allow modifying the username.  It also doesn't allow resetting the passwordsfrom this view.

Resetting a User PasswordResets the password for another user.

Deleting a UserDeletes a user.  This is only allowed for users other than the one currently logged in.

Reset Trial TimerResets the trial timer to two hours.  This is only allowed once the trial timer has expired and as long as a license has not beenissued to this instance.  If a valid license has been uploaded to this instance, the trial timer is unnecessary.Important: The trial must be running or the instance must have a valid license from Cirrus Link for the MQTT server towork!Once the Chariot MQTT Server is licensed, this option goes away.

Change Password

Resets the password for the currently logged in user.Change Network Settings

Allows for changing the following parameters:HostnameIP AddressNetwork MaskDefault GatewayDNS Servers

Once the Chariot MQTT Server is licensed, this option goes away.Generate License Request

Used to create a license request to submit to Cirrus Link for acquire a Chariot MQTT Server license.  Once generated anddownloaded, this is the file to submit to Cirrus Link to receive a license file.Once the Chariot MQTT Server is licensed, this option goes away.

Upload LicenseThis is used to upload a license file after Cirrus Link creates it from the license request file.Once the Chariot MQTT Server is licensed, this option goes away.

LogoutLogs the current user out of the system.

 

Connecting to Chariot MQTT Server

MQTT.fx is a good free graphical based MQTT client to use for testing with Chariot MQTT Server.  It is Java based so it will run on any OS thatsupports running graphical based Java applications.

Once downloaded, start it and create a new connection profile called 'Chariot MQTT Server'.  Use the settings shown below.  The defaultpassword is 'changeme'.  Everything else can remain at their defaults.

After the connection profile is created, from the main MQTT.fx window, select 'Chariot MQTT Server', and click Connect.

 

1.

2.

3.

After a valid connection is established, you should see the connection indicator in the top right corner light green as shown below:

 

If the connection does not get established, check the following:

The Trial Timer is not at 00:00:00The MQTT Server is on the same network as the computer running MQTT.fx

 

Once connected, you can use the publish and subscribe buttons in MQTT.fx to send and receive messages.  To send a message and receive itback in this client, do the following.

Subscribe on # to enable this client to receive all messages.  To do so, select the Subscribe tab, Type '#' into the topic window, and clickthe Subscribe button.  Once done, it should look as follows.

Publish a message on a topic.  To do so, select the Publish tab, 'type test/1/2' into the topic window, and click the Publish button.  Oncedone, it should look as follows.

Now switch back to the Subscribe tab.  You should see that a message has come in on 'test/1/2' in the lower right pane.

This example isn't very interesting because we're sending and receiving a message from the same client.  But, this exercise does prove theChariot MQTT Server is up and running properly.

 

 

 

Ignition MQTT Module Overview

CHARIOT SCADA is powered by Inductive Automation’s Ignition Platform.  This is enabled through the use of Cirrus Link Solutions MQTTModules for Igniton designed specifically for the integration of data building IIoT and SCADA solutions. 

The infrastructure is based on MQTT (Message Queue Telemetry Transport) a proven, standard machine-to-machine data transfer protocol that isquickly becoming the leading messaging protocol for the Industrial Internet of Things (IIoT). Adding the Cirrus Link MQTT Modules to the Ignitionplatform empowers companies to set up their own IIoT solution on a secure MQTT Message-Oriented Middleware (MOM) infrastructure.

  : Adds an MQTT server to the Ignition platform that enables MQTT clients to securely connect, publish, and subscribe toMQTT Distributor Moduledata.

  : Adds the functionality to the Ignition platform to bidirectional communicate with MQTT enabled edge-of-the-networkMQTT Engine Moduledevices securely via an MQTT Server.

  : Emulates Edge Gateways and simulates live PLC data to aid in testing the functionality and throughput of IIoT solutions.MQTT Injector Module

  Acts as an Ignition Tag to MQTT Bridge.  It can take any Ignition Tag, listen for change events, and publish thoseMQTT Transmission Module:events as MQTT Messages.

MQTT Distributor

 The MQTT Distributor Module is an MQTT server, compliant with the 3.1.1 MQTT protocol OASIS standard. It enables MQTT clients to securelyconnect, publish, and subscribe data, supplying data to both operational and business applications throughout the enterprise.

 

 

Enabling MQTT Distributor in conjunction with the MQTT Engine Module provides the components for a self-contained MOM infrastructure fromone Ignition gateway. This combination delivers the requirements for IIoT solutions and wide-area SCADA applications such as oil and gaspipeline controls solutions. It is ideal for situations where there are restricted or high-cost communications such as in VSAT or cellularconnectivity. This solution is also highly effective for increasing the data throughput for high-performance plant-floor solutions.

MQTT Engine

 Build Industrial IoT (IIoT) solutions on a MQTT Message-Oriented Middleware (MOM) infrastructure with the MQTT Engine Module and provide apath to deliver data to both operational and business applications while reducing data bandwidth. Utilize the MQTT publish-and-subscribemethodologies to inject data into industrial SCADA applications by enabling the MQTT Engine Module to connect the data from MQTT servers,creating an extremely efficient and robust IIoT architecture with Ignition.

With the MQTT Engine Module, polling at the host is no longer necessary; this solution uses edge gateways pushing the proprietary protocolpolling to the edge of the SCADA network, creating one pipeline for all data, increasing throughput and efficiencies of data acquisition throughoutan enterprise. This solution is especially useful for wide-area SCADA applications such as oil and gas pipeline controls and solutions withrestricted or high-cost communications like VSAT, or cellular.

 

MQTT Injector

 The MQTT Injector Module emulates edge gateways simulating live PLC data. It is an easy to configure tool that can emulate up to 500 EdgeGateways sending data in configurable intervals from 100ms and up. Each simulated Edge Gateway connects to an MQTT server enabling theMQTT Engine Module to receive the data upon its connection. This module is perfect for testing the functionality and throughput of different IIoTsolutions utilizing MQTT and Ignition.

 

MQTT Transmission

 The MQTT Transmission module acts as an Ignition tag to MQTT bridge.  It enables listeners to be attached to Ignition tags which then wait fortag values to change.  When they do, MQTT messages are generated to publish the data to an MQTT server.  This also allows them to beconsumed by MQTT Engine.  In addition, MQTT Transmission also listens for commands via MQTT which then allows Ignition tag values to bewritten to remotely.