Azure Iot Edge Hub Transmit

An azure iot edge hub transmit (connects to an Azure IoT Edge instance). This client should be used in nested instances, or when module routing is required.

Example:

If we want to upload our records from the bathhouse:water stream to our IOT cloud, going through an IoT edge HuB endpoint, the config will look like this:

{
    "data_transmit": [
        {
            "transmit_name": "iot_hub_transmit",
            "transmit_type" : "edgehub",
            "filter_stream": [
                "bathhouse:water"
            ]
        }
    ]
}

Authentication is performed via IoTEdge System Runtime Environment Variables.

Configuration:

Required and optional properties that can be configured for the transmit:

  • additional_fields: additional field to add in the message payload for e.g. { “processingPath”: “SM”}

  • use_websockets: Option to connect to MQTT over websockets (Defaults to False)

  • edge_env_override: Override the environment variables used to connect to the edge runtime. Use the same keys as the environment variables, e.g.

    "edge_env_override": {
        "IOTEDGE_IOTHUBHOSTNAME": "10.1.1.2",
        "IOTEDGE_DEVICEID": "mydevice"
    }
    
  • transmit_name: ID for the transmit. It must be unique.

  • transmit_type: Method to use in transmitting records.

  • filter_stream: A list of streams that will use the transmit. Each stream can either be * (all) or asset:stream.

  • timeout: Number of seconds to wait until timing out.

  • poll_interval: Maximum number of seconds to wait between requests

  • max_request_records: Maximum number of records to send in a single request.

  • max_request_size_bytes: Maximum number of bytes allowed in a single request. Size is capped at 4 MB.

  • opc_payload_metadata: Additional fields to add in the OPC-formatted payload. E.g. { “TiqTwin”: { “NodeId”: “a2ec725a-78e2-431b-a124-ce20b8e3e4c6” }} Ignored if use_opc_publisher_format is False.

  • opc_message_metadata: Per-message metadata fields to add in the OPC-formatted payload.

  • use_opc_publisher_format: If True, the message payload will be formatted to mimic OPC Publisher. https://github.com/Azure/Industrial-IoT/tree/main/docs/opc-publisher#opc-publisher-telemetry-formats