1
votes

I recently started a project with Azure IoT Edge with the IoT Hub Free Tier so I'm a total beginner. I set up a device sensor, a module and I am sucessfully sending data to my module and IoT Hub. I can monitor the messages sent from the sensor with Azure IoT Hub expension from Visual Studio Code.

I can see the messages I'm sending but I am having an issue with the number of messages being sent. I use Azure portal metrics to monitor the number of messages sent and very often Azure would show me different numbers as I refresh. For example "1000" messages and after a refresh "800" messages etc...

Another issue I'm having is also that when using the Metrics functionality, it shows me that some messages are being sent during a time where my sensors weren't sending any messages.

Is there a way to get a detailled report with a history on the messages that the Hub receives?

Any help or advice would be highly appreciated! Thank you

1

1 Answers

1
votes

As far as I know there is no "nice and simple" report which will show you what you need. However, if you want to get historical events which IoT hub processed it can be done. Note, though, that history is limited and can be no longer than 7 days. Current retention period can be seen on the azure portal in "Built-in endpoints" section - there is a "Retain for" setting with the value from 1 day (default) to 7 days.

If events are within this range, you can use Powershell command "az iot hub monitor-events" with the --enqueued-time parameter to "look back" in history. The time is specified in milliseconds since unix epoch. Example command:

az iot hub monitor-events --hub-name 'your_iot_hub_name' --device-id  'your_registered_device_id'  --properties all --enqueued-time 1593734400000