Skip to content

AzureSphere Exporter Component

The AzureSphere Exporter component is supported only on AzureSphere devices.

The AzureSphere Exporter component does the following:

  • Exports data to and from Azure IoT Hub and Digital Twins
  • Subscribes to device data on multiple Bus topics, each of which correspond to a device
  • Publishes data to devices on multiple Bus topics, each of which correspond to a device
  • Supports Raw and Device data formats
  • Supports configuration of XRT using Azure device twin desired state

AzureSphere Exporter Configuration Variables

The following table describes the configuration variables that can be used with the AzureSphere Exporter component:

Parameter Type Description Valid Values Required
Bus String The name of the Bus component to use The name of an existing Bus component Y
Logger String The name of the Logger component to use The name of an existing Logger component N
WorkPeriod Unsigned Integer The polling interval of the Azure Cloud in milliseconds Default 100 milliseconds N
ConnectionType Enum Specifies the device connection mechanism for connecting the device to the IoT Hub

Specify DPS to connect using the Device Provisioning service

Specify DAA to connect directly

Note: IOTech recommends that you use DPS.
Valid values are as follows:
  • DPS (default)
  • DAA
N
HostName String The host name of the Azure IoT Hub A valid host name for the Azure IoT Hub Y
DeviceID String The device identifier of the AzureSphere device A valid device ID Y
ScopeID String The scope identifier of the Azure Device Provisioning service A valid DPS scope ID Y
UseDeviceTwin Boolean Specifies whether to use Azure device twin for XRT configuration

Specify true to use device twin configuration

Specify false to use compiled in configuration
Valid values are as follows:
  • true (default)
  • false
N
MaxConnectionRetries Unsigned Integer Specifies the number of attempts to connect to Azure Cloud to obtain device twin desired properties. This configuration variable is only used if device twin is enabled and desired properties have been previously obtained. If device twin is enabled and desired properties have not been previously obtained then connection attempts will continue until a successful connection is made. Any non-zero positive integer. Default is 20. N
MaxConnectionDelay Unsigned Integer Specifies the maximum delay between connection retries in seconds. The delay starts at 00.1 seconds and doubles after each attempt. Maximum delay in seconds. Default is 4. N
NetworkReadyRetries Unsigned Integer Specifies the number of times to check for the Azure Sphere device's network interface rreadiness. The azure sphere device is rebooted if the maximum number of check is reached. Any non-zero positive integer. Default is 500. N
NetworkReadyDelay Unsigned Integer Specifies the maximum delay between network ready checks in microseconds. Any non-zero positive integer. Default is 1000000. N
Interface String The network interface used to connect to the Azure IoT Hub A valid DPS name of the supported AzureSphere device network interface

Default is wlan0
N
Devices Array An array of device configurations that are connected through the AzureSphere exporter to the Azure IoT Hub See Device Parameter Configuration Variables below Y

Device Parameter Configuration Variables

The following table describes the configuration variables that can be used with the AzureSphere Devices parameter:

Parameter Type Description Valid Values Required
Name String The device name A valid device name Y
Topic String The Bus topic on which the device publishes data A valid Bus topic name Y
Pattern String The Bus pattern on which the device receives updates A valid Bus pattern Y
Format Enum The default JSON encoding used for data sent to, or received from, the device Valid values are as follows:
  • Device
  • Raw (default)
N
TwinID String The IoT Hub digital twin identifier

Used to map data from a device to its digital twin

If not set, the value of the Name parameter is used as the twin identifier
A valid digital twin device ID N

AzureSphere Exporter Configuration Example

The following example configures an AzureSphere export component:

{
  "Bus": "bus",
  "Logger": "logger",
  "ConnectionType": "DPS",
  "HostName": "IOTechHub.azure-devices.net",
  "DeviceID": "558322ad3db3c1b5a7bcc347df64c2c1b82b4f44def6024e11d47e0a2114f8b02...",
  "ScopeID": "0ne243345...",
  "Interface": "wlan0",
  "Devices": [
    {
      "Name": "mt3620",
      "Topic": "device/mt3620/input",
      "Pattern": "device/mt3620/output",
      "Format": "Raw",
      "TwinID": "437862464635675558322ad3dd0bff044dcdf64c2c1b82b4f44def6024e11d47e0a..."
    },
    {
      "Name": "damocles-0002b503c1ec",
      "Topic": "device/modbus/input",
      "Pattern": "transform/lua/output",
      "Format": "Device"
    }]
}
Back to top