# MQTT

MQTT is the most popular IoT cloud protocol. YuDash IoT device acts as MQTT client which sends data to various IoT platforms in a seamless manner. Two-way communication for receiving command from cloud is also available.

**Following are the steps to use MQTT as cloud protocol.**

### Selection of MQTT As Cloud Protocol in YuDash IoT Device

<figure><img src="https://1858257737-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FToww5EM1cml3ouN6fvnJ%2Fuploads%2F3uktBrRfXrmtjk0BG545%2FCLOUD_SELECTION.PNG?alt=media&#x26;token=6df17842-0bce-4cb1-9e5d-9072cfbdcb14" alt=""><figcaption></figcaption></figure>

### MQTT Credentials

Following are the settings in LYNX to configure connection to MQTT server:

<figure><img src="https://1858257737-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FToww5EM1cml3ouN6fvnJ%2Fuploads%2FrBvok0wR9dC446kJeE7D%2Fmqtt_snap1.jpg?alt=media&#x26;token=0eeefe76-418e-47a3-9289-3e4b1cb88fb8" alt=""><figcaption></figcaption></figure>

<table><thead><tr><th width="230">MQTT Setting</th><th>Description</th></tr></thead><tbody><tr><td><strong>MQTT Server (Broker)</strong></td><td>The URL of MQTT broker is accessible on network. Alternately, unique IP address can be provided. This may be required for a local deployment.</td></tr><tr><td><strong>MQTT Port</strong></td><td>The IP port running MQTT server. Typically 1883</td></tr><tr><td><strong>MQTT User name</strong></td><td>Client user name for MQTT broker - Based on server, it may be blank or Access Tokens are used as user name.</td></tr><tr><td><strong>MQTT Password</strong></td><td>Client password for MQTT broker. Based on server, it may be blank or Access Tokens are given in password. </td></tr><tr><td><strong>MQTT Client Name</strong></td><td>Client name for MQTT broker. It may be simply blank is most cases, unless specified by server.</td></tr><tr><td><strong>MQTT Publish Topic</strong></td><td>The MQTT topic to publish data to. In many cases, it will contain and API name and may include unique serial number of device or variable.</td></tr><tr><td><strong>MQTT Platform Name</strong></td><td>MQTT Platform Name: Generic platform name. It is for information or display purpose only. It is not used in communication.</td></tr></tbody></table>

{% hint style="info" %}
Depending on API and authentication mechanism in MQTT broker of IoT platform, some of entries may be blank.
{% endhint %}

Following is the example for MQTT integration with popular Tago.io IoT platform:

<figure><img src="https://1858257737-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FToww5EM1cml3ouN6fvnJ%2Fuploads%2FdMr5QDVEIt0nuOxzLxgT%2Fmqtt_example1.jpg?alt=media&#x26;token=b8eae4ae-5f19-4cec-9cad-d756bfd7c09f" alt=""><figcaption></figcaption></figure>

### MQTT with SSL/TLS secure layer

YuDash IoT devices support SSL/TLS based secure communication. Please refer to [SSL/TLS for MQTT](https://docs.yudash.com/device-to-cloud-api/ssl-tls#enabling-ssl-tls-for-mqtt) documentation for enabling the security layer.
