Publish Data to AWS IoT Gateway
View the following video for a complete demonstration of how to publish data to AWS IoT Gateway, Azure IoT, and MQTT Brokers.
- 00:00 – Introduction
- 00:23 – Set up Tags in OAS
- 00:41 – Configure Azure IoT
- 01:53 – Publish Selected Tags
- 05:31 – Visual Studio Code
- 08:00 – Step by step instructions
- 08:12 – Bulk Publish to AWS IOT
- 09:21 – Step by step instructions / Publish Data to AWS IOT Gateway
- 09:33 – Bulk Publish to mqtt broker
- 10:29 – MQTT Explorer
- 11:20 – Step by step instructions/ Getting Started MQTT
- 11:34 – Save button of the OAS Configuration tool
Create an IoT Driver
Open Configure OAS.
Select Configure >> Drivers from the top menu.
Select your Network Node, either local or remote.
Enter the Driver Interface Name you wish to use.
Select AWS IoT Gateway from the Driver combo box.
Use the Browse buttons to select you Certificate File Path and the Private Key File Path. These are created in your AWS Management Console.
Enter the IoT End Point. This is also found in your AWS Management Console.
If you would like to define a secondary AWS end point if the primary server fails, check Enable Failover checkbox and enter it’s physical properties. If both the primary and secondary servers are offline the Return to Online settings determines the retry frequency.
View Driver Interface Failover for more information and and video demonstrating communications failover.
Note: Data that is to be published to the AWS IoT Gateway can be buffered during network failures by setting the Enable Store and Forward property to true. Define the path for the buffer files under Configure-Options-Store and Forward.
Click Add Driver on the top left.
Publish Live Data to AWS IoT Gateway.
There are 2 ways to publish data from OAS to AWS IoT Gateway. Both require Tags to be setup first for the data sources you want to transfer.
Note: If you wish to receive data from AWS IoT Gateway see Getting Started – AWS IoT Gateway under the Data Sources.
Option 1 – Publish Selected Tags to AWS IoT Gateway.
Enable Publish Selected Tags at the bottom of the Driver configuration.
Select to publish data continuously at a specified interval, based on event, or at a specific time of day.
If Event Driven browse for a local or remote OAS tag that will trigger the publish. Select a Boolean tag that will change state from false to true, true to false, or both. Or choose an Integer tag that trigger a publish anytime the value changes other than 0.
Enable Publish Latest Value Only to send only the latest value of each tag when published or disable to send all value changes since the last time a publish occurred.
Enabled Include All Tags Each Publish to send at least the latest value of each tag when published or disable to only send the tags that have changed since the last publish.
Enable Publish All Tags As One Topic to publish all tag values as one topic or disable to send each tag as its own topic.
See examples in Step 6 below for each selectable option.
Specify the Publish Topic Id if choosing to Publish All Tags As One Topic.
Specify the Tag Id, Value Id, an optional Quality Id, and Timestamp Id for each tag value that is sent.
When including the Timestamp Id also specify the timestamp format, use Custom to specify your own date and time format.
Specify local and remote OAS tag variables to include in each publish and specify the Id. Value is the current value from the data source or you can select any of the over 600 tag variables of each tag to publish.
Optionally use CSV Export and CSV Import buttons to set up additional tags to publish using Microsoft Excel.
Select Apply Changes to begin publishing to AWS IoT Gateway. Select Save to save the new driver configuration within the tag file.
Examples of publishing every 2 seconds with each tag value changing every second:
Option 2 – Use Data Route to send data to AWS IoT Gatway.
See Getting Started – Data Route to define a Target tag in any source tag.