0

I'm developing small IoT app using IoT Central. below is my device DCM

enter image description here

I'm sending telemetry & property data using .Net simulator, but I cannot see TelemetryInterval property data in Azure IoT Central. (Telemetry data visible properly)

Simulator Code

var telemetryDataPoint = new
            {
                MessageTime = messageTime,
                Moisture = randMoisture
            };
            var telemetryDataString = JsonConvert.SerializeObject(telemetryDataPoint);

            //set the body of the message to the serialized value of the telemetry data
            var message = new Message(Encoding.ASCII.GetBytes(telemetryDataString));

            message.Properties.Add("TelemetryInterval", "10");
            message.ContentEncoding = "utf-8";
            message.ContentType = "application/json";
            message.MessageId = Guid.NewGuid().ToString();
            await deviceClient.SendEventAsync(message);

enter image description here

Pankaj Rawat
  • 4,037
  • 6
  • 41
  • 73

1 Answers1

0

I'm able to fix this.

This is reported property of device twin, We can use TwinCollection to update this property.

private static async void SendTwinData()
    {
        var twinProperties = new Microsoft.Azure.Devices.Shared.TwinCollection();
        twinProperties["TelemetryInterval"] = "2";
        await s_deviceClient.UpdateReportedPropertiesAsync(twinProperties);
    }
Pankaj Rawat
  • 4,037
  • 6
  • 41
  • 73