> 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/emq-publish-a-message-to-singletopic.md).

# EMQ – publish a message to singletopic

Publish a message to the system `singlepubtopic`. `singlepubtopic` is a predefined topic for single-subscription systems. The host does not need to register a publish topic with `+EMQPUBOPEN`.

The configuration file defines the publish topic and QoS. The topic index is not required. See [Using the AnyNet SMARTconnect™ configuration file](/smartconnect/getting-started/using-the-anynet-smartconnect-tm-configuration-file.md).

| Type  | Syntax     | Returned result                             |
| ----- | ---------- | ------------------------------------------- |
| Test  | `AT+EMQ=?` | `+EMQ: OK`                                  |
| Read  | `AT+EMQ?`  | `OK` or `ERROR`                             |
| Write | `AT+EMQ=`  | `OK`, `:SEND OK`, `+ETM ERROR:`, or `ERROR` |

For the Write command:

* Send an unquoted message as unmodified text.
* Limit the payload to `1000` printable characters.
* Send quoted ASCII-hex data with an even number of characters from `0-9`, `a-f`, or `A-F`.
* Start quoted JSON data with `{` immediately after the opening quote. AnyNet SMARTconnect™ does not validate JSON.
* AnyNet SMARTconnect™ converts ASCII-hex to binary for transmission. It removes escape characters from JSON messages.

The module returns `:SEND OK` after it publishes the message. This may wait until AnyNet SMARTconnect™ reconnects. The module returns `+ETM ERROR:` for command-specific errors. Confirm that `singlepubtopic` is configured. The module returns `ERROR` when the command is invalid or a parameter is missing.

#### Example

Send the message:

```
AT+EMQ="{"BatteryPower": "Low"}"
```

The module returns:

```
OK
:SEND OK
```


---

# 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/emq-publish-a-message-to-singletopic.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.
