Versions Compared

Key

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


HTML
<div style="background-color: yellow; border: 2px solid red; margin: 4px; padding: 2px; font-weight: bold; text-align: center;">
Sparkplug SiteWise

...

Prerequisites

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

This quickstart document covers how Sparkplug SiteWise Bridge (SSB) 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 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 Bridge to create and update the SiteWise components. This tutorial will use the AWS IoT Core MQTT Server implementation. However, SSB does work with any MQTT v3.1.1 compliant MQTT Server.

Sparkplug SiteWise Bridge Setup

Before configuring Sparkplug SiteWise Bridge (SSB), 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 to. Begin by expanding 'Secure' and click 'Policies' as shown below.

Image Removed

Now click the 'Create a policy' button. This will bring up the following page.

Image Removed

Set the following parameters for the policy.

  • 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 (SSB)
  • 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 SSB): us-east-1, us-west-2, eu-central-1, or eu-west-1
      • ACCOUNT_ID: Your AWS Account ID
  • Effect
    • Set to 'Allow'

Finally click 'Create' in the lower right. This will show the newly created policy.

Image Removed

At this point a 'thing' can be created. We'll use the policy a bit later in the procedure. To create the thing, expand 'Manage' on the left navigation panel and click 'Things' as shown below.

Image Removed

Click 'Register a thing'. This will bring up the page below.

Image Removed

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

Image Removed

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

Image Removed

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

Image Removed

At this point you should have three files where 'UUID' will be some UUID specific to your thing. Do not proceed until you have all three files.

  • UUID.cert.pem
  • UUDT.private.key
  • AmazonRootCA1.pem

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

Image Removed

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

Image Removed

Now we need to get the AWS IoT Core Endpoint. Do so by selecting 'Settings' from the left navigation panel as shown below.

Image Removed

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

With AWS IoT now properly provisioned and SSB installed, SSB 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:

  • UUID.cert.pem
  • UUDT.private.key
  • AmazonRootCA1.pem

On the target EC2 instance, run the following command to create a directory to hold the certificates.

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

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

Image Removed

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

  • mqtt_server_url
    • This is the AWS IoT Core endpoint URL. It must be of the form: ssl://ENDPOINT_URL:8883
  • mqtt_ca_cert_chain_path
    • The path to the AWS root CA certificate
  • mqtt_client_cert_path
    • The path to the AWS thing certificiate
  • mqtt_client_private_key_path
    • The path to the AWS thing private key

When complete, it should look similar to what is shown below.

Image Removed

Now the service can be restarted to pick up the new configuration. Do so by running the following command.

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

Edge Setup with Ignition and MQTT Transmission

...

 Bridge has been renamed to <a href="https://docs.chariot.io/display/CLD80/IBAS%3A+Quickstart">IoT Bridge for SiteWise</a>. You will be redirected to the new documentation.
<br>
Click in the link above if you are not automatically redirected in 10 seconds.
</div>
<meta http-equiv="refresh" content="10; URL='https://docs.chariot.io/display/CLD80/IBAS%3A+Quickstart'" />