How to connect smart TV to Azure IoT Central through mqtt protocol

Goddeti Dhanasekhara Reddy 20 Reputation points
2023-05-29T15:15:44.39+00:00

I would like to connect Smart TV to Azure IoT central through mqtt protocol. For this I found one mqtt client(MQTT Home) app which is available in the Smart TV.That mqtt client app is asking for the Host, Port, username and Password. I have entered all the required details which I have taken from the Azure IoT Central in the mqtt client app. After entering the details it is showing error in the client app. I followed one official article to connect mqtt box to Azure IoT central in this whole process:https://learn.microsoft.com/en-us/answers/questions/234188/connect-to-iot-central-app-directly-mqtt-without-s. Can anyone guide me to connect smart TV to Azure IoT central.

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

2 answers

Sort by: Most helpful
  1. chbeier 1,866 Reputation points
    2023-05-30T09:06:11.49+00:00

    Hello @Goddeti Dhanasekhara Reddy ,

    While using Azure IoT services under the hood, IoT Central is SaaS what does not directly expose the built-in IoT Hub device endpoint and uses DPS to provide the "current" connection string to the devices trying to connect. Saying this, while it is technically possible to retrieve the connection string and use it with a native MQTT client, it is recommended to use the Azure IoT Device SDK for connecting to IoT Central. I believe for a Smart TV this is not an option as you might not be able to install the Azure IoT Device SDK.

    Why do you need IoT Central? If IoT Hub is an option, you can follow the instructions to communicate via MQTT with IoT Hub and build your custom visualization with a webapp or use Power Bi.

    Alternatively, you can follow a bridging approach where your Smart TV connects to an intermediate service what provides a standard MQTT Broker and forwards the messages via the Azure IoT Device SDK to IoT Central. This intermediate bridging service could run on a Raspberry PI or any other computer in the LAN of your Smart TV or a cloud service providing a central approach for multiple distributed devices. While the concept is outlined in the documentation and sample code for Sigfox and The Things Network exist on GitHub, you would need to build your own custom bridging service.

    0 comments No comments

  2. Dom 1,466 Reputation points Microsoft Employee
    2023-05-30T09:34:30.41+00:00

    Internally, IoT Central uses a Device Provisioning Service (DPS) instance, and an IoT Hub instance.

    For a device to connect to an IoT Central application it must first connect to DPS. DPS returns the IoT Hub connection information to the device. The device can then connect to your IoT Central application.

    Before you can call the DPS REST API, you need an access token. See https://learn.microsoft.com/azure/iot-dps/iot-dps-https-sym-key-support#create-a-sas-token for one way to do this. Note that the dps_id_scope is the ID scope value from your IoT Central application, dps_registration_id is the Device ID from your IoT Central application, and device_key is the Primary key from your IoT Central application. You can find these three values by selecting your device in IoT Central and then selecting Connect:

    enter image description here

    You now have a SAS token that you can use to complete the DPS registration process for your device. Note that you'll need to make two REST call to retrieve the IoT Central connection information, see: https://learn.microsoft.com/azure/iot-dps/iot-dps-https-sym-key-support#register-your-device

    From the second call, you'll get the assigned IoT hub that's inside your IoT Central application.

    You can now generate a SAS token for your device to use for communicating with your IoT Central application: https://learn.microsoft.com/azure/iot-dps/iot-dps-https-sym-key-support#create-a-sas-token-for-your-iot-hub

    This document shows you how you can use the assigned hub and SAS token to connect to your IoT Central application: https://learn.microsoft.com/azure/iot/iot-mqtt-connect-to-iot-hub#using-the-mqtt-protocol-directly-as-a-device.

    0 comments No comments