# Payload decoding error

**URL:** <https://discourse.nodered.org/t/payload-decoding-error/66924>\
**Category:** General\
**Created:** [25 August 2022 16:29 UTC](https://discourse.nodered.org/t/payload-decoding-error/66924 "2022-08-25T16:29:17Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![sn19](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@sn19](https://discourse.nodered.org/u/sn19)\
**Post date:** [25 August 2022 16:29 UTC](https://discourse.nodered.org/t/payload-decoding-error/66924/1 "2022-08-25T16:29:17Z")

</div>

I am using an MQTT block and a Sparkplug block as subscribers as shown below.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/f/ef42c02c843ffe84fc90c30f28de32087df01275.png)

I am trying to publish .json data onto the broker and use these two blocks as subscribers to receive the payload.

In case of the MQTT block, the debug is successful and it shows up in the debug pane as

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/8/68c0a6017595541709c7f17379b6476698810bc6.png)

In case of the Sparkplugplus block, the debug is not successful and I get an error message saying

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/4/b4d59bbc354a0098599209f7004578cf96532f9a.png)

Could someone help me fix this error? Thank you.

---

<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:** [25 August 2022 17:04 UTC](https://discourse.nodered.org/t/payload-decoding-error/66924/2 "2022-08-25T17:04:17Z")

</div>

Is this a continuation of your [previous post](https://discourse.nodered.org/t/payload-not-decoded/66870)? If so then please continue it there.

---

<div class="post-metadata">

**Author:** ![MecatronicaMADE](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@MecatronicaMADE](https://discourse.nodered.org/u/MecatronicaMADE)\
**Post date:** [25 August 2022 17:21 UTC](https://discourse.nodered.org/t/payload-decoding-error/66924/3 "2022-08-25T17:21:50Z")

</div>

I recommend you read the node documentation, to send data you need use this kind of format, for example:

```auto
{
    "metrics": [
        {
            "name": "Node Control/Rebirth",
            "value": true,
            "type": "Boolean"
        }
    ]
}

```

You can find instruction to use and test an example in the [mqtt sparkplug documentation](https://flows.nodered.org/node/node-red-contrib-mqtt-sparkplug-plus) make sure that change your MQTT topic before used it:

 ![Screenshot from 2022-08-25 12-17-48](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/a/caa9b85f23ea387f41a7a4eebcc130b8eef85281.png)

---

<div class="post-metadata">

**Author:** ![MecatronicaMADE](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@MecatronicaMADE](https://discourse.nodered.org/u/MecatronicaMADE)\
**Post date:** [25 August 2022 17:32 UTC](https://discourse.nodered.org/t/payload-decoding-error/66924/4 "2022-08-25T17:32:15Z")

</div>

I think that you had already found the solution:

> [@Error in payload](https://discourse.nodered.org/t/error-in-payload/65715/7):
>
> Thank you @Steve-Mcl its working now without any errors. I figured out a fix for it and while the .json format was fine by itself , msg.payload could only be used with as a function block. when I try to use the same .json code in the inject node as a .json input itr gives me error unless I remove the msg.paylaod line and return.msg line.

Post: [error in payload](https://discourse.nodered.org/t/error-in-payload/65715)

---

<div class="post-metadata">

**Author:** ![sn19](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@sn19](https://discourse.nodered.org/u/sn19)\
**Post date:** [25 August 2022 19:15 UTC](https://discourse.nodered.org/t/payload-decoding-error/66924/5 "2022-08-25T19:15:38Z")

</div>

I need solution not a monitoring on my posts in here. I am trying my best to learn with limited resources and fyi no this is not the same. Also, I am not limited to making a single post in here.

Let's focus out time and efforts on the question here.

---

<div class="post-metadata">

**Author:** ![sn19](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@sn19](https://discourse.nodered.org/u/sn19)\
**Post date:** [25 August 2022 19:16 UTC](https://discourse.nodered.org/t/payload-decoding-error/66924/6 "2022-08-25T19:16:12Z")

</div>

Thank you @MecatronicaMADE

---

<div class="post-metadata">

**Author:** ![sn19](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@sn19](https://discourse.nodered.org/u/sn19)\
**Post date:** [25 August 2022 19:17 UTC](https://discourse.nodered.org/t/payload-decoding-error/66924/7 "2022-08-25T19:17:34Z")

</div>

@MecatronicaMADE if I did I have no reason to make another post. Thank you for tagging my previous post but assess them before you tag them in my future posts cause they are not both the same.

---

<div class="post-metadata">

**Author:** ![sn19](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@sn19](https://discourse.nodered.org/u/sn19)\
**Post date:** [25 August 2022 19:25 UTC](https://discourse.nodered.org/t/payload-decoding-error/66924/8 "2022-08-25T19:25:31Z")

</div>

The example you mentioned in there only talks about mqtt sparkplug block inside the node red. That is not my question.

---

<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:** [25 August 2022 20:27 UTC](https://discourse.nodered.org/t/payload-decoding-error/66924/9 "2022-08-25T20:27:59Z")

</div>

> [@sn19](#):
>
> Let's focus out time and efforts on the question here.

I had previously focused on trying to help you with your problem in the [previous post](https://discourse.nodered.org/t/payload-not-decoded/66870), but you abandoned that post without telling us what the solution was. In what way does that encourage us to try to help with this one?

---

<div class="post-metadata">

**Author:** ![sn19](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@sn19](https://discourse.nodered.org/u/sn19)\
**Post date:** [25 August 2022 20:41 UTC](https://discourse.nodered.org/t/payload-decoding-error/66924/10 "2022-08-25T20:41:31Z")

</div>

I do not want to discuss about a previous post which i fixed by myself in here. The question here is confined to this space.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [25 August 2022 21:01 UTC](https://discourse.nodered.org/t/payload-decoding-error/66924/11 "2022-08-25T21:01:01Z")

</div>

@sn19 as a common courtesy, if you manage to resolve a problem for yourself, you could just add a post on the thread to say so - that lets the community know they don't need to keep trying to help and it can be closed.

---

<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:** [24 October 2022 21:02 UTC](https://discourse.nodered.org/t/payload-decoding-error/66924/12 "2022-10-24T21:02:01Z")

</div>

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