# MQTT-in node produces undefined

**URL:** <https://discourse.nodered.org/t/mqtt-in-node-produces-undefined/73381>\
**Category:** General\
**Created:** [8 January 2023 18:54 UTC](https://discourse.nodered.org/t/mqtt-in-node-produces-undefined/73381 "2023-01-08T18:54:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vilnis\_R](https://avatars.discourse-cdn.com/v4/letter/v/a183cd/32.png) [@Vilnis\_R](https://discourse.nodered.org/u/Vilnis_R)\
**Post date:** [8 January 2023 18:54 UTC](https://discourse.nodered.org/t/mqtt-in-node-produces-undefined/73381/1 "2023-01-08T18:54:34Z")

</div>

Hi there!  
I came across the weird behavior of mqqt node. I made new espboard that publishes to mqtt and made new flow with mqqt-in node. This node in debug node shows "undefined". I tried various scenarios and got the same result.  
However if I change topic in already existing mqqt node from other previously created flows it shows correct output.  
So if I copy this mqqt node with correct output then this newly created node again gives "undefined". If I grab new mqqt node from left panel - again gives "undefined".  
Tried to restart server, reloaded browser - no luck so far.  
Any ideas?

---

<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:** [8 January 2023 19:28 UTC](https://discourse.nodered.org/t/mqtt-in-node-produces-undefined/73381/2 "2023-01-08T19:28:50Z")

</div>

1. How do you have the debug node setup?
2. Is the debug node connected directly to the MQTT node?
3. Show us a screenshot of the flow and debug output

---

<div class="post-metadata">

**Author:** ![Vilnis\_R](https://avatars.discourse-cdn.com/v4/letter/v/a183cd/32.png) [@Vilnis\_R](https://discourse.nodered.org/u/Vilnis_R)\
**Post date:** [8 January 2023 19:45 UTC](https://discourse.nodered.org/t/mqtt-in-node-produces-undefined/73381/3 "2023-01-08T19:45:14Z")

</div>

![Node_red](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/2/b24ef4aa93815fc345c8472df24c25e6af57ba88.jpeg)

---

<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:** [8 January 2023 19:56 UTC](https://discourse.nodered.org/t/mqtt-in-node-produces-undefined/73381/4 "2023-01-08T19:56:34Z")

</div>

Your debug is set to watch `msg.solar`. MQTT node ONLY delivers values in `msg.payload`

---

<div class="post-metadata">

**Author:** ![Vilnis\_R](https://avatars.discourse-cdn.com/v4/letter/v/a183cd/32.png) [@Vilnis\_R](https://discourse.nodered.org/u/Vilnis_R)\
**Post date:** [8 January 2023 20:25 UTC](https://discourse.nodered.org/t/mqtt-in-node-produces-undefined/73381/5 "2023-01-08T20:25:34Z")

</div>

Yes, You are right! I changed msg.solar to msg.payload and now everything runs. Thanks a lot! 🙂

---

<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:** [22 January 2023 20:25 UTC](https://discourse.nodered.org/t/mqtt-in-node-produces-undefined/73381/6 "2023-01-22T20:25:57Z")

</div>

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