# Test MQTT Connection

### MQTT Client

Now user can use MQTT Client option to establish a MQTT connection and to perform pubsub operations. Go to **Experiment** section from left menu of dashboard and choose **MQTT Client**.&#x20;

Here user need to enter same **Client ID**, **Username** and **Password** used while adding a device.

{% hint style="info" %}
Username will be the Device Key starting with your account ID.The Client ID and Password will be the same you have entered during [**Add Device**](/mqtt/add-mqtt-device.md) process.&#x20;
{% endhint %}

![MQTT Test Client](/files/FBlb7Qcqm1KydVsy1gNJ)

#### Subscribe to topic

User can subscribe to a topic which he has mentioned while adding device to account.

{% hint style="info" %}
User has to make sure he has chosen *sub* or *pubsub* option to given topic.
{% endhint %}

![Subscribe to MQTT Topic](/files/R0TKAejZezpLEwXmmOUA)

#### Publish to topic

User can publish to a topic which he has mentioned while adding device to account.

{% hint style="info" %}
User has to make sure he has given *pub* or *pubsub* option to given topic.
{% endhint %}

![Publish to MQTT Topic](/files/iXXJQjv08vxYVxLxSB9Q)

User can see the list of *Message already sent* and *Messages Received* in side section.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.thingsup.io/mqtt/test-mqtt-connection.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
