Device messages are being used but are not forwarded to builtin endpoint in Azure IOT Hub

434 Views Asked by At

I am a novice using Azure Iot Hub, and am trying to send messages from an Azure Sphere device to IotHub.

If I look at the Metrics section in IotHub, i can see tht for the metric "Total Number of messages used", records are indeed arriving.

If however I look at the "Routing Messages Delivered to messages/events", I can see that none were delivered.

enter image description here

I did not add any custom routing in iothub, so it should be using the built-in endpoint to insert the messages, correct?

Furthermore, I can see the data if I go to "Query explorer" , but I don't see any events when using the az iot hub monitor-events --hub-name HubName --output table` command.

What could possibly be causing this? Do I need to explicitly redirect the messages to the built-in endpoint?

Thank you.

2

There are 2 best solutions below

0
On BEST ANSWER

Turns out it was an error in my device twins JSON configuration. There was a key that was lower case but should be upper case, and was preventing the device from sending telemetry.

0
On

Built-in endpoint is only exposed using the AMQP protocol on port 5671 and AMQP over WebSockets on port 443. If you use Event Hubs SDKs or product integrations that are unaware of IoT Hub, you need an Event Hub-compatible endpoint and Event Hub-compatible name.

Once a route is created, data stops flowing to the built-in-endpoint, unless a route is created to that endpoint. To ensure messages continues to flow to the built-in-endpoint if a new route is added, configure a route to the events endpoint.

Further, the fallback route sends all the messages that don't satisfy any of the query conditions on any of the existing routes to the built-in-Event Hubs (messages/events), that is compatible with Event Hubs. If message routing is turned on, you can enable the fallback route capability. If there are no routes to the built-in endpoint and a fallback route is enabled, only messages that don't match any query conditions on routes will be sent to the built-in-endpoint. Also, if all existing routes are deleted, the fallback route must be enabled to receive all data at the built-in-endpoint.