# MQTT Thingsboard; no trace

**URL:** <https://discourse.nodered.org/t/mqtt-thingsboard-no-trace/17047>\
**Category:** General\
**Created:** [23 October 2019 10:35 UTC](https://discourse.nodered.org/t/mqtt-thingsboard-no-trace/17047 "2019-10-23T10:35:19Z")\
**Posts on this page:** 14\
**Page:** 2

<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 October 2019 08:17 UTC](https://discourse.nodered.org/t/mqtt-thingsboard-no-trace/17047/21 "2019-10-25T08:17:32Z")

</div>

Also try sending the topic and string that you are trying to send, using mosquitto\_sub and see if it works.

---

<div class="post-metadata">

**Author:** ![claib](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/claib/32/12809_2.png) [@claib](https://discourse.nodered.org/u/claib)\
**Post date:** [25 October 2019 10:55 UTC](https://discourse.nodered.org/t/mqtt-thingsboard-no-trace/17047/22 "2019-10-25T10:55:49Z")

</div>

sending directly with Moquitto works fine. But as i get the inputs from Modbus in Node-Red, i want to publish from there.  
as i understood, i have to have Mosquitto installed locally in any case ?  
If thats true, how do i publish to Thingsboard via local Moquitto ?

---

<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 October 2019 11:04 UTC](https://discourse.nodered.org/t/mqtt-thingsboard-no-trace/17047/23 "2019-10-25T11:04:23Z")

</div>

@claib I understand you want to publish from Node-RED - that is why we're trying to help. You don't need to have mosquitto installed locally unless you want to use it.

To continue trying to debug this, can you share the contents of `telemetry-data.json` so we can see exactly what format it is in?

---

<div class="post-metadata">

**Author:** ![claib](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/claib/32/12809_2.png) [@claib](https://discourse.nodered.org/u/claib)\
**Post date:** [25 October 2019 12:43 UTC](https://discourse.nodered.org/t/mqtt-thingsboard-no-trace/17047/24 "2019-10-25T12:43:12Z")

</div>

Hello 🙂  
so many thanks for all your help debugging me !  
That's what mosquito sends ( with success ) ( telemetry-data.json )  
{"temperature":27, "humidity":55.0, "active": false}

---

<div class="post-metadata">

**Author:** ![claib](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/claib/32/12809_2.png) [@claib](https://discourse.nodered.org/u/claib)\
**Post date:** [25 October 2019 12:53 UTC](https://discourse.nodered.org/t/mqtt-thingsboard-no-trace/17047/26 "2019-10-25T12:53:07Z")

</div>

ypeee : got it now it injects properly !

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/6/66c51c6ab2a18a320defd875af5074af88720be4.png)

---

<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 October 2019 12:53 UTC](https://discourse.nodered.org/t/mqtt-thingsboard-no-trace/17047/27 "2019-10-25T12:53:09Z")

</div>

> [@claib](#):
>
> {"temperature":27, "humidity":55.0, "active": false}

So the file contains:

```auto
{"temperature":27, "humidity":55.0, "active": false}

```

when it works.

You are trying to publish

```auto
[1403]

```

and it doesn't work.

---

<div class="post-metadata">

**Author:** ![claib](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/claib/32/12809_2.png) [@claib](https://discourse.nodered.org/u/claib)\
**Post date:** [25 October 2019 12:55 UTC](https://discourse.nodered.org/t/mqtt-thingsboard-no-trace/17047/28 "2019-10-25T12:55:22Z")

</div>

the problem is, that the TB Broker waits super formed strings. otherwis he drops.  
How can i transform / format my message that it fits the format ?

---

<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 October 2019 12:57 UTC](https://discourse.nodered.org/t/mqtt-thingsboard-no-trace/17047/29 "2019-10-25T12:57:56Z")

</div>

What does `[1403]` represent?

In your flow you have a JSON node before the MQTT node. If you get rid of that, then you'll have msg.payload set to an array with a single value, 1403. You need to get that into an object, for example a Function node:

```auto
msg.payload = {
   magic: msg.payload[0]
}
return msg;

```

I have no idea what 1403 represents so I have called it `magic` - rename that to whatever you want.

---

<div class="post-metadata">

**Author:** ![claib](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/claib/32/12809_2.png) [@claib](https://discourse.nodered.org/u/claib)\
**Post date:** [25 October 2019 13:15 UTC](https://discourse.nodered.org/t/mqtt-thingsboard-no-trace/17047/30 "2019-10-25T13:15:09Z")

</div>

ok : we are getting near 🙂  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/6/6255058a3f6f62b1c8739c52e60daa059e8a228f.png)  
Red arrow is the output from my modbus  
Blue arrow the working injector

---

<div class="post-metadata">

**Author:** ![claib](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/claib/32/12809_2.png) [@claib](https://discourse.nodered.org/u/claib)\
**Post date:** [25 October 2019 13:16 UTC](https://discourse.nodered.org/t/mqtt-thingsboard-no-trace/17047/31 "2019-10-25T13:16:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![claib](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/claib/32/12809_2.png) [@claib](https://discourse.nodered.org/u/claib)\
**Post date:** [25 October 2019 13:29 UTC](https://discourse.nodered.org/t/mqtt-thingsboard-no-trace/17047/32 "2019-10-25T13:29:49Z")

</div>

Ypeeee  
here it is 🙂  
magic

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/a/a184deea49d67dc924fed763090186c587f643dd.png)

---

<div class="post-metadata">

**Author:** ![claib](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/claib/32/12809_2.png) [@claib](https://discourse.nodered.org/u/claib)\
**Post date:** [31 October 2019 07:16 UTC](https://discourse.nodered.org/t/mqtt-thingsboard-no-trace/17047/33 "2019-10-31T07:16:00Z")

</div>

Thx so much for your help !

---

<div class="post-metadata">

**Author:** ![claib](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/claib/32/12809_2.png) [@claib](https://discourse.nodered.org/u/claib)\
**Post date:** [31 October 2019 07:18 UTC](https://discourse.nodered.org/t/mqtt-thingsboard-no-trace/17047/34 "2019-10-31T07:18:04Z")

</div>

actually i can submit single objects by mqtt.  
My problem is, that i've got about 30 adresses on my usb modbus interface...  
how can i read and submit multiple registers ?

best  
Christoph

---

<div class="post-metadata">

**Author:** ![profile](https://avatars.discourse-cdn.com/v4/letter/p/34f0e0/32.png) [@profile](https://discourse.nodered.org/u/profile)\
**Post date:** [25 June 2020 06:49 UTC](https://discourse.nodered.org/t/mqtt-thingsboard-no-trace/17047/35 "2020-06-25T06:49:34Z")

</div>

Hello got the same problem, is it possible you send me your flow?

[Previous page](https://discourse.nodered.org/t/mqtt-thingsboard-no-trace/17047.md?page=1)
