Versions Compared

Key

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

...

Before being able to access the AMI you must have completed the installation process here. Once the AMI in AWS Marketplace has been used to create an EC2 instance you are ready to continue this quickstart guide.

Summary

Sparkplug IoT Bridge for SiteWise Bridge (SSBIB) is an application that connects to an MQTT Server (such as AWS IoT Core) and consumes MQTT Sparkplug messages from Edge devices.  These messages must be formatted as Sparkplug Templates. Sparkplug Templates are defined in the Sparkplug Specification. These Templates are used to create the Models in AWS SiteWise automatically with no additional coding or configuration.  Then multiple instances of these Templates generate the Assets and start to populate with real time data sent on change only, thus significantly reducing the amount of data being sent to the cloud.  For further details on AWS SiteWise terminology, refer to the AWS SiteWise documentation here. For further details on Eclipse Sparkplug, refer to the Eclipse Sparkplug resources.

This Quickstart document covers how Sparkplug SiteWise IoT Bridge can be used to consume MQTT Sparkplug data and create and update SiteWise Asset Models and Assets. This will show how to configure Sparkplug SiteWise IoT Bridge as well as show how to use Inductive Automation's Ignition platform along with Cirrus Link's MQTT modules to publish device data to an MQTT Server. This data will ultimately be consumed by Sparkplug SiteWise IoT Bridge to create and update the SiteWise components. This tutorial will use the AWS IoT Core MQTT Server implementation. However, SSB IB does work with any MQTT v3.1.1 compliant MQTT Server.

It is also important to note that Ignition in conjunction with Cirrus Link's MQTT Transmission module converts Ignition User Defined Types (UDTs) to Sparkplug Templates. This is done automatically by the MQTT Transmission module. So, much of this document will refer to UDTs rather than Sparkplug Templates since that is what they are in Ignition. More information on Inductive Automation's Ignition platform can be found here. Additional information on Cirrus Link's MQTT Transmission module can be found here.

...

IoT Bridge Setup

Before configuring Sparkplug SiteWise IoT Bridge (SSBIB), you must register a 'thing' connection in AWS IoT Core. Begin by browsing to AWS IoT Core in your AWS account. Make sure you are in the same AWS region that you have already deployed SSB IB to. Begin by expanding 'Secure' and click 'Policies' as shown below.

...

  • Name
    • Some friendly name you will remember
  • Actions
    • Set to: iot:Connect,iot:Publish,iot:Subscribe,iot:Receive
    • Note this will be used for both a publisher connection (Ignition) and a subscriber (SSBIB)
  • Resource ARN
    • Set to: arn:aws:iot:AWS_REGION:ACCOUNT_ID:*
    • In the above, replace the following.
      • AWS_REGION: one of the following (where you set up SSBIB): us-east-1, us-west-2, eu-central-1, or eu-west-1
      • ACCOUNT_ID: Your AWS Account ID
  • Effect
    • Set to 'Allow'

...

Now click 'Create a single thing'. This will open the following page. Give your thing a name (such as SSBIB) and then click 'Next'.

This will bring up the following page. Click the 'One-click certificate creation' option shown below.

...

This will bring up the page similar to what is shown below. At this point, you must download the UUID.cert.pem file and the UUID.private.key file. These will both be used in the SSB IB configuration to connect to AWS IoT later. These files will not be accessible later and must be downloaded now. In addition, there is a link to download the root CA for AWS IoT. Make sure to download this as well. The 'RSA 2048 bit key: Amazon Root CA 1' is the preferred root certificate to download.

...

Once you have these, click the 'Activate' button. Then, click the 'Attach a policy' button. This will bring up the following page.

Now select the 'SSBIB_Policy' and finally click 'Register Thing'. At this point, you should see your newly provisioned 'thing' as shown below.

...

When selected, your AWS IoT Endpoint will be displayed. Note it for future use when configuring SSBIB.

With AWS IoT now properly provisioned and SSB IB installed, SSB IB must be configured. To configure it, you must be able to access it via SSH. Ensure you can access it via the Access Instructions here. Once you can access it, you must copy the three certificate files you captured when provisioning the AWS IoT Core thing. Again, these files are:

...

Code Block
languagebash
mkdir /opt/ssbib/conf/certs

Now copy the three files to the /opt/ssbib/conf/certs directory. When done, it should look similar to what is shown below.

...

Now, modify the file /opt/ssbib/conf/ssbib.properties file. Set the following:

...

Code Block
languagebash
sudo /etc/init.d/ssbib restart

At this point, SSB IB should connect to AWS IoT Core and be ready to receive MQTT Sparkplug messages. Verify by running the following command.

Code Block
languagebash
tail -f /opt/ssbib/log/wrapper.log

After doing so, you should see something similar to what is shown below. Note the last line is 'MQTT Client connected to ...'. That denotes we have successfully configured SSB IB and properly provisioned AWS IoT Core.

...

Edge Setup with Ignition and MQTT Transmission

At this point Sparkplug SiteWise IoT Bridge is configured and ready to receive data. To get data flowing into SSB IB we'll set up Inductive Automation's Ignition platform along with the MQTT Transmission module from Cirrus Link. Begin by downloading Ignition here.

...

Installation of Ignition is very straigtforward straightforward and fast. There is a guide to do so here.

...

At this point, data should be flowing into AWS SiteWise. By tailing the log in SSB IB you should see something similar to what is shown below. This shows SSB IB receiving the messages published from Ignition/MQTT Transmission. When SSB IB receives the Sparkplug MQTT messages, it creates and updates asset models and assets in SiteWise. The log below is also a useful debugging tool if things don't appear to work as they should.

...