# MQTT into function cannot read message

**URL:** <https://discourse.nodered.org/t/mqtt-into-function-cannot-read-message/49148>\
**Category:** General\
**Created:** [31 July 2021 18:57 UTC](https://discourse.nodered.org/t/mqtt-into-function-cannot-read-message/49148 "2021-07-31T18:57:18Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![gerry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gerry/32/21604_2.png) [@gerry](https://discourse.nodered.org/u/gerry)\
**Post date:** [31 July 2021 18:57 UTC](https://discourse.nodered.org/t/mqtt-into-function-cannot-read-message/49148/1 "2021-07-31T18:57:18Z")

</div>

I have a fairly simple flow where the mqtt node reads into a function. I can see the mqtt output in a debug node and yet when I try to read that value in a function it does not work. It's actually like the function doesn't even see the input into it. I have deleted the mqtt node and recreated it, deleted the function and recreated it. Still nothing. Other mqtt nodes work fine just this one wants to cause me grief.

 ![1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/e/aed5e5e3c50d1ca958a9c4222cdf6dcfe85615e2.jpeg)  
 ![3](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/f/cfb401341dfaefc41add3764fac0d2932e8529b3.jpeg)  
 ![2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/6/b632656eecc633176b66642a3f435d5d681d5778.jpeg)

Any thoughts appreciated

[EDIT] I get an output on the debug and yet I see nothing on the node.status of the function. I would expect to see something on the node.status

---

<div class="post-metadata">

**Author:** ![rko](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rko/32/45807_2.png) [@rko](https://discourse.nodered.org/u/rko)\
**Post date:** [31 July 2021 19:17 UTC](https://discourse.nodered.org/t/mqtt-into-function-cannot-read-message/49148/2 "2021-07-31T19:17:37Z")

</div>

That's weird indeed. I suppose if you inject a `payload: "off"` manually into the limit switch function node it works?

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [31 July 2021 19:22 UTC](https://discourse.nodered.org/t/mqtt-into-function-cannot-read-message/49148/3 "2021-07-31T19:22:14Z")

</div>

Do you have the code in the On Message section of the Function node ?

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

---

<div class="post-metadata">

**Author:** ![gerry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gerry/32/21604_2.png) [@gerry](https://discourse.nodered.org/u/gerry)\
**Post date:** [31 July 2021 19:22 UTC](https://discourse.nodered.org/t/mqtt-into-function-cannot-read-message/49148/4 "2021-07-31T19:22:15Z")

</div>

Ah, didn't think of that one, will try.

---

<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:** [31 July 2021 19:22 UTC](https://discourse.nodered.org/t/mqtt-into-function-cannot-read-message/49148/5 "2021-07-31T19:22:40Z")

</div>

Add a debug to the output of the function and see what comes out

---

<div class="post-metadata">

**Author:** ![gerry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gerry/32/21604_2.png) [@gerry](https://discourse.nodered.org/u/gerry)\
**Post date:** [31 July 2021 19:24 UTC](https://discourse.nodered.org/t/mqtt-into-function-cannot-read-message/49148/6 "2021-07-31T19:24:46Z")

</div>

First, did set up two inject nodes, one for off, one for on and that does work through the function. And a debug at the output of the function shows nothing when using the mqtt node. What I would expect with the inject nodes.

---

<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:** [31 July 2021 19:29 UTC](https://discourse.nodered.org/t/mqtt-into-function-cannot-read-message/49148/7 "2021-07-31T19:29:03Z")

</div>

hi @gerry, I just tried with your code, and work well. Also I share other option, with switch and change node, to compare and replace the msg.payload. I hope it helps you!!

```auto
[{"id":"18fafe0f8ccf3ab4","type":"tab","label":"Flow 3","disabled":false,"info":""},{"id":"90536333734d8c40","type":"inject","z":"18fafe0f8ccf3ab4","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"door","payload":"on","payloadType":"str","x":90,"y":100,"wires":[["7f1067e4a112bc3c"]]},{"id":"332ff57eee6be44d","type":"debug","z":"18fafe0f8ccf3ab4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":550,"y":140,"wires":[]},{"id":"3806434c0989a659","type":"inject","z":"18fafe0f8ccf3ab4","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"door","payload":"off","payloadType":"str","x":90,"y":160,"wires":[["7f1067e4a112bc3c"]]},{"id":"7f1067e4a112bc3c","type":"switch","z":"18fafe0f8ccf3ab4","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":210,"y":140,"wires":[["8390f5af5b81366d"],["6cc5590c1f527468"]]},{"id":"8390f5af5b81366d","type":"change","z":"18fafe0f8ccf3ab4","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"door open","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":120,"wires":[["332ff57eee6be44d"]]},{"id":"6cc5590c1f527468","type":"change","z":"18fafe0f8ccf3ab4","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"door closed","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":160,"wires":[["332ff57eee6be44d"]]},{"id":"459dbee4dc6bbee0","type":"function","z":"18fafe0f8ccf3ab4","name":"","func":"var message = msg.payload;\nnode.status({fill:\"blue\",shape:\"dot\",text:msg.payload});\nif(message == \"on\"){\n msg.payload = \"door open\";\n}\nif (message == \"off\") {\n msg.payload = \"door closed\";\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":310,"y":320,"wires":[["b4da4cc8b5d17176"]]},{"id":"d790ee364f314e12","type":"inject","z":"18fafe0f8ccf3ab4","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"door","payload":"on","payloadType":"str","x":90,"y":280,"wires":[["459dbee4dc6bbee0"]]},{"id":"7fee6cfaca7a15d2","type":"inject","z":"18fafe0f8ccf3ab4","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"door","payload":"off","payloadType":"str","x":90,"y":340,"wires":[["459dbee4dc6bbee0"]]},{"id":"b4da4cc8b5d17176","type":"debug","z":"18fafe0f8ccf3ab4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":490,"y":320,"wires":[]}]

```

![Captura de pantalla 2021-07-31 a la(s) 2.26.47 p. m.](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/9/89157b46f656ff0eff0012272ff90ca486aeb8cd.png)  
with your (similar) code:  
 ![Captura de pantalla 2021-07-31 a la(s) 2.26.56 p. m.](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/5/a5f81eef3e77109565c2bff8097083ffd4e50b9a.png)

and the other option with switch and change node:

![Captura de pantalla 2021-07-31 a la(s) 2.26.40 p. m.](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/4/a4000c66f0b71ab13635722888429b3eb1862ffd.png)

looks like:  
 ![Captura de pantalla 2021-07-31 a la(s) 2.27.13 p. m.](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/b/fb904ef372a10ce7c9c39b2bcf7515ca53d67d59.png)

---

<div class="post-metadata">

**Author:** ![gerry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gerry/32/21604_2.png) [@gerry](https://discourse.nodered.org/u/gerry)\
**Post date:** [31 July 2021 19:39 UTC](https://discourse.nodered.org/t/mqtt-into-function-cannot-read-message/49148/8 "2021-07-31T19:39:53Z")

</div>

@MecatronicaMADE when I import your flow (comes up flow 3) it works. When I import your code into my tab, it doesn't work. I am leaning towards that tab has bad karma. I'm running beta 2 ver 1 on that machine and coming to the decision I will update to latest versions and see if that somehow auto magically fixes things. I have put far too much effort into this and since this is a holiday weekend here the manager (wife) has decided if I get on my laptop one more time this weekend instead of being with the kids I will regret it. I tend to believe her so this is going to get put away for a few days.  
Thanks everyone

---

<div class="post-metadata">

**Author:** ![rko](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rko/32/45807_2.png) [@rko](https://discourse.nodered.org/u/rko)\
**Post date:** [31 July 2021 19:49 UTC](https://discourse.nodered.org/t/mqtt-into-function-cannot-read-message/49148/9 "2021-07-31T19:49:49Z")

</div>

Please don't tell `da manager` that you are running beta 2 still 😱

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [31 July 2021 22:14 UTC](https://discourse.nodered.org/t/mqtt-into-function-cannot-read-message/49148/10 "2021-07-31T22:14:19Z")

</div>

Just to make sure that the function node is connected to the mqtt-in, try moving it and see if the wires move with it.

I’ve been known to think I dropped a flow on a wire, but it didn’t connect.

---

<div class="post-metadata">

**Author:** ![gerry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gerry/32/21604_2.png) [@gerry](https://discourse.nodered.org/u/gerry)\
**Post date:** [31 July 2021 22:55 UTC](https://discourse.nodered.org/t/mqtt-into-function-cannot-read-message/49148/11 "2021-07-31T22:55:10Z")

</div>

Hid in the closet for a few minutes....  
Checked and the wires are connected and the code is in on message

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [31 July 2021 23:27 UTC](https://discourse.nodered.org/t/mqtt-into-function-cannot-read-message/49148/12 "2021-07-31T23:27:20Z")

</div>

Export your flow and attach it to a reply so we can try it.

---

<div class="post-metadata">

**Author:** ![rko](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rko/32/45807_2.png) [@rko](https://discourse.nodered.org/u/rko)\
**Post date:** [1 August 2021 03:43 UTC](https://discourse.nodered.org/t/mqtt-into-function-cannot-read-message/49148/13 "2021-08-01T03:43:54Z")

</div>

Interesting. It would be nice to visually indicate if there is an actual wire connected (change the color of the connection dot slightly, for example) . Maybe this has been discussed before?

---

<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:** [1 August 2021 07:41 UTC](https://discourse.nodered.org/t/mqtt-into-function-cannot-read-message/49148/14 "2021-08-01T07:41:21Z")

</div>

> [@gerry](#):
>
> ![3](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/f/cfb401341dfaefc41add3764fac0d2932e8529b3.jpeg)

Why do you destroy the original msg ? Is this something you often do? I recommend you break that habit.

Try changing all code in **all functions** in this ☝ flow to reuse the original msg object e.g....

```auto
msg.payload = "door open";

```

---

<div class="post-metadata">

**Author:** ![molesworth](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/molesworth/32/11748_2.png) [@molesworth](https://discourse.nodered.org/u/molesworth)\
**Post date:** [1 August 2021 10:57 UTC](https://discourse.nodered.org/t/mqtt-into-function-cannot-read-message/49148/15 "2021-08-01T10:57:48Z")

</div>

> [@gerry](#):
>
> ![3](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/f/cfb401341dfaefc41add3764fac0d2932e8529b3.jpeg)

Maybe I'm missing something, but doesn't this function **always** return "door closed"? Maybe a few else's would clarify the logic?

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [1 August 2021 11:13 UTC](https://discourse.nodered.org/t/mqtt-into-function-cannot-read-message/49148/16 "2021-08-01T11:13:47Z")

</div>

From the screenshot you shared, of the Debug node .. what strikes me as unusual is that the msg doesn't have a Topic.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/2/024dbca179fa0c8434796eebf9188c3cbf18c91b.png)

If you have a Debug node directly connected to any MQTT node and set it to Complete msg (as you are) .. it would always have a Topic.

are you sure that debug message is from that Mqtt node and not from some other part of your flows ?

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [1 August 2021 12:48 UTC](https://discourse.nodered.org/t/mqtt-into-function-cannot-read-message/49148/17 "2021-08-01T12:48:31Z")

</div>

> [@molesworth](#):
>
> Maybe I'm missing something, but doesn't this function **always** return "door closed"? Maybe a few else's would clarify the logic

I was wondering that myself.

@gerry please export your flow and attach it to a reply

---

<div class="post-metadata">

**Author:** ![gerry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gerry/32/21604_2.png) [@gerry](https://discourse.nodered.org/u/gerry)\
**Post date:** [1 August 2021 23:08 UTC](https://discourse.nodered.org/t/mqtt-into-function-cannot-read-message/49148/18 "2021-08-01T23:08:48Z")

</div>

@zenofmud and @molesworth you are correct about always returning the one msg. The issue was and still is, when that node gets a msg from the mqtt node I get no output. So I added the last piece to see if my logic was failing or what. Turns out it is not a logic issue, the node receives the msg but doesn't out put anything,  
@Steve-Mcl I googled destroy object and while I am confident I can blow up small villages now I still don't understand the nuances of your statement.  
Also, I'm not sure how you can test my flow since it works with the inject nodes but not with mqtt. Do you have someway to input into the mqtt node?  
Here's the flow..

```auto
[{"id":"3202129f.965a9e","type":"tab","label":"Garage","disabled":false,"info":""},{"id":"2911c558.0e32ba","type":"mqtt in","z":"3202129f.965a9e","name":"temp c","topic":"Gout_tempC","qos":"2","datatype":"auto","broker":"6fbbc66a.737958","x":210,"y":160,"wires":[["be401294.d77ab8"]]},{"id":"be401294.d77ab8","type":"function","z":"3202129f.965a9e","name":"temp C","func":"let z = Number(msg.payload);\nz = z.toFixed(2); \nmsg = {\n payload: 'Deg C ' + z,\n topic: 'tempC',\n}\n\nnode.status({fill:\"blue\",shape:\"dot\",text:msg.payload});\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":440,"y":160,"wires":[["10192b9d.7462ec"]]},{"id":"e9152864.b9f088","type":"mqtt in","z":"3202129f.965a9e","name":"temp F","topic":"Gout_tempF","qos":"2","datatype":"auto","broker":"6fbbc66a.737958","nl":false,"rap":false,"x":210,"y":240,"wires":[["d272cf84.0923e"]]},{"id":"d272cf84.0923e","type":"function","z":"3202129f.965a9e","name":"temp F","func":"let z = Number(msg.payload);\nz = z.toFixed(2); \nmsg = {\n payload: 'Deg F ' + z,\n topic: 'tempF',\n}\n \n \nnode.status({fill:\"blue\",shape:\"dot\",text:msg.payload});\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":440,"y":240,"wires":[["6accbfac.669eb"]]},{"id":"9669f95d.519588","type":"mqtt in","z":"3202129f.965a9e","name":"limit switch","topic":"OnLimitSwitch","qos":"2","datatype":"auto","broker":"6fbbc66a.737958","nl":false,"rap":false,"x":220,"y":300,"wires":[["80dec21e.e4b18","f3b571fd5059739f"]]},{"id":"80dec21e.e4b18","type":"function","z":"3202129f.965a9e","name":"limit switch","func":"var message = msg.payload;\nnode.status({fill:\"blue\",shape:\"dot\",text:msg.payload});\nif(message == \"on\"){\n msg.payload = \"door open\";\n}\nif (message == \"off\") {\n msg.payload = \"door closed\";\n}\n\nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":450,"y":300,"wires":[["17f7d5f9.bbddf2"]]},{"id":"17f7d5f9.bbddf2","type":"ui_template","z":"3202129f.965a9e","group":"b2e45b14.e88998","name":"limit switch","order":1,"width":0,"height":0,"format":"<div>\n <md-button class=\"md-button mine-button\"\n data-topic=\"target\"\n data-payload=\"1\">{{msg.payload}}\n </md-button>\n</div>","storeOutMessages":false,"fwdInMessages":false,"resendOnRefresh":false,"templateScope":"local","x":930,"y":300,"wires":[[]]},{"id":"39de04a9.004564","type":"function","z":"3202129f.965a9e","name":"humid","func":"let z = Number(msg.payload);\nz = z.toFixed(2); \nmsg = {\n payload: 'RH% ' + z,\n topic: 'humid',\n}\n\nnode.status({fill:\"blue\",shape:\"dot\",text:msg.payload});\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":430,"y":100,"wires":[["cca0f12e.33553"]]},{"id":"14be87a5.d6e988","type":"mqtt in","z":"3202129f.965a9e","name":"humid","topic":"Gout_humid","qos":"2","datatype":"auto","broker":"6fbbc66a.737958","nl":false,"rap":false,"x":210,"y":100,"wires":[["39de04a9.004564"]]},{"id":"10192b9d.7462ec","type":"ui_template","z":"3202129f.965a9e","group":"b2e45b14.e88998","name":"temp C","order":3,"width":0,"height":0,"format":"<div>\n <md-button class=\"md-button mine-button\"\n data-topic=\"target\"\n data-payload=\"1\">{{msg.payload}}\n </md-button>\n</div>","storeOutMessages":false,"fwdInMessages":false,"resendOnRefresh":false,"templateScope":"local","x":920,"y":160,"wires":[[]]},{"id":"cca0f12e.33553","type":"ui_template","z":"3202129f.965a9e","group":"b2e45b14.e88998","name":"humid","order":2,"width":0,"height":0,"format":"<div>\n <md-button class=\"md-button mine-button\"\n data-topic=\"target\"\n data-payload=\"1\">{{msg.payload}}\n </md-button>\n</div>","storeOutMessages":false,"fwdInMessages":false,"resendOnRefresh":false,"templateScope":"local","x":910,"y":100,"wires":[[]]},{"id":"6accbfac.669eb","type":"ui_template","z":"3202129f.965a9e","group":"b2e45b14.e88998","name":"temp F","order":4,"width":0,"height":0,"format":"<div>\n <md-button class=\"md-button mine-button\"\n data-topic=\"target\"\n data-payload=\"1\">{{msg.payload}}\n </md-button>\n</div>","storeOutMessages":false,"fwdInMessages":false,"resendOnRefresh":false,"templateScope":"local","x":920,"y":240,"wires":[[]]},{"id":"f3b571fd5059739f","type":"function","z":"3202129f.965a9e","name":"test","func":"\n node.status({fill:\"blue\",shape:\"dot\",text:msg.payload});\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":530,"y":360,"wires":[[]]},{"id":"ea573274bafe4774","type":"inject","z":"3202129f.965a9e","name":"off","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"off","payloadType":"str","x":140,"y":400,"wires":[["80dec21e.e4b18"]]},{"id":"d839df954907737a","type":"inject","z":"3202129f.965a9e","name":"on","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"on","payloadType":"str","x":110,"y":360,"wires":[["80dec21e.e4b18"]]},{"id":"6fbbc66a.737958","type":"mqtt-broker","name":"127.0.0.1","broker":"127.0.0.1","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"b2e45b14.e88998","type":"ui_group","name":"Door","tab":"16fd26cf.f8ed21","order":1,"disp":false,"width":6,"collapse":false},{"id":"16fd26cf.f8ed21","type":"ui_tab","name":"Garage","icon":"fa-heart","order":10,"disabled":false,"hidden":false}]

```

Thanks everyone

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [1 August 2021 23:17 UTC](https://discourse.nodered.org/t/mqtt-into-function-cannot-read-message/49148/19 "2021-08-01T23:17:30Z")

</div>

Please add a `debug` node (set to display the complete msg object) to the `mqtt-in' node and run a test. When you get the debug output please copy and paste it to a reply.

---

<div class="post-metadata">

**Author:** ![gerry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gerry/32/21604_2.png) [@gerry](https://discourse.nodered.org/u/gerry)\
**Post date:** [1 August 2021 23:21 UTC](https://discourse.nodered.org/t/mqtt-into-function-cannot-read-message/49148/20 "2021-08-01T23:21:36Z")

</div>

See first post please, last image

[Next page](https://discourse.nodered.org/t/mqtt-into-function-cannot-read-message/49148.md?page=2)
