# Connect to TTN V3

**URL:** <https://discourse.nodered.org/t/connect-to-ttn-v3/25842>\
**Category:** Dashboard\
**Created:** [1 May 2020 00:39 UTC](https://discourse.nodered.org/t/connect-to-ttn-v3/25842 "2020-05-01T00:39:36Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![willhelmx](https://avatars.discourse-cdn.com/v4/letter/w/cc9497/32.png) [@willhelmx](https://discourse.nodered.org/u/willhelmx)\
**Post date:** [1 May 2020 00:39 UTC](https://discourse.nodered.org/t/connect-to-ttn-v3/25842/1 "2020-05-01T00:39:36Z")

</div>

Hi guy´s

Trying to connect and get data from TTN V3´s MQTT Integration..  
Using function Mqtt in -\> Debug, it connects fine "green light" and "connected" in console, however im getting no data from the V3 mqtt server..

What am i missing?

anyone?

All the best

/ Andy

---

<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 May 2020 07:21 UTC](https://discourse.nodered.org/t/connect-to-ttn-v3/25842/2 "2020-05-01T07:21:48Z")

</div>

What topic are you subscribed to? What topics are on the broker? Does case match?

---

<div class="post-metadata">

**Author:** ![willhelmx](https://avatars.discourse-cdn.com/v4/letter/w/cc9497/32.png) [@willhelmx](https://discourse.nodered.org/u/willhelmx)\
**Post date:** [1 May 2020 11:53 UTC](https://discourse.nodered.org/t/connect-to-ttn-v3/25842/3 "2020-05-01T11:53:18Z")

</div>

Hi Steve

Not familiar with your questions Topics? perhaps i missed somthing here ( first tryout with node-red )

When you integrate in V3 on application basis you get mqtt server adress, login, passw.  
I opened node-red.... in flow1 dragged Mqtt in and debug to console, opened Mqtt in and connected to Mqtt server with login & passw. wich worked fine, but no data in debug or console.

BR  
/A

---

<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 May 2020 12:01 UTC](https://discourse.nodered.org/t/connect-to-ttn-v3/25842/4 "2020-05-01T12:01:49Z")

</div>

So you should read up on MQTT. Its a Pub/Sub protocol meaning someone or something PUBLISHES something an you or anyone else can SUBSCRIBE.

The broker sits in the middle and receives all the PUBLISHED messages and sends them on to anyone SUBSCRIBED to the same topic.

What i said - in a picture...  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/8/68daa4f29c61400162b0e296ba83d508a0c47ae7.png)

You said...

> [@willhelmx](#):
>
> Using function Mqtt in -\> Debug, it connects fine "green light" and "connected" in console, however im getting no data from the V3 mqtt server

So i asked...

> [@Steve-Mcl](#):
>
> What topic are you subscribed to?

You only get data incoming for topics you SUBSCRIBE to - and then - someone or something has to PUBLISH data to that topic.

[Here](https://www.youtube.com/watch?v=XDrwgMSQrEY) is video that might help.

PS, do yourself an additional favour and install [MQTT explorer](http://mqtt-explorer.com/) - then you can see what topics are hitting the broker

---

<div class="post-metadata">

**Author:** ![willhelmx](https://avatars.discourse-cdn.com/v4/letter/w/cc9497/32.png) [@willhelmx](https://discourse.nodered.org/u/willhelmx)\
**Post date:** [1 May 2020 12:14 UTC](https://discourse.nodered.org/t/connect-to-ttn-v3/25842/5 "2020-05-01T12:14:27Z")

</div>

Yep, Thanks, got it working, totally missed to subsribe to Topic thought that # was standard..... "feel a bit stupid right now"..... the box was infront of me all the time... sorry  
Ill try the Explorer

Thanks again

Have a nice weekend

---

<div class="post-metadata">

**Author:** ![willhelmx](https://avatars.discourse-cdn.com/v4/letter/w/cc9497/32.png) [@willhelmx](https://discourse.nodered.org/u/willhelmx)\
**Post date:** [1 May 2020 18:46 UTC](https://discourse.nodered.org/t/connect-to-ttn-v3/25842/6 "2020-05-01T18:46:14Z")

</div>

Hi Steve

Looked at youtube, very nice videos 🙂

A quick question regarding node-red, lets say you have 10 sensors coming with 10min transmit interval via the same Mqtt-in function ....how would you proceed to divide the data and publish on console, via "function block" or?... there is as i see it several ways of doing this...what would be the most efficient way in your opinion.  
Another idea i have is to monitor these sensors with a timer funktion/s saying -\> if sensor xx havent been active in 30min, then....  
Do you know if there is a function for this to be downloaded to the palette?

BR

/A

---

<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 May 2020 18:50 UTC](https://discourse.nodered.org/t/connect-to-ttn-v3/25842/7 "2020-05-01T18:50:55Z")

</div>

> [@willhelmx](#):
>
> how would you proceed to divide the data and publish on console

Not sure what you mean.

Usually, MQTT In data comes in per topic (so already "devided")

Why would you want to "publish"? to console? (whatever you mean)?

> [@willhelmx](#):
>
> if sensor xx havent been active in 30min, then

you can certainly achieve this with a trigger node there are [many examples in the forum](https://discourse.nodered.org/search?q=trigger%20if%20timeout)

---

<div class="post-metadata">

**Author:** ![onbekende](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/onbekende/32/20559_2.png) [@onbekende](https://discourse.nodered.org/u/onbekende)\
**Post date:** [1 May 2020 19:48 UTC](https://discourse.nodered.org/t/connect-to-ttn-v3/25842/8 "2020-05-01T19:48:11Z")

</div>

Using MQTT software tools, like what @Steve-Mcl said, may make things easier to troubleshoot. Hence, if you see data coming in your MQTT or not.

In your case you can actually also see what MQTT is receiving. You should give it a try.

---

<div class="post-metadata">

**Author:** ![willhelmx](https://avatars.discourse-cdn.com/v4/letter/w/cc9497/32.png) [@willhelmx](https://discourse.nodered.org/u/willhelmx)\
**Post date:** [1 May 2020 22:07 UTC](https://discourse.nodered.org/t/connect-to-ttn-v3/25842/9 "2020-05-01T22:07:40Z")

</div>

Thanks guy´s

Steve are you the steve from steves-internet-guide ?

/A

---

<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 May 2020 22:10 UTC](https://discourse.nodered.org/t/connect-to-ttn-v3/25842/10 "2020-05-01T22:10:18Z")

</div>

No haha 😆😆😆

---

<div class="post-metadata">

**Author:** ![willhelmx](https://avatars.discourse-cdn.com/v4/letter/w/cc9497/32.png) [@willhelmx](https://discourse.nodered.org/u/willhelmx)\
**Post date:** [1 May 2020 22:12 UTC](https://discourse.nodered.org/t/connect-to-ttn-v3/25842/11 "2020-05-01T22:12:48Z")

</div>

Ok, thanks

---

<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 May 2020 22:24 UTC](https://discourse.nodered.org/t/connect-to-ttn-v3/25842/12 "2020-05-01T22:24:44Z")

</div>

What's your actual problem?

Is it garbled data? See [this](https://flows.nodered.org/flow/845bb5b8cf788939dd261f472c289f77) if so

Or are you just not sure how or what to subscribe to?

Also, there are a fair amount of posts in this forum on TTN

---

<div class="post-metadata">

**Author:** ![willhelmx](https://avatars.discourse-cdn.com/v4/letter/w/cc9497/32.png) [@willhelmx](https://discourse.nodered.org/u/willhelmx)\
**Post date:** [1 May 2020 22:33 UTC](https://discourse.nodered.org/t/connect-to-ttn-v3/25842/13 "2020-05-01T22:33:03Z")

</div>

Hi again, no, the data is just fine i get it as its suppose to, as i said the first problem was that i was under the impression that it dident work and i assumed that node red had /# as standard in the mqtt node... when you asked me regarding the topic i dident get it first... not fully familiar with mqtt and downloaded node-red yesterday sooo...

i´m involved in a project regarding surveillence of sensors and are struggeling learning node-red lol, i´m an oldschool c-programmer and trying, trying you know 🙂

---

<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 May 2020 22:40 UTC](https://discourse.nodered.org/t/connect-to-ttn-v3/25842/14 "2020-05-01T22:40:45Z")

</div>

Its a different mindset but once you "get it" (the whole idea of a message traveling down a wire with properties you use en route) it's very very simple.

Take your time, watch some videos (there's loads on YouTube), read the docs (link up top).

With your background, and some playtime, you'll get going on a few days. Its worth the effort. There is very little I've not achieved in node red that I didn't in a fully typed language. And much quicker too.

---

<div class="post-metadata">

**Author:** ![willhelmx](https://avatars.discourse-cdn.com/v4/letter/w/cc9497/32.png) [@willhelmx](https://discourse.nodered.org/u/willhelmx)\
**Post date:** [1 May 2020 22:58 UTC](https://discourse.nodered.org/t/connect-to-ttn-v3/25842/15 "2020-05-01T22:58:03Z")

</div>

Yeah, it seems to be a really nice ide or whatever you say nowdays LOL  
Explorer was a killer, thank you for the tip..

Btw when you have the end of the topic and have the data in like below  
how do you extract the data from type payload: "dev\_eui"?

payload: "{"end\_device\_ids":{"device\_id":"sensor6","application\_ids":{"application\_id":"aaaamqtt"},"dev\_eui":"A840410001xxxxx","join\_eui":"A0xxx000000AC45","dev\_addr":"2700009D"},"correlation\_ids":  
surveillance

---

<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 May 2020 23:03 UTC](https://discourse.nodered.org/t/connect-to-ttn-v3/25842/16 "2020-05-01T23:03:05Z")

</div>

Read the page [working with messages](https://nodered.org/docs/user-guide/messages). Pay particular attention to the bit about the debug node and "When you hover over any element, a set of buttons appear on the right"

It pretty much simplifies accessing any property of a payload

Trust me, injest that page and you'll be off to a flying start.

---

<div class="post-metadata">

**Author:** ![willhelmx](https://avatars.discourse-cdn.com/v4/letter/w/cc9497/32.png) [@willhelmx](https://discourse.nodered.org/u/willhelmx)\
**Post date:** [1 May 2020 23:04 UTC](https://discourse.nodered.org/t/connect-to-ttn-v3/25842/17 "2020-05-01T23:04:27Z")

</div>

OK, thank you for all help, ill study it

BR  
A

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [1 May 2020 23:07 UTC](https://discourse.nodered.org/t/connect-to-ttn-v3/25842/18 "2020-05-01T23:07:13Z")

</div>

Also from MQTT nodes - that may be a string - but it looks like it could be a JSON object "wrapped in a string" - so maybe try setting the output of the MQTT node to be a parsed JSON object - then the "working with messages" will make a lot more sense 😉

---

<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:** [31 May 2020 23:07 UTC](https://discourse.nodered.org/t/connect-to-ttn-v3/25842/19 "2020-05-31T23:07:14Z")

</div>

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