Connect your Red Lion device to Amazon web services

These days the only way to ensure the safety and accessibility of all your data is to make sure it’s stored offsite on cloud servers. With the release of MQTT cloud connectors for Crimson 3.1 this has become easier than ever. This Tech Tip will walk you through ensuring that your data is accessible anywhere with an internet connection. In particular it deals with setting up a connection with the Amazon Web Services, however Crimson 3.1 also supports a generic adapter as well as Azure, Google and Sparkplug connection options.

Currently the MQTT connectors are supported by the Data Acquisition stations, the CR3000 series and the Graphite series of HMIs and controllers.

The first thing we need to do is set up our keys on the AWS website.

On the AWS website, navigate to IoT Core using the search function, the navigate to Manage>Things on the left-hand side of the screen.

Once there, you should see the below. Select “Register a Thing” and then select “Create a Single Thing”



This will bring up the “Add your device to the thing registry” form.

Give your device a name, this will describe the device and needs to be the same as the one that we will set in the Crimson software.

You then have the option to set a type for your device, this is not necessary but can help with organisation.

After that is setting a group for your device, again not necessary but can help with organisation and remote management if you are using many devices.

The last organisational addition is adding attributes to your device, these are searchable tags that make it easier to find your devices from a list.

After you have set the parameters for your device we then move on to certificate creation, the recommended way to do this is just click the “One Click Certificate Creation”

From this page the three certificates you will need to download are “A Certificate for this thing”, “A Private Key” and “A root CA for AWS IoT”, the last one will take you to a different page, but all you need to do is select an endpoint. I will be using Amazon Root CA 1 for the purposes of this document.

This will take you through to the policy selection page. These policies allow you to define the commands that can be exercised by your device. Policies are created under the secure>Policies menu as below and I recommend creating one to allow all traffic when first testing. You can refine it as you have more idea of which controls you want to allow from your device.



Once you have created your Thing, it will take you back to the main Thing page, here we need to get the Host Name, Select your Thing from the Thing page and navigate to Interact on the left-hand side. The first link under HTTPS as per the below is the required link.


The first thing we need to do on the Crimson side is select the Amazon MQTT option in the navigation pane on the left hand side of the screen.



This will bring up the services tab.

Here we need to fill in the Host Name, Client ID(DeviceName), Certificate File, Private Key File and Server CA file.



This is enough to establish basic communication. Next, we define which data tags we want to transfer. Select the Tag Data 1 tab. The other 3 Tag Data tabs function the same way, but the multiple profiles allow you to set different update rates and methods for different data sets.



Now all we need to do is go to the shadow panel of our Thing and we can see the selected tags update in real time.



This is the basics of connecting your device to the cloud. From here the possibilities are endless.

Contributors: