---
title: "How to parse MQTT subtopic with CR LF content?"
url: "https://maker.wiznet.io/forum/14251"
markdown_url: "https://maker.wiznet.io/forum/14251/md"
type: "Forum topic"
category: "Wireless"
author: "srcnuzn"
created: "2021-06-04T07:55:23+09:00"
last_activity: "2021-10-06T00:38:05+09:00"
language: "en"
views: 413
replies: 1
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# How to parse MQTT subtopic with CR LF content?

## Question

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

Hello!

I am subscribed to “subtopic/test” and connected to broker.

When receiving JSON-strings (prettified with CR LF), it’s difficult to parse.

EXAMPLE:

![image](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/8/84effedbf2852b87421fc53fc1be033f63ae338e.png)

This is, what i receive via UART-RX:

`subtopic/test -> {\r\n \"int": 219200,\r\n \"double\": 119836.64,\r\n \"string\": \"this is a string\"\r\n}\r\n`

where the last CR LF marks the end of the message.

Unfortunately, the message lenght is not received via UART (which would be much easier to parse).

So, how do i know, when the message ends?

Any suggestions?

Best regards,
srcnuzn

## Replies

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

Hello.

Sorry for the late reply.

Other customers who use WizFi360 usually use the Json string with characters for packet separation and data parsing.

How about designing a packet like above?

Please refer to it.

Thanks.
Best regards.

---

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