Azure IoT Edge Nodes
When MaestroHub runs as an Azure IoT Edge module, these nodes talk to the local edge hub: Send to Output hands a message to the edge hub's routes, Twin Report updates the module twin's reported properties, Read Twin reads the twin, and Respond to Direct Method answers a method call. Everything goes to the edge hub on the device, so the nodes keep working while the device is offline from Azure.
Configuration Quick Reference
| Field | What you choose | Details |
|---|---|---|
| Parameters | Connection, Function, Function Parameters, Timeout Override | Select the Azure IoT Edge connection and a function, fill its ((parameters)) with expressions, and optionally override the timeout. |
| Settings | Description, Timeout (seconds), Retry on Timeout, Retry on Fail, On Error | Node description, maximum execution time, retry behavior and error handling. All execution settings default to pipeline-level values. |
Send to Output
Supported Function Types:
| Function Name | Purpose | Common Use Cases |
|---|---|---|
| Send to Output | Send a message on a named module output | Telemetry to IoT Hub through $upstream, features for a local analytics or AI module |
How It Works
- The node resolves the function's
((parameters)). - It sends the message on the module output, with its properties, over the connection's session with the edge hub.
- At QoS 1 it waits for the edge hub to acknowledge before completing.
Success means the edge hub accepted and stored the message. Routes then deliver it; a message whose output no route matches is dropped by the edge hub, and a module cannot see its routes. Check result.outputName against the deployment's routes.
If the edge hub cannot be reached, the send fails as a retryable error and Store & Forward holds the message until the connection is back. A message over 256 KB, an invalid output name or a reserved property name is refused permanently and never retried: with Store & Forward enabled on the connection, the node completes with the message buffered and it goes straight to the dead-letter queue; without Store & Forward, the node fails.
Output
| Expression | Description |
|---|---|
$node["Name"].result.outputName | The module output the message was sent on |
$node["Name"].result.topic | The MQTT topic published to, properties included |
$node["Name"].result.bytesWritten | Body size in bytes |
$node["Name"].result.qos | The QoS the message was sent with (0 or 1) |
$node["Name"].result.messageId | The message ID sent: the one you set, or a generated unique ID when the field is empty |
{
"result": {
"outputName": "telemetry",
"topic": "devices/factory-edge-01/modules/maestrohub/messages/events/%24.on=telemetry&%24.mid=7f1c-01&%24.ct=application%2Fjson&%24.ce=utf-8",
"bytesWritten": 156,
"qos": 1,
"messageId": "7f1c-01"
}
}
Twin Report
Patches the reported properties of MaestroHub's module twin. A null value deletes a property. The edge hub keeps the patch while the device is offline and syncs it later.
| Expression | Description |
|---|---|
$node["Name"].result.statusCode | The status the edge hub answered with — 204 means accepted |
$node["Name"].result.version | The reported-properties version after the patch, when the edge hub says |
$node["Name"].result.bytesWritten | Patch size in bytes |
A patch over 32 KB is refused permanently and never retried, in the same way.
Read Twin
Reads the module twin: the desired properties set from the cloud, the reported properties, or both, each with its $version.
| Expression | Description |
|---|---|
$node["Name"].result.section | Which part of the twin was requested: all, desired or reported |
$node["Name"].result.desired | The desired properties, with their $version — present unless section is reported |
$node["Name"].result.reported | The reported properties, with their $version — present unless section is desired |
{
"result": {
"section": "all",
"desired": { "sampling": "5s", "$version": 4 },
"reported": { "version": "3.0.1", "$version": 12 }
}
}
Respond to Direct Method
Answers a direct-method call that started the run through the Azure IoT Edge Method Trigger. Map Request ID from {{ $trigger._metadata.requestId }}, and set a status and a JSON payload (up to 128 KB; text that is not JSON is sent as a JSON string).
A call is answered once. Answering fails, and is not retried, when the call was already answered, when its response budget ran out (the caller got 504), or when the connection to the edge hub restarted since the call arrived (the caller got 503). This node is never buffered by Store & Forward: an answer is only useful while the caller waits.
| Expression | Description |
|---|---|
$node["Name"].result.requestId | The direct-method call that was answered |
$node["Name"].result.status | The status returned to the caller |
$node["Name"].result.bytesWritten | Answer payload size in bytes |
Every node also delivers its call facts under _metadata: $node["Name"]._metadata.method, $node["Name"]._metadata.connectionId and $node["Name"]._metadata.protocol (azureiotedge).
To run a pipeline for each message routed to a MaestroHub input, or for each desired-property change, use the Azure IoT Edge Triggers. The connection is set up in the connection guide.