Connect to IoT Central app directly MQTT without SDK

Suresh, Albin 36 Reputation points
2021-01-18T07:02:34.243+00:00

I would like to connect my devices to my IoT Central application directly using MQTT protocol without using any SDK. I found some official instructions on how to connect a device to IoT Hub directly with MQTT here: https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-mqtt-support but I can't find anything similar for IoT Central.

I want to strictly avoid the usage of any language SDK and want to get this done directly using MQTT protocol. For testing purposes I'm using a general purpose MQTT toolbox called MQTTBox. I want to connect that tool to a device registered using a Device Capability Model on IoT Central and send test measurements with it. Can someone provide some instructions?

Azure IoT Central
Azure IoT Central
An Azure hosted internet of things (IoT) application platform.
345 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Roman Kiss 2,241 Reputation points
    2021-01-18T09:45:33.65+00:00

    Hi,

    The MQTT device can be connected directly to the IoT Central App based on its device connection string which is necessary to generate in advance.

    This link shows an example how to generate a necessary data for device connectivity to the IoT Central App, such as generating a hostname of the internal IoT Hub and the device sasToken.

    The following screen snippet shows an example of the MQTT device11 connectivity using the MQTTBox client, where:

    Host = iotc-954aeb54-6bdd-435e-8f71-49d8c712c89a.azure-devices.net:8883
    Username = iotc-954aeb54-6bdd-435e-8f71-49d8c712c89a.azure-devices.net/device11/?api-version=2020-09-30&model-id=dtmi:rk2021iotcfree:abba1mg;2
    Password = <sasToken>

    57653-mqttboxclient.png

    The next screen snippet shows a connected device11 to the IoT Central App and its published telemetry data:

    57661-capture1.png

    Another example of the connectivity MQTT device to the IoT Central App using a direct protocol is the Azure IoT Hub Tester:

    57570-tool1.png

    and finally, the following screen snippet shows a device11 dashboard on the IoT Central App:

    57607-iotc1.png

    Thanks
    Roman

    3 people found this answer helpful.