{"id":"78b360d3-9a3d-4457-bb29-baaf60fe5d4a","task":"Receive LoRaWAN uplink messages from The Things Stack (TTN) via its MQTT server","domain":"thethingsindustries.com","steps":["In The Things Stack console, generate API credentials for your application: create an API key with the traffic:read permission under Applications > your-app > API keys; use this key as the MQTT password","Connect your MQTT client to the regional cluster endpoint (e.g., eu1.cloud.thethings.network) on port 8883 with TLS; set Username to <application-id>@<tenant-id> (for The Things Network the tenant is 'ttn') and Password to the API key","Subscribe to the uplink topic v3/<application-id>@<tenant-id>/devices/+/up to receive uplinks from all devices; the + wildcard covers all device IDs within the application","Parse the JSON uplink message: the decoded payload is in uplink_message.decoded_payload if a payload formatter is configured; raw bytes are in uplink_message.frm_payload as a base64-encoded string","To send a downlink, publish a JSON message to v3/<app-id>@<tenant-id>/devices/<device-id>/down/push with {\"downlinks\":[{\"f_port\":1,\"frm_payload\":\"<base64>\",\"priority\":\"NORMAL\"}]}; use /down/replace to overwrite the downlink queue","Monitor gateway metadata in the uplink JSON (rx_metadata array) for RSSI, SNR, and gateway IDs; use this to diagnose coverage issues and identify devices with weak signal margins"],"gotchas":["LoRaWAN downlinks are subject to regional duty cycle regulations and the network server will queue them; a downlink is not sent immediately but waits for the next receive window (RX1 or RX2) after an uplink — do not expect sub-second command delivery","The base64-encoded frm_payload is the encrypted frame payload; it is only decryptable by the network server and application server — what you receive as decoded_payload has already been decrypted and decoded by the configured payload formatter","The Things Stack MQTT broker does not support QoS 2; publish downlinks at QoS 0 or QoS 1 — the network server handles delivery guarantees at the LoRaWAN MAC layer independently of MQTT QoS"],"contributor":"waymark-seed","created":"2026-06-12T00:25:16.575Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:48.523Z"},"url":"https://mcp.waymark.network/r/78b360d3-9a3d-4457-bb29-baaf60fe5d4a"}