Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Prerequisites

  • Have two machines available to run Ignition Gateway and Ignition Edge MQTT.
    • Ignition Gateway can run on a laptop, in the cloud via an AWS EC2 instance or some other development computer.
    • Ignition Edge MQTT can run on one of many supported embedded edge of network gateways, a laptop or development computer, or also in a cloud service.

Summary

In conjunction with the Sparkplug specificationSpecification, it is very useful to set up a working system that uses the MQTT in order to observe a simple and fully functional distributed system.  This section of the  This tutorial will provide step by step instructions for installing and configuring Ignition Edge MQTT and an Ignition Gateway a two Ignition architecture to show tags being published from a either an Ignition or Ignition Edge server running the MQTT Transmission module to a an Ignition Gateway server running the MQTT Distributor module and MQTT Engine module.

Ignition is an Industrial Application Platform that can be used to create SCADA and HMI solutions. A fully functional Ignition system can be downloaded and run in a trial mode running for two hours at a time with unlimited restarts. Using Ignition as a tool in this way allows us to install the Sparkplug MQTT Modules and observe everything working.

...

Ignition Edge is a leaner version of Ignition made specifically for use in on edge-of-network devices. Ignition comes with unlimited Tags, Clients, and database connections, while Ignition Edge comes with unlimited Tags, two Clients (one local and one remote) and no database connectivity.

  • MQTT Distributor – An MQTT Server that runs as an Ignition module.
  • MQTT Engine – Engine is an An MQTT Client that implements the Sparkplug specification and automatically creates Ignition tag structures for Edge Node and Device metadata and process variables.
  • Ignition Edge MQTT
    MQTT Transmission – Transmission is an MQTT Transmission – An MQTT Client that implements the Sparkplug specification to bridge local Ignition tags (OPC-UA and Memory tags) and publish the resulting structure to an MQTT infrastructure.
  • Additional Ignition Edge MQTT devices could (and normally would) be added to the architecture.

Upon completion of this tutorial, you will have all of the required components to configure, deploy, and observe the Sparkplug MQTT specification in action.

Prerequisites

Have two machines available to run the two instances of Ignition or Ignition and Ignition Edge.

Architecture

  • Ignition can run on a laptop, in the cloud via an AWS EC2 instance or some other development computer.
  • Ignition Edge can run on one of many supported embedded edge of network gateways, a laptop or development computer, a Raspberry Pi (load ARMHF version), or also in a cloud service.

Architecture

Image AddedImage Removed

Tutorial

Step 1: Download

...

the Cirrus Link MQTT Modules

From the Ignition Strategic Partner Modules download page, find the latest compatible Cirrus Link Solutions MQTT Modules for Ignition Version 8.1.xx using the Version dropdown as this may not correspond to the most recent version of Ignition.

The download links will look like those shown below:

Image Added

On your primary machine, download the MQTT Distributor Module and MQTT Engine Module

On your secondary machine, download the MQTT Transmission Module

Step 2: Primary machine - download and install Ignition

On your primary machine, from the Ignition Version Archive download page, select the latest Ignition Version compatible with Cirrus Link Solutions MQTT Modules

Ignition is an Industrial Application Platform that can be used to create SCADA and HMI solutions. A fully functional Ignition system can be downloaded and run in trial mode. Using Ignition as a tool in this way, we can install the Sparkplug MQTT Modules and observe everything working.

Go to the Inductive Automation download page and download the desired Ignition installer for Windows, Linux or MacOS;
https://
inductiveautomation.com/downloads/ignition.  Take note of your user/password you create as you will need these credentials to load Modules and configure this device.

There are two system installers available on the Inductive Automation Site:

  • Ignition
  • Ignition Edge

Once the Ignition installers have installer has been downloaded, follow the instructions provided by Inductive Automation to install and start Ignition.

...

Tip
Take note of your user/password you create as part of this installation process as you will need these credentials to load modules and configure this instance.


Note
For this test infrastructure, MQTT Distributor will be installed as an Ignition module.

...

On your primary machine, remember to either turn off firewalls or at a minimum allow inbound connections to TCP/IP port #1883 and port #8883, as remote MQTT Clients will need to be able to establish a TCP/IP socket connection to these ports.


Step

...

3: Secondary machine - download and install Ignition or Ignition Edge

...

Ignition Edge MQTT is a new stripped down version of Ignition that is specifically designed for use as an Edge of Network device.

...

On your secondary machine, from the Ignition Version Archive download page, select the latest Ignition Version compatible with Cirrus Link Solutions MQTT Modules and download the desired Ignition installer for Windows, Linux or MacOS.

Once the Ignition installer has been downloaded, follow the instructions provided by Inductive Automation to install and start either Ignition or Ignition Edge

Instructions for Installing and Upgrading Ignition

Tip
Take note of your user/password you create as part of this installation process as you will need these credentials to load

...

modules and configure this

...

instance.

Step

...

4a: Primary machine - install the MQTT Modules on Ignition Gateway

From the Ignition left side bar, click on the Config tab and under the SYSTEM heading click on Modules.

Go to the Inductive Automation download page again and select the Strategic Partner (Third Party) modules Tab and use pull-down for the intended version. Find the Cirrus Link modules section and download the MQTT Distributor, MQTT Engine, MQTT Transmission modules.
https://inductiveautomation.com/downloads/third-party-modules  The download links should look similar to what is shown below but with updated versions.

Image Removed

  • In Steps 4 & 5 you will:
    • Install and configure MQTT Distributor and MQTT Engine Modules into the Central Ignition Gateway installed in step 1.
    • Install and configure MQTT Transmission Module into Ignition Edge MQTT that was installed in step 2.

Step 4a: Install the MQTT Modules on the Central Ignition Gateway

Once you have Ignition installed and running, and the MQTT Distributor and MQTT Engine modules downloaded, browse to the Ignition Gateway console (e.g. http://localhost:8088 or http://<[CentralGateway_IPAddr]>:8088 ).

Log in to the Ignition Gateway installed in step 1 using your new credentials (username/password) just created during your installation.  To the left of the side bar click on Configuration tab  [ Home | Status | Config ]  to configure your system.  In the Side Bar, beneath the SYSTEM heading click on Modules to view or load Modules.  Scroll to the bottom of the page and click on the "link → Install or Upgrade a Module..." text. 

When prompted, select the MQTT Distributor module from the file browser and install it.  Do the same select Install. Accept the license agreement and certification and install the module. Repeat for the MQTT Engine module. 

When complete, the Ignition Gateway Web UI module section should look similar to what is shown below.will show the current state of the installed modules:

Image Modified


Step 4b:

...

Primary machine - configuration of MQTT Modules

...

No additional configuration is required for the MQTT Distributor or MQTT Engine modules.

By default, MQTT Engine is already configured to point to an MQTT Server at tcp://localhost:1883.  This and this means it will automatically connect to the MQTT Distributor which is installed with it.  There are some other configuration parameters that could optionally be set.  The first is the 'Primary Host ID'.  This is a setting that is highly recommended and should be set on both MQTT Engine and any MQTT Transmission instances that are reporting in as well.  The ASCII string should match exactly on MQTT Engine and all MQTT Transmission instances.  The option to 'Block Node Commands' and 'Block Device Commands' could be unchecked if you want to allow tag writes at MQTT Engine to result in tag writes on the MQTT Transmission instances (i.e. remote tag writes).  Save the settings (SAVE-button at bottom of page) after making these changes.

Example below showing MQTT Engine Settings and the Primary Host ID value (if used note the Host name and enter it in Transmission module configuration below in Step 5b.):

To verify the connection status, select the Config tab on the left side bar and scroll to the bottom of the page and click on the "MQTT ENGINE | Settings" link. Open the Servers tab and confirm the Status shows Connected.

Image AddedImage Removed

Example below showing default MQTT Distributor Settings:

Image RemovedImage Added


Step 5a:

...

Secondary machine - install the MQTT Transmission Module on

...

Ignition or Ignition Edge Gateway

Now that you have Ignition Edge installed and running, and the MQTT Transmission module downloaded, browse to the Ignition Edge-Gateway console (e.g. http://localhost:8088 or http://<[Edge-Gateway_IPAddr]>:8088 ).

Log in to the Edge-Gateway using your new credentials (username/password) created during your installation.  To the left of the side bar click on Configuration tab  [ Home | Status | Config ]  to configure your system.  In the Side Bar, beneath From the Ignition left side bar, click on the Config tab and under the SYSTEM heading click on Modules to view or load Modules.   Scroll to the bottom of the page and click on the "link → Install or Upgrade a Module..." text. 

When prompted, select the MQTT Transmission module from the file browser and select Install. Accept the license agreement and certification and install itthe module. 

When complete, the Ignition Edge-Gateway Web UI module section should look similar to what is shown below.Gateway will show the current state of the installed module:

Image Modified

Step 5b:

...

Secondary machine - configuration of MQTT Transmission

...

Module

MQTT Transmission needs to be modified configured to point to the MQTT Server (MQTT Distributor) Distribution server in order to get publish data into MQTT Engine.   To do so, browse to Ignition Edge MQTT with a web browser.  In the Side Bar, beneath the SYSTEM heading towards the bottom underneath MQTT TRANSMISSION click Settings to view or modify.  The default view is of the General status.  Make certain this is set to 'Enabled' when finished with the configuration.  When complete, the Ignition Edge-Gateway Web UI module section should look similar to what is shown below.  Then click 'Configure' at the top, log in, and select MQTT Transmission 'Settings' on the left panel near the bottom, then select 'Servers' tab.  Configure the URL to match your environment.  Finally, click the 'edit' button to the right of the 'Chariot SCADA' definition as shown below.

Default view:

Image Removed

Edit Configuration pointing to your MQTT (Distributor) Server.......

Image Removed

this, select the Config tab on the left side bar and scroll to the bottom of the page and click on the "MQTT TRANSMISSION | Settings" link.

Click on the Servers tab and edit the MQTT Server named Chariot SCADA to and modify the URL to point to the Ignition Distributor gateway.  Example: If your Gateway IP is 10.1.10.97 then set the URL to tcp://10.1.10.97:1883 and save your settings.  Confirm your connectivity from Edge to Gateway (below are two possible examples):

Image Removed

Now select 'Sets' at the top and click the 'edit' button next to the 'Default' Server Set as shown below.  (Note that Primary Host ID is modified here in the example.)

Image Removed

And as mentioned above if you are using the more robust method of specifying the host be sure to match Primary Host ID (eg. Ignition_Gateway) in Edge and Central Gateway settings.  Edit the 'Default' Sets to enter and update the Primary Host ID.

Image Removed

Step 6: Launch Designer and Edit default Edge Tags

Save Changes.

Once configured, MQTT Transmission will automatically connect, and you can confirm by checking the Connected status on the Servers tab.

Image Added


Step 6: Primary and secondary machine - Launch Designer

At this point are ready to edit the default tag, created as part of the MQTT Transmission installation, At this point we must download and launch the newest Ignition Designer tool to create or edit the default Tag(s) to send to MQTT Engine using the MQTT protocol and to do this we will use the Ignition Designer tool.

Select the Get Designer button from Ignition Edge web portal as shown below.  Start and point the Designer tool at the same IP address, username and password as created on your Edge-Gateway to create your project.

Image Removed

Ignition Designer view of Edge 'Tag Browser' pane (expanded) shown below.  Note the "All Providers/edge/Edge 'MQTT Tags' " folder.  This is where we will edit or add some specific folders and tags or change the values to work with the 'Default Transmitter' of MQTT Transmission.  Making changes on the Edge side will result in new values displayed at the Central Gateway as viewed with Ignition Designer.  Launch Designer and create two sessions, one to view into the Edge and modify Tags, the other to see your Central Gateway and view those changes, confirming the correct configuration settings from the tutorial examples above.

Ignition Designer's view into your Edge-Gateway (default values, Tag Browser expanded):

Image Removed

Ignition Designer's view into your Central-Gateway (Tag Browser expanded):

Image Removed

...

to download, install and launch the Design Launcher. 

Image Added

Once launched, double click the Ignition gateway in the Designer View and log in using the username and password created when installing Ignition on the machine.

Note: if you enabled the Quick Start option when starting Ignition, a samplequickstart project will have been created and you will need to open that project.

Initial Designer view if installed with Ignition showing open samplequickstart project:Image Added

Deselect Sample_Tags and select MQTT Engine under the Tag Browser window. Expand the Edge Nodes folder tree until you have exposed the PLC 1 folder with the Example Tag.Image Added

Initial Designer View if installed with Ignition Edge

Image Added

Expand the MQTT Tags folder in the Tag Browser window until you have exposed the PLC 1 folder with the Example Tag.

Image Added

Step 7: Test Connection

To test your connection, make a change to the tag value on the secondary machine with MQTT Transmission installed. Double click on the Example Tag value '1', change the value, and watch it update at the Ignition Designer connected to the MQTT Engine provider.

Note
The Ignition Designer tool is not by default in Read

...

/Write mode so your first attempt to write a new value to

...

this Example Tag will ask you to select either Cancel | Enable Read/Write Mode | Write Once.  Select Write Once or Read/Write to allow Tag value changes.

Image RemovedCentral-Gateway Tags now update:

Image Removed

Ignition Designer Tag Browser views (below) of both Edge and Ignition Gateway showing the Tag Paths from both systems viewpoints.  These Designer Tag Browser's are shown overlaying the web-browser view of the Edge Transmitter configuration page.For more detail on how the MQTT Transmission Transmitter configurations interact with the Ignition tag trees to publish MQTT messages and tags to an MQTT Server, see the MQTT Transmission Transmitters and Tag Trees tutorial.

Extra Activities

At this point you have a fully functional system that can be expanded or modified as required.  Below are some additional activities you may want to try on your own.

  • Allow outbound tag writes.

...

  • Video 9: Allow Outbound Tag Writes
  • Disable MQTT Transmission to see the tags go stale in MQTT Engine
  • Set the 'Primary Host ID'.  This is a setting that is highly recommended and should be set on both MQTT Engine and any MQTT Transmission instances that are reporting in as well. Video 10: Primary Host ID Setting
  • Modify the tags folder to add additional memory tags Creating Tags in Ignition and force an update to the Ignition Gateway Using the MQTT Transmission Refresh Mechanism
  • TLS enable the MQTT Distributor module and disable port 1883. Video 11: How to Set Up Transport Layer Security 
  • Set up Store-and-Forward
  • TLS enable the MQTT Distributor module and disable port 1883
    • Note production MQTT Infrastructures should never run on the open Internet without using TLS enabled MQTT connections!
  • Modify the MQTT Transmission default transmitter tag tree to add additional tags and get them to show up in the Central Ignition Gateway
    • [ Show Link here to the Transmitter and Tag creation page ]
  • Disable MQTT Transmission in Ignition Edge MQTT to see the tags go stale in MQTT Engine
  • Set up store and forward in MQTT Transmission to show data being saved in Ignition Edge MQTT when the connection goes down. Video 12: Set Up Store-and-Forward System
  • Load and Configure configure a Database at the Central Gateway (launch Gateway webpage) then edit and database on the primary ignition gateway and then associate Tag History using Ignition Designer Tag Historian in Ignition
  • Use a Custom Transmitter rather than the Default Transmitter to provide more flexibility on the MQTT Transmission side in terms of tag tree/arrangement
    • [ Show Link here to the Transmitter and Tag creation page ]
    MQTT Transmission Transmitters and Tag Trees
  • Add additional MQTT Transmission modules Add a second or more Ignition Edge MQTT instances pointed at the same single MQTT Distributor instance that was set up in this tutorial