How can I ensure that the graph accurately reflects the data sent during periods when the code encounters interruptions and resumes transmission?

Bijay SUBEDI 20 Reputation points
2024-04-14T23:34:26.8966667+00:00

I have got a system set up with Microsoft Azure IoT Central and have devices setup that's supposed to send data for creating graphs. Sometimes, the system stops working, meaning it doesn't send any data. But when you restart it, it sends all the missed data. However, even though the data gets sent, the graph doesn't show any of it. For example, if you restart the system at 5 AM, it sends data from 11 PM to 5 AM, but the graph doesn't display any of that data.

I am using Python SDK and have used

message.properties.add('iothub-creation-time-utc', timestamp);

In the code. Is there a way I can get the data shown in the graphs?

Azure IoT Central
Azure IoT Central
An Azure hosted internet of things (IoT) application platform.
344 questions
Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,120 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Sander van de Velde 28,466 Reputation points MVP
    2024-04-15T04:53:03.6733333+00:00

    Hello @Bijay Subedi ,

    welcome to this moderated Azure community forum.

    You want to show the data in the exact order as generated by the sensor.

    You are able to store historical data with the correct timestamp and send it with that timestamp.

    You use the EventData application (aka user) properties for this which is a fair way to add context to the message.

    You can run into a challenge to read that timestamp property back when the message arrives there where your graph is generated.

    I could not find documentation saying IoT Central is capable to map that application (aka user) properties to the model so I expect it is not mapped thus ignored.

    The IoT Central device model is great for Azure IoT Device registration device twin and message body support.

    Can you make the timestamp part of the actual body?


    If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.


  2. Dom 1,546 Reputation points Microsoft Employee
    2024-04-15T08:36:59.7333333+00:00

    Hi @Bijay SUBEDI - thanks for getting in touch.

    Can you confirm that IoT Central is receiving the missed data after you restart the system? You can view all the data received by IoT Central on the "Raw Data" tab for the device:

    User's image

    When you say the missed data isn't displayed on the graph, do you mean the Data Explorer in IoT Central? If IoT Central is receiving the missed data but not plotting it on the graph, you can try exporting it using the Data Export capability and then using a more customizable tool such as PowerBI to plot your data.