I can't subscribe to MQTT Payload Fields

Hello,

I’m new using TTN. I created an application and add a device, thethingsnode. I recieved the data in my console. When I try to subscribe to MQTT using Mosquitto, the ping is working, but I’m not receiving any data.

The commands I have tried are:

mosquitto_sub.exe" -h eu.thethings.network -d -t '[AppID]/devices/[DevID]/up/payload_fields' -u [App ID] -P [App key] -v

mosquitto_sub.exe" -h eu.thethings.network -d -t '[AppID]/devices/[DevID]/up' -u [App ID] -P [App key] -v

mosquitto_sub.exe" -h eu.thethings.network -d -t '/devices/up/payload_fields' -u [App ID] -P [App key] -v

mosquitto_sub.exe" -h eu.thethings.network -d -t '/devices/up' -u [App ID] -P [App key] -v

I do not understand it, can you help me?

Thanks in advance!

Where’s the funny opening double quote in mosquitto_sub.exe" coming from, and where is it closed? And did you see the “When using Windows” remarks in the documentation?

Also, it seems you’re missing a wildcard for the application id and device id in some of your tries, like -t "+/devices/+/up". The following will just capture everything there is: -t "#".

Finally, you cannot subscribe to +/devices/+/up/payload_fields. For EU868, see also the status page.

1 Like

The first missing double quote is copy paste mistake.

When i use the Wildcards + and # like your example, i get the error:

Error: Invalid subscription topic ''+/devices/+/up'', are all '+' and '#' wildcards correct
Error: Invalid subscription topic ''#'', are all '+' and '#' wildcards correct?

I see double single-quotes there, which makes me think you used single quotes in the command line? Please show the full command line. And again: did you see the “When using Windows” remarks in the documentation?

Please see also How do I format my forum post? [HowTo] to avoid the forum from showing funny curly quotes.

1 Like

You are right! I used single quotes, problem solved by using double quotes.

I read the documentation, didn’t see the difference in quotes.

Thanks you very much!

When using WSL (Windows Subsystem for Linux) single quotes can be used.
(But that’s Linux running on Windows, not plain Windows.)