Prerequisites

Summary

In conjunction with the Sparkplug specification, 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 tutorial will provide step by step instructions for installing and configuring Ignition Edge MQTT and an Ignition Gateway to show tags being published from a Ignition Edge server running the MQTT Transmission module to a Ignition Gateway server running the MQTT Distributor module and MQTT Engine module.

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

Architecture

Tutorial

Step 1: Download and Install the Central Ignition Gateway

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:

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

Important Note: For this test infrastructure, MQTT Distributor will be installed as an Ignition module. 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 2: Download and Install Ignition Edge MQTT

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

See the Ignition Edge installation guide here.  Follow the sections for Ignition Edge MQTT and for your specific Operating System.  Make sure Ignition Edge is being installed on a different machine than was used to install Ignition Gateway in step 1.
Take note of your user/password you create as you will need these credentials to load Modules and configure this device.

Step 3: Download the Cirrus Link MQTT 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.


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 "Install or Upgrade a Module..." text.  When prompted, select the MQTT Distributor module from the file browser and install it.  Do the same for the MQTT Engine module.  When complete, the Ignition Gateway Web UI module section should look similar to what is shown below.


And upon completion of loading the Cirrus-Link Distributor and Engine Modules:

Step 4b: Configure the MQTT Modules on the Central Ignition Gateway

By default, MQTT Engine is already configured to point to an MQTT Server at tcp://localhost:1883.  This means it will automatically connect to 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.):



Example below showing default MQTT Distributor Settings:


Step 5a: Install the MQTT Transmission Module on your 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 the SYSTEM heading click on Modules to view or load Modules.  Scroll to the bottom of the page and click on the "Install or Upgrade a Module..." text.  When prompted, select the MQTT Transmission module from the file browser and install it.  When complete, the Ignition Edge-Gateway Web UI module section should look similar to what is shown below.


Step 5b: Configure MQTT Transmission on Ignition Edge MQTT

MQTT Transmission needs to be modified to point to the MQTT Server (MQTT Distributor) in order to get 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:


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

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):



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.)



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.


Step 6: Launch Designer and Edit default Edge Tags

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.  Get Designer 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.


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.

The default view of Ignition Designer just after launching and connecting:

and the default view of the Designer Tag Browser with Sample_Tags (if you chose "Enable Quickstart" during the Ignition software installation):

The Tag Browser views have changed from the earlier Ignition v8.0.x views.  Use the pulldown menu (below) to see the various Providers on your system.



or a Designer view of an Ignition Edge installation:



Pull down and release on the 'default' or 'edge' Provider (as shown above) to see the standard pre-loaded Tags with the Transmission module (below):



Ignition Designer's view into your Central-Gateway (Tag Browser view of MQTT Engine expanded) after your first Transmission Refresh (Publish) from the Edge:



To test your connection use the Tag Browser to make a Tag value change at the Edge-Gateway.   Double click on the Edge PLC 1 Example Tag value '1', change the a value, and watch it update at the Central Gateway in the MQTT Engine provider.   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.


Ignition Designer Tag Browser views (above) of both Edge Gateway (with Transmission module) and Ignition Central Gateway (with Distributor and Engine modules) showing the Tag Paths from both systems viewpoints.  Remember:  Edge Tags are Published and Engine client Subscribes at the Broker displaying Tag changes.  Properly configured (no Blocking) you can make Tag changes at Engine and they will update Ignition Edge Tags.

To see more controls over the Tag and Folder structure (Topics) 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.