# Invalid JSON string with MQTT node

**URL:** <https://discourse.nodered.org/t/invalid-json-string-with-mqtt-node/45650>\
**Category:** General\
**Created:** [14 May 2021 14:03 UTC](https://discourse.nodered.org/t/invalid-json-string-with-mqtt-node/45650 "2021-05-14T14:03:00Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![BGael](https://avatars.discourse-cdn.com/v4/letter/b/d26b3c/32.png) [@BGael](https://discourse.nodered.org/u/BGael)\
**Post date:** [17 May 2021 11:15 UTC](https://discourse.nodered.org/t/invalid-json-string-with-mqtt-node/45650/22 "2021-05-17T11:15:17Z")

</div>

![Capture2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/0/2032a94741d3ec01bb92fbbb46dbb37aae6f9391.png)

In the function node

```auto
msg.payload = msg.payload.toString();
return msg;

```

---

<div class="post-metadata">

**Author:** ![BGael](https://avatars.discourse-cdn.com/v4/letter/b/d26b3c/32.png) [@BGael](https://discourse.nodered.org/u/BGael)\
**Post date:** [17 May 2021 11:21 UTC](https://discourse.nodered.org/t/invalid-json-string-with-mqtt-node/45650/23 "2021-05-17T11:21:45Z")

</div>

I can not understand the use of the node "node-red-contrib-buffer-parser", the documentation is not too clear on this subject

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [17 May 2021 11:25 UTC](https://discourse.nodered.org/t/invalid-json-string-with-mqtt-node/45650/24 "2021-05-17T11:25:33Z")

</div>

The documentation is as clear as it can be for a complex problem. I provided a working example (because the user provided sample data and documentation). There are also built-in examples/demos for that node using `CTRL+I`.

You haven't answered the previous question - do you have a specification or documentation about what each byte in the buffer represents?

If you have this documentation it is quite simple to use the buffer parser to convert the various bytes into real world values.

---

<div class="post-metadata">

**Author:** ![BGael](https://avatars.discourse-cdn.com/v4/letter/b/d26b3c/32.png) [@BGael](https://discourse.nodered.org/u/BGael)\
**Post date:** [17 May 2021 11:50 UTC](https://discourse.nodered.org/t/invalid-json-string-with-mqtt-node/45650/25 "2021-05-17T11:50:20Z")

</div>

I do not have the documentation currently. The person who can provide it to me is unavailable at the moment

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [17 May 2021 12:37 UTC](https://discourse.nodered.org/t/invalid-json-string-with-mqtt-node/45650/26 "2021-05-17T12:37:10Z")

</div>

> [@BGael](#):
>
> The person who can provide it to me is unavailable at the moment

Without that information there is little that can be done.

---

<div class="post-metadata">

**Author:** ![BGael](https://avatars.discourse-cdn.com/v4/letter/b/d26b3c/32.png) [@BGael](https://discourse.nodered.org/u/BGael)\
**Post date:** [17 May 2021 13:09 UTC](https://discourse.nodered.org/t/invalid-json-string-with-mqtt-node/45650/27 "2021-05-17T13:09:18Z")

</div>

> [@Colin](#):
>
> ‎Sans cette information, il n’y a pas grand-chose qui puisse être fait.‎

Ok, I'll be back to you very soon

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [16 July 2021 13:09 UTC](https://discourse.nodered.org/t/invalid-json-string-with-mqtt-node/45650/28 "2021-07-16T13:09:48Z")

</div>

Closed on 16 July 2021 13:09 UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.

[Previous page](https://discourse.nodered.org/t/invalid-json-string-with-mqtt-node/45650.md?page=1)
