avatar  

Log out

Recently viewed tickets

Azure dataserver

The purpose of this article is as a reference guide for the use of the Azure Dataserver.

First time user might benefit from using the Getting Started with DCM - Azure guide.



The DataServers (array of objects, mandatory) list elements contains the following fields:

  • DatasrvName (string, mandatory). Unique (within this configuration file) name for each dataserver, this Sitemanager delivers data to. Follows the normal rules for names.
  • DatasrvDesription (string, optional) description of this data server.
  • SampleList (array of strings, optional) This array contains the list of sampleref , this dataserver 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.
  • IOPin (boolean, optional). If set to true, the Output I/O pins configured to follow DCM dataloss, will be controlled by this datasrv. If multiple dataservers are controlling the I/O pins, then the value will be the logical OR of all dataservers data loss state. (I.e. If any dataserver is in dataloss, the I/O pins will be in logical high). If not set, the value is false.
  • DatasrvProtocol (string-enum, mandatory). Designates the protocol used to deliver data from the Store'n'Forward database to data servers, aka Cloud Systems. Currently 5 possible values exists: "AWS/MQTT", "AZURE/IOTHUB", "SCI/SPD", "C8Y/REST" or "SEMA/REST".
  • ConnectRetryMin (integer > 0, mandatory) Minimum number of seconds before trying to reestablish a connection to the dataserver for data delivery. An exponential backoff algorithm is used to retry connection establishment, starting after ConnectRetryMin and increasing to ConnectRetryMax .
  • ConnectRetryMax (integer > 0, mandatory) Maxumin number of seconds before trying to reestablish a connection to the dataserver for data delivery.
  • MQTTAWSParams (object, maybe-optional). Contains all the parameters needed to deliver (publish) data to Amazon AWS MQTT cloud service. Mandatory if DatasrvProtocol has the value "AWS/MQTT".
  • AZUREIotHubParams (object, maybe-optional). Contains all the parameters needed to deliver data to a Azure IoTHub client service. Mandatory if DatasrvProtocol has the value "AZURE/IOTHUB".
  • SCISPDParams (object, maybe-optional). Contains all the parameters needed to deliver (publish) data to Secomea cloud service, CSI. Mandatory if DatasrvProtocol has the value "SCI/SPD".
  • C8YParams (object, maybe-optional). Contains all the parameters needed to deliver (publish) data to the Cumulocity Cloud service. Mandatory if DatasrvProtocol has the value "C8Y/REST".
  • SemaParams (object, maybe-optional). Contains all the parameters needed to deliver (publish) data to the Schneider Electric Machine Advisor service. Mandatory if DatasrvProtocol has the value "SEMA/REST".


The AZUREIotHubParams object contains the following fields:

  • PublishInterval (integer >= 0, mandatory). The 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.
  • ConnectName (string, optional). The certname of the connectstring to use for the Azure connection. If not specified, the first connectstring found in the cert repository will be used.
  • PayloadFormat (string, optional). This string describes the format of the payload reported to Azure IotHub. The format is as for the MQTTAWSParams PayloadFormat field.
  • BulkElementFormat (string, optional). This string describes the format of the element used by the "%b" format used in the PayloadFormat . The format is the same as for MQTTAWSParams PayloadFormat . If not specified the format is { "ts" : %t, "%jd:%js" : %jv },.
  • ContentType (string, optional). The contenttype of the values being delivered. If not specified it is application/json.
  • ContentEncoding (string, optional). The content encoding of the values being delivered. If not specified it is utf-8.


Payload format

  • '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 escape sequence to data according to the RFC 7159 (JSON) standard. If not specified, the format is { "v" : [ %jb ] }.


Example:

 {
"DatasrvName" : "azure",
"DatasrvProtocol" : "AZURE\/IOTHUB",
"ConnectRetryMin" : 2,
"ConnectRetryMax" : 240,
"AZUREIotHubParams" : {
"PublishInterval" : 6,
"ConnectName" : "azurecs",
"PayloadFormat": "{ \"v\" : [ %jb ] }",
"BulkElementFormat": "{ \"ts\" : %t, \"%jd:%js\" : %jv }"
}
}
Creation date: 11/12/2019 14:09 (skr@secomea.com)      Updated: 18/03/2020 08:28 (tvo@secomea.com)