Sridev
Sridev

Reputation: 33

Desired Properties Update From IoT Edge Module

Is it possible to update Azure IoT Edge Desired Properties Update From Azure Module.

Here is what i want to do :

Let us say i have below json in deployment manifest of my IoT Edge Device

"$edgeHub": {
      "properties.desired": {
        "schemaVersion": "1.0",
        "routes": {
          "sensorToFilter": "FROM /messages/modules/SimulatedTemperatureSensor/outputs/temperatureOutput INTO BrokeredEndpoint(\"/modules/filtermodule/inputs/input1\")",
          "filterToIoTHub": "FROM /messages/modules/filtermodule/outputs/output1 INTO $upstream"
        },
        "storeAndForwardConfiguration": {
          "timeToLiveSecs": 10,
          "lastSyncDt" : "2019-08-19 17:06:33:323"
        }
      }
    }

Question is, is it possible to update "lastSyncDt" to new datetime value from iot edge module during runtime.

Thanks in advance.

Upvotes: 1

Views: 1647

Answers (1)

Alex Pshul
Alex Pshul

Reputation: 702

Yes, you should be able to update everything you need using the SDK.
Here is a link to the .NET SDK for the device client: https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-csharp-csharp-twin-getstarted#create-the-device-app
I've pointed out the specific part of the device part of the document.

But, keep in mind, the idea of the device twin is a bit different.
If someone wants to update the device twin from the outside, you update the desired property.
The device listens to changes on these properties, do some work and updates the reported properties.
The IoT hub can emit these events and let you listen to reported properties changes so you can react to them.

The classic example is the device firmware version:

  • You decide to update the firmware version
  • You change the desired property of the device firmware version
  • The device listens to the change, and starts the update process
  • After the update completes, the device updates the reported property of the device firmware version to the new version

Upvotes: 1

Related Questions