---
title: "MQTT: SubTopic received, while receiving command echo"
url: "https://maker.wiznet.io/forum/14252"
markdown_url: "https://maker.wiznet.io/forum/14252/md"
type: "Forum topic"
category: "Wireless"
author: "srcnuzn"
created: "2021-06-04T08:13:40+09:00"
last_activity: "2021-10-06T00:38:11+09:00"
language: "en"
views: 436
replies: 1
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# MQTT: SubTopic received, while receiving command echo

## Question

Asked by srcnuzn on 2021-06-04 in Wireless.

Hello,

I have the following problem:

- I am subscribed to “subtopic/test” (which periodically sends `"subtopic message"`)
  UART Receive Buffer: `subtopic/test -> subtopic message\r\n`

- I periodically publish this message `"HelloWorld!"` (echo enabled)
  UART Receive Buffer: `AT+MQTTPUB=\"HelloWorld!\"\r\n\r\n\r\nOK\r\n`

- Occasionally, i receive the subtopic, while receiving the echo or repsonse.
  UART Receive Buffer: `AT+MQTTPUB=\"HelloWsubtopic/test -> subtopic message\r\norld!\"\r\n\r\n\r\nOK\r\n`

Is this behaviour intentional? It makes parsing much more difficult!

Best regards,
srcnuzn

## Replies

### Reply 1 by austin, 2021-06-09

Hello.

Sorry for the late reply.

How about publishing a message if there is no received data(subscribe message) after reading the MCU’s buffer first?

Please refer to it.

Thanks.
Best regards.

---

Source: https://maker.wiznet.io/forum/14252
