> 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/data-exchange/sending-and-receiving-data.md).

# Sending and receiving data

### Before you begin

* Using a terminal emulator, send an AT command to ensure that the smart terminal can receive AT commands. For more information, see [General AT commands](/smartconnect/at-command-reference/general-at-commands.md).

  For information about connecting a terminal emulator to the modem, see Connecting to the LTE IoT 2 click.
* Send an AT+ETMINFO=version command to verify that the version number is AnyNet SMARTconnect™ V0.99\_ma or higher.

  If the version number is not in this range, you will need to update the modem software. For more information, see [Over-the-air (OTA) updates](/smartconnect/updates/over-the-air-ota-updates.md).
* Send an AT+ETMSTATE="startmqtt" command to enable the MQTT protocol
* Ensure you know the thing name that you set up in the cloud.

The example below uses AWS. The current AWS interface may differ slightly from the one we used in the example.

To test that your thing can publish information to the cloud:

1. Create two publish topics in the module.
   1. Using a terminal emulator, enter:

      ```
      at+emqpubopen=0,"PublishToCloud0"
      at+emqpubopen=1,"PublishToCloud1"
      ```
   2. Check that the first two index numbers are assigned a topic each. Enter:

      ```
      at+emqpubopen?
      ```

      A list of index numbers and their assigned topics appears.

      ![](https://2591806296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTZG4LrCHVlGSXoDpMgo3%2Fuploads%2Fse9TnbtWw9cCZsFJ6qyf%2Femqpubopenbg96.png?alt=media)
2. Subscribe to the newly created publish topics using your cloud provider's console.
   1. UsingAWS IoT, in the left hand menu, select Test to open the MQTT test client, then ensure you are on the Subscribe to a topic tab.

      ![](https://2591806296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTZG4LrCHVlGSXoDpMgo3%2Fuploads%2Fc85WOZaTjSv1in1c4MeG%2FAWS_Subscribe1.png?alt=media)
   2. In the **Topic filter** box, enter:

      ```
      +/<_ThingName_>
      ```

      This subscribes AWS to all topics related to your thing.
   3. Select Subscribe.

      ![](https://2591806296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTZG4LrCHVlGSXoDpMgo3%2Fuploads%2F64VICW8VAT7z55AU1ZKC%2FAWS_Subscribe2.png?alt=media)

      A subscription appears, listed in the Subscriptions panel.
3. Publish information to the topics you created in the module.

   You can send a maximum payload of 1000 characters to AWS.

   1. Using the terminal emulator, enter:

      ```
      at+emqpublish=0,1,"{"Temperature": 24}"
      at+emqpublish=1,1,"{"BatteryPower": "Low"}"
      ```

      The `emqpublish` command uses the following syntax:

      ```
      at+emqpublish=_IndexNumber_,_QoS_,
      "{_PublishDataInJSON_}"
      ```

      ![](https://2591806296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTZG4LrCHVlGSXoDpMgo3%2Fuploads%2FCegEVpIFkg2KcH4dc83g%2Femqpublish.png?alt=media)

      These messages instantly appear in the cloud.
4. View the published information in the cloud.
   1. In the Subscriptions panel, select +/<*thingName*> to view all published messages.

      ![](https://2591806296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTZG4LrCHVlGSXoDpMgo3%2Fuploads%2F6XPA0XpBwIqBX1flxTA4%2FSubscriptionMessages.png?alt=media)

If you can see the messages in the cloud, then your thing can successfully publish data into the cloud through the module.

Next, test that the cloud can publish messages to your thing.


---

# 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/data-exchange/sending-and-receiving-data.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.
