Connect to TTN V3

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

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

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

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

You said...

So i asked...

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

Here is video that might help.

PS, do yourself an additional favour and install MQTT explorer - then you can see what topics are hitting the broker

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

Hi Steve

Looked at youtube, very nice videos :slight_smile:

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

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)?

you can certainly achieve this with a trigger node there are many examples in the forum

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.

Thanks guy´s

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

/A

No haha :laughing::laughing::laughing:

Ok, thanks

What's your actual problem?

Is it garbled data? See this 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

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 :slight_smile:

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.

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

Read the page working with 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.

OK, thank you for all help, ill study it

BR
A

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 :wink:

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