TTN mqtt Subscribe
How to display a specific field?
C:\Users\alanf\Desktop>mosquitto_sub -h us-west.thethings.network -t “+/devices/+/up” -u “quick” -P “ttn-account-v2.pqq6c7i5gxnGKQ8jpGskGNLbaK7s1fx5pNStVfj7yGE” –v quick/devices/lopy1/up
{“app_id”:“quick”,“dev_id”:“lopy1”,“hardware_serial”:“70B3D54996B86685”,“port”:2,“counter”:248,“payload_raw”:“NjI4”,“metadata”:{“time”:“2017-10-24T18:39:30.347423678Z”,“frequency”:904.6,“modulation”:“LORA”,“data_rate”:“SF8BW500”,“coding_rate”:“4/5”,“gateways”:[{“gtw_id”:“eui-40d63cfffe031020”,“timestamp”:3956276946,“time”:“2017-10-24T18:39:29.14788Z”,“channel”:8,“rssi”:-65,“snr”:9.8,“rf_chain”:0,“latitude”:43.82279,“longitude”:-79.42452,“altitude”:180}]}}
quick/devices/mdot/up {“app_id”:“quick”,“dev_id”:“mdot”,“hardware_serial”:“008000000000C708”,“port”:1,“counter”:153,“payload_raw”:“BxA=”,“metadata”:{“time”:“2017-10-24T18:40:53.290938743Z”,“frequency”:903.9,“modulation”:“LORA”,“data_rate”:“SF10BW125”,“coding_rate”:“4/5”,“gateways”:[{“gtw_id”:“eui-40d63cfffe031020”,“timestamp”:4038943764,“time”:“2017-10-24T18:40:51.814738Z”,“channel”:0,“rssi”:-72,“snr”:12.5,“rf_chain”:0,“latitude”:43.82239,“longitude”:-79.42447,“altitude”:178}]}}
quick/devices/lopy1/up {“app_id”:“quick”,“dev_id”:“lopy1”,“hardware_serial”:“70B3D54996B86685”,“port”:2,“counter”:249,“payload_raw”:“NTc2”,“metadata”:{“time”:“2017-10-24T18:41:30.673285808Z”,“frequency”:904.6,“modulation”:“LORA”,“data_rate”:“SF8BW500”,“coding_rate”:“4/5”,“gateways”:[{“gtw_id”:“eui-40d63cfffe031020”,“timestamp”:4076580156,“time”:“2017-10-24T18:41:29.451149Z”,“channel”:8,“rssi”:-70,“snr”:10,“rf_chain”:0,“latitude”:43.82241,“longitude”:-79.42437,“altitude”:184}]}}
C:\Users\alanf\Desktop>mosquitto_sub -h us-west.thethings.network -t “+/devices/+/up/counter” -u “quick” -P “ttn-account-v2.pqq6c7i5gxnGKQ8jpGskGNLbaK7s1fx5pNStVfj7yGE” -v
NO DISPLAY
https://www.thethingsnetwork.org/docs/applications/mqtt/quick-start.html
Subscribe to a specific field
You can also subscribe to a specific field. Building on The Things Uno / Quick Startyou could subscribe to get just the ledfield:
Copy
mosquitto_sub -h .thethings.network -t ‘+/devices/+/up/led’ -u ‘’ -P ‘’ -v
hello-world/devices/my-uno/up/led true