Azure IOT Hub: messages send when device is doing nothing

Kevin Tahon 86 Reputation points
2020-10-28T15:28:21.94+00:00

Hi,

We're concerned about following behaviour:
We've configured Iot Hub with 1 IoT edge device.
The device is currently running, but we're doing no actions on the device (no twin updates, no sending message, ...).
Only 1 message by 2 hours for telemetry but that's all.

If we look at the IoT Hub Usage of today we see 399 messages used today, but we're not performing any action on that device. (look at the picture in attachment).

Does anyone already know this behavior and tell us what kind of messages it's sending or does anyone know how we could see the content of this messages?

Kind regards,

Kevin Tahon

35783-image.png

Azure IoT Edge
Azure IoT Edge
An Azure service that is used to deploy cloud workloads to run on internet of things (IoT) edge devices via standard containers.
531 questions
Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,112 questions
0 comments No comments
{count} vote

Accepted answer
  1. QuantumCache 20,031 Reputation points
    2020-10-28T22:30:10.13+00:00

    Hello @Kevin Tahon , Thanks for reaching out to us!.

    Have you referred to Monitoring Azure IoT Hub data reference and Monitoring Azure IoT Hub

    Please make use of the 'IoT Hub Metrics section' to see the tracked message count. Below sample image showing the Metrics section.

    35768-image.png

    • Telemetry messages sent ==>Number of device-to-cloud telemetry messages sent successfully to your IoT hub
    • Routing: messages delivered to messages/events ==>The number of times IoT Hub routing successfully delivered messages to the built-in endpoint
      (messages/events). This metric only starts working when routing is enabled (https://aka.ms/iotrouting) for the IoT hub.
    • Commands completed ==>Number of cloud-to-device commands completed successfully by the device.
    • Telemetry message send attempts ==>Number of device-to-cloud telemetry messages attempted to be sent to your IoT hub.

    To Troubleshoot this scenario: Please confirm on below ask.

    What were the metrics [Message count] when the device is disabled or shutdown?

    Do you still see message count during this turned-off scenario?

    Please let us know immediately if you need further help in this matter.

    Updated:11/24/2020 Outcome of support team's resolution.

    These messages (mostly GetTwin and update Reported properties in your case) are part of normal IoT Edge device operations and they can be tweaked at the cost of slower responsiveness from the Edge device by using the Env Variables (especially MinTwinSyncPeriodSecs and ReportedPropertiesSyncFrequencySecs

    ) described here:

    https://github.com/Azure/iotedge/blob/master/doc/EnvironmentVariables.md

    They are part of the direct costs of using edge device. However they count little against the daily quota which minimum is of 400K messages per day and it should not reflect much in the final costs of the IoTHub if the daily quota is not exceeded.


1 additional answer

Sort by: Most helpful
  1. Kevin Tahon 86 Reputation points
    2020-10-29T13:06:29.32+00:00

    Hello @QuantumCache ,

    We are using the metric “Total number of Messages Used” and we noticed that approximately 40messages/hour are logged (or 960messages/day!).

    Even more unexpected it that disabling the device has no impact on this.
    36055-metrics.jpg

    To avoid side effects we:

    1. Are running only edheHub and edgeAgent on the edge device
      36112-iotedgelist.jpg
    2. Have disabled all our backend services
    3. Did not run Twin related queries via the portal, or other tools…
    4. Disabled Message Routing
    5. Have no event subscriptions defined

    After enabling debug logging on device (by adding RuntimeLogLevel: "debug" to config.yaml), we noticed that the event hub is updating the reported properties approximately every 5-6 minutes:

    {"log":"\u003c7\u003e 2020-10-29 10:49:13.711 +01:00 [DBG] [Microsoft.Azure.Devices.Edge.Hub.CloudProxy.ConnectivityAwareClient] - Operation UpdateReportedPropertiesAsync succeeded for 200000403/$edgeHub\r\n","stream":"stdout","time":"2020-10-29T09:49:13.7113009Z"}

    {"log":"\u003c7\u003e 2020-10-29 10:54:13.854 +01:00 [DBG] [Microsoft.Azure.Devices.Edge.Hub.CloudProxy.ConnectivityAwareClient] - Operation UpdateReportedPropertiesAsync succeeded for 200000403/$edgeHub\r\n","stream":"stdout","time":"2020-10-29T09:54:13.8536403Z"}

    Could this be the reason for the unexpected message count? Is there a way to decrease the amount of these messages?

    --------------------

    Besides this we noticed even higher messages counts/day (3000/msgs/day) if we enable our backend iot solution. We are aware of the fact that backend queries and twin reads/write also affect the message count, but just to be sure, can you confirm the following please?

    (based on the documentation: https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-pricing#charges-per-operation)
    Message count is affected by:

    • Device to cloud messages
    • Cloud to device messages
    • File uploads
    • Direct methods
    • Device and module twin reads/update (from device side AND from backend side)
    • Device and module twin queries

    But what about?

    • Message routing
    • Event routing (via EventGrid) for device (dis)connected, created, delete events
      Do these features also affect the message count?
    1 person found this answer helpful.