I have been using mosquitto_sub and MQTT to subscribe to TTN application/device uplinks and it works very well. I now want to get more sophisticated and have a separate subscription to collect application/device events. Using the documentation I have subscribed to the MQTT topic +/devices/+/events… and I get events AND all the uplinks. I have used mosquitto_sub in debug mode to try to understand this and here is a snippet of me subscribing to +/devices/+/events:
$ mosquitto_sub -h eu.thethings.network -d -t +/devices/+/events -u ‘…’ -P ‘…’
Client mosqsub|4108-cts4 sending CONNECT
Client mosqsub|4108-cts4 received CONNACK
Client mosqsub|4108-cts4 sending SUBSCRIBE (Mid: 1, Topic: +/devices/+/up, QoS: 0)
Client mosqsub|4108-cts4 sending SUBSCRIBE (Mid: 2, Topic: +/devices/+/events, QoS: 0)
Client mosqsub|4108-cts4 received SUBACK
It appears that when I subscribe to +/devices/+/events I get a free additional subscription to +/devices/+/up. I have tried a variety of topics and I always get the additional subscription to +/devices/+/up. If I subscribe with no topic at all then I get +/devices/+/up.
I have a lot of experience of getting things wrong and then muddling through using forums, google, etc. but I have failed to find a way to subscribe to only +/devices/+/events.
Can anyone point out what I’m doing wrong? Thanks in advance.