[ { "id": "ex05-tab", "type": "tab", "label": "Azure: 05 Device twin X.509", "info": "Direct IoT Hub device-twin access with X.509. Can run outside Edge. Requires externally configured identity, certificate chain and key; no Module Client or routes." }, { "id": "ex05-intro", "type": "comment", "z": "ex05-tab", "name": "Start here: direct X.509 DEVICE identity", "info": "No Module Client or Edge workload required. Before starting Node-RED, configure IOTEDGE_IOTHUBHOSTNAME, IOTEDGE_DEVICEID, PATH_TO_CERTIFICATE_FILE and PATH_TO_KEY_FILE (README). Provision/trust the device certificate in IoT Hub and mount readable PEM certificate/key files read-only. Never paste keys into this flow. Use only one Device Client for this device identity, with no competing process. Deploy, inspect desired properties, change a desired property in IoT Hub, then press Report device state and verify reported.deviceStatus on the DEVICE twin. No message routes are required. Startup/config errors may only appear in logs; Catch is not a replacement. Review Debug output before production use.", "x": 330, "y": 60, "wires": [] }, { "id": "ex05-client", "type": "device-client" }, { "id": "ex05-report", "type": "inject", "z": "ex05-tab", "name": "Report device state", "props": [{ "p": "payload" }, { "p": "topic", "vt": "str" }], "payload": "{\"deviceStatus\":\"running\"}", "payloadType": "json", "topic": "", "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "x": 180, "y": 140, "wires": [["ex05-twin"]] }, { "id": "ex05-twin", "type": "device-twin", "z": "ex05-tab", "client": "ex05-client", "x": 450, "y": 140, "wires": [["ex05-desired-debug"]] }, { "id": "ex05-desired-debug", "type": "debug", "z": "ex05-tab", "name": "Desired device state/patch (topic: desired)", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "x": 770, "y": 140, "wires": [] }, { "id": "ex05-catch", "type": "catch", "z": "ex05-tab", "name": "Device Twin error", "scope": ["ex05-twin"], "uncaught": false, "x": 170, "y": 240, "wires": [["ex05-error-debug"]] }, { "id": "ex05-error-debug", "type": "debug", "z": "ex05-tab", "name": "Reported update failed: msg.error", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "x": 510, "y": 240, "wires": [] }, { "id": "ex05-complete", "type": "complete", "z": "ex05-tab", "name": "Reported update completed", "scope": ["ex05-twin"], "uncaught": false, "x": 210, "y": 300, "wires": [["ex05-complete-debug"]] }, { "id": "ex05-complete-debug", "type": "debug", "z": "ex05-tab", "name": "Device update SDK completion", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "x": 510, "y": 300, "wires": [] }, { "id": "ex05-status", "type": "status", "z": "ex05-tab", "name": "Device Twin status", "scope": ["ex05-twin"], "x": 180, "y": 360, "wires": [["ex05-status-debug"]] }, { "id": "ex05-status-debug", "type": "debug", "z": "ex05-tab", "name": "Device twin status", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "status", "x": 470, "y": 360, "wires": [] } ]