Keep-alive timeout for IoTHub connection without device SDK

Anders Nordberg Lauritsen 26 Reputation points
2024-08-28T07:12:22.97+00:00

I am connecting to IoT Hub using an embedded solution, that does not support the device SDK. The solution is using a GSM modem, where the interaction with IoT Hub is implemented by AT commands.

Authentification is x509 certificates (no SAS token).

My question is; what it required to keep-alive the MQTT connection? Do I need to publish to a specific topic or do I reconnect from scratch, in regular intervals? Does the IoTHub provide keep-alive pings?

Azure IoT
Azure IoT
A category of Azure services for internet of things devices.
402 questions
Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,209 questions
Azure IoT SDK
Azure IoT SDK
An Azure software development kit that facilitates building applications that connect to Azure IoT services.
224 questions
0 comments No comments
{count} votes

Accepted answer
  1. Sander van de Velde | MVP 33,231 Reputation points MVP
    2024-08-28T09:58:02.68+00:00

    Hello @Anders Nordberg Lauritsen ,

    welcome to this moderated Azure community forum.

    The Azure IoT Hub is a cloud gateway capable of connection large number of devices, each with their own credentials, using several protocols. Next to device-to-cloud connectivity, cloud-to-device connectivity is also offered.

    The IoT Hub offers communication over MQTTs but does not implement a generic MQTT broker. Only a specific subset of topics are supported.

    Although the examples are written in C#, this blog post describes all topics used and the purpose of them.

    Keep in mind you need to implement the Digicert Global G2 root (public) certificate. This is used for the TLS security of the communication. Make sure your device understands this too.

    Regarding the keep-alive pings, I have not come across this in the documentation. I expect this is out of scope for the IoT Hub because this is solved by the underlying MQTT broker and client connection themselves.

    If you want to do plain MQTT to the cloud with free topic selection, I recommend the MQTT support of the EventGrid Namespace.

    This MQTT broker supports both MQTT V3.1.1 and MQTT V5 features. including keep-alive and LWT.


    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.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.