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 corresponds to a device
  • Publishes data to devices on multiple Bus topics, each of which corresponds to a device
  • Supports Raw and Device data formats

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
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"
    }]
}