Dataserver Amazon IoT Core
  • 18 Aug 2023
  • 4 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

Dataserver Amazon IoT Core

  • Dark
    Light
  • PDF

Article Summary

The purpose of this article is to serve as a reference guide for the use of the Amazon data server.

Prerequisite

A starter pack (SiteManager + accounts) 
A cloud subscription (Trial) from Amazon IoT Core
Other sections in DCM:
Getting started
Guides
Examples
Frequently asked questions
Troubleshooting


A first time user might benefit from using the  Getting started with DCM -> Amazon IOT Hub guide.


The data servers' (array of objects, mandatory) list elements contain the following fields:

FunctionTypeImportanceDescription
DatasrvNamestringmandatoryUnique (within this configuration file) name for each data server this SiteManager delivers data to. Follows the normal rules for names.
DatasrvDesriptionstringoptionalA description of this data server. For your future reference
SampleListarray of stringsoptionalThis array contains the list of sampleref this data server will deliver data for. If it is not present, all sample values in this configuration will be delivered. Since this object is not a Collectors object, the CollectorName part of the sampleref field is mandatory. If the SampleName part of the sampleref is left blank, all samples from that collector are delivered.
IOPinbooleanoptionalIf set to true, the Output I/O pins configured to follow DCM data loss will be controlled by this datasrv. If multiple data servers are controlling the I/O pins, then the value will be the logical OR of all dataservers data loss state. (I.e. If any data server is in data loss, the I/O pins will be in logical high). If not set, the value is false.
DatasrvProtocolstring-enummandatoryDesignates the protocol used to deliver data from the Store'n'Forward database to data servers, aka Cloud Systems. For Cumulocity use "C8Y/REST".
Currently 6 possible values exist: "AWS/MQTT", "AZURE/IOTHUB", "SCI/SPD", "C8Y/REST", "SEMA/REST" or "SIMULATOR/NONE".
ConnectRetryMininteger > 0mandatoryMinimum number of seconds before trying to reestablish a connection to the data server for data delivery. An exponential back-off algorithm is used to retry connection establishment, starting after ConnectRetryMin and increasing to ConnectRetryMax.
ConnectRetryMaxinteger > 0mandatoryMaximum number of seconds before trying to reestablish a connection to the data server for data delivery.
MQTTAWSParamsobjectmandatory
for Secomea
Data Collectio Cloud
Contains all the parameters needed to deliver (publish) data to the Amazon IoT core AWS MQTT cloud service. Mandatory if DatasrvProtocol has the value "AWS/MQTT".



The SCISPDParams' (array of objects, mandatory) list elements contain the following fields:

FunctionTypeImportanceDescription
BrokerAddrstringmandatoryThe DNS name/IP address of the server to deliver data to/from the Store'n'Forward database.
BrokerPortinteger > 0 and < 65535optionalThe TCP port to use for the connection from the SiteManager to the Amazon MQTT/S server. If not specified, the value 443 (TLS) is used.
RootCAstringoptionalThe certname of the RootCA to use for the MQTT over TLS connection. If not specified, the first AWS ROOT-CA found in the cert repository will be used.
DeviceCertstringoptionalThe certname of the Device Certificate to use for the MQTT over SSL TCP connection. If not specified, the first AWS Device Certificate found in the cert repository will be used.
DevicePrivKeystringoptionalThe certname of the Device Private Key to use for the MQTT over SSL TCP connection. If not specified, the first AWS Device Private Key found in the cert repository will be used.
PublishQosstring-enumoptionalThe QOS (Quality Of Service) used to publish messages to AWS. Currently "qos0" and "qos1" is supported. If not specified, the value "qos1" is used.
PublishIntervalinteger >= 0mandatoryThe interval in seconds between each delivery of new data from the store'n'forward database. The value 0 means that data is delivered as fast as possible.
PayloadFormatstringoptionalThis string describes the format of the payload reported over MQTT. The format is printf-like with % formats as shown in the Payload list
BulkElementFormatstringmaybe optionalThis string describes the format of the element used by the "%b" format used in the PayloadFormat and is therefore mandatory if PayloadFormat contains a "%b" format. The BulkElementFormat is printf-like with the same specifiers as for PayloadFormat except "%b" is not allowed. If not specified the format is { "ts" : %t, "%jd:%js" : %jv }, .
TopicFormatstringoptionalThis string describes the format of the topic used over MQTT. The format is printf-like with the same formats as PayloadFormat . If not specified, the format is "%m".



  •  PayloadFormat  (string, optional). This string describes the format of the payload reported over MQTT. The format is printf-like with % formats as follows:
  • 'm' - SiteManager Unique address. (This is  NOT  the MAC address, but the  EdgeID  )
  • 'M' - SiteManager Unique MAC address.
  • 'N' - SiteManager Name. (GateManager Appliance Name).
  • 'V' - Configuration version ID.
  • 'd' - Collector name.
  • 's' - Sample name.
  • 'u' - Sample unit. If undefined, an empty string.
  • 'g' - Sample group name. If undefined, the sample name will be used.
  • 't' - Timestamp value as an integer. (64bit 100ns resolution)
  • 'T' - Timestamp as ISO-8601 time string. (2018-11-12T14:04:46.114)
  • 'e' - Timestamp as an integer. (32bit Unix Epoch).
  • 'E' - Timestamp as an integer. (64bit Unix Epoch in millisecond resolution).
  • 'v' - Sample value as a string. (binary data as hex byte string)
  • 'b' - Multiple values are delivered (in bulk) as an array, described in the BulkElementFormat .
  • '%' - A percent character. The format can be prefixed with 'j', which will perform an escape sequence to data according to the RFC 7159 (JSON) standard. If not specified, the format is  { "v" : [ %jb ] }  .


{
 "DatasrvName":"aws_iot",
 "DatasrvProtocol":"AWS\/MQTT",
 "ConnectRetryMin":2,
 "ConnectRetryMax":240,
 "MQTTAWSParams":{
   "BrokerAddr":"a1cn4k05gzdtcl.iot.us-east-2.amazonaws.com",
   "BrokerPort":8883,
   "RootCA":"awsrootca",
   "DeviceCert":"awsdevcert",
   "DevicePrivKey":"awsdevpkey",
   "PublishQos":"qos1",
   "PublishInterval":0,
   "TopicFormat":"iotgateway/%d",
   "PayloadFormat":"{ \"%js\" : %jv, \"timestamp\" : %t }"
   }
 }

Was this article helpful?