> For the complete documentation index, see [llms.txt](https://docs.eseye.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.eseye.com/smartconnect/at-command-reference/mqtt-at-commands.md).

# MQTT AT commands

AnyNet SMARTconnect™ Message Queuing Telemetry Transport (MQTT) AT commands support devices with built-in MQTT capabilities. They implement MQTT communication on IoT devices.

To enable AnyNet SMARTconnect™ MQTT, send the following command:

```
AT+ETMSTATE="startmqtt"
```

If the configuration file `[operation]` parameter is set to `mqtt`, AnyNet SMARTconnect™ starts MQTT after power up. If the parameter is not set, send the command after every reboot.

The MQTT client registers each topic with an index that is used to publish the messages. The response indicates acceptance or rejection of the topic. Optionally, you can configure a single fixed topic so the module need not keep track of topic indices for sending or receiving data.

The MQTT client supports QoS `0` and `1`. It connects to the broker as a clean session.

The client queues published messages in non-volatile flash memory until the broker receives them. For QoS `1` messages, it waits for a `puback` before discarding sent data and transmitting the next message. This preserves messages during network outages.

Queued messages remain after a power failure until the module reconnects. The `nvqueuemaxsize` setting in the [AnyNet SMARTconnect™ configuration file](/smartconnect/getting-started/using-the-anynet-smartconnect-tm-configuration-file.md) defines retained message storage.

The client removes retained messages from flash memory after the broker receives them.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.eseye.com/smartconnect/at-command-reference/mqtt-at-commands.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
