Skip to content
The Things Stack documentation home
Getting Started Concepts Cloud Enterprise Integrations API Hardware
Getting Started Concepts
Cloud Enterprise
Integrations API Hardware
Get The Things Stack

    Recent searches

      Popular pages

      • Getting Started
      • Adding Gateways
      • Adding Devices
      • Payload Formatters
      • Webhooks
      • Authentication

      No results for “”.

      • Check the spelling, or try fewer or more general words.
      • Ask the community on The Things Network Forum
      • Contact support
      ↑↓ to navigate ↵ to open Esc to close

      Hardware

      • Overview
      • Devices
        • Adding Devices
        • Configuring Devices
          • Device location settings
          • MAC Settings
          • Class B Settings
          • Class C Settings
          • Multicast Groups
          • Downlink Queue Operations
          • Payload Crypto Override
          • Relay Settings
        • Concepts
        • Models
        • Troubleshooting Devices
      • Gateways
      • Works with The Things Stack

      Downlink Queue Operations

      Updated 20 January 2025 Edit on GitHub
      Copy page
      • View as MarkdownThis page as plain text
      • Open in ChatGPTAsk questions about this page
      • Open in ClaudeAsk questions about this page

      The Things Stack keeps a queue of downlink messages per device. Applications can keep pushing downlink messages or replace the queue with a list of downlink messages.

      You can schedule a downlink using the CLI, MQTT or HTTP webhooks.

      To schedule downlinks using MQTT, see MQTT Server. To schedule downlinks using webhooks, see Scheduling Downlinks with Webhooks.

      Note:

      See the Confirmed Downlinks Behavior section to learn how confirmed downlinks behavior for class B and class C devices differs from confirmed downlinks behavior for class A devices.

      This guide shows how to interact with the downlink queue from the command-line interface (CLI).

      Command-line interface only

      The instructions below use the command-line interface (CLI).

      Learn how to install the CLI

      If there are more application downlink messages in the queue, the Network Server sets the LoRaWAN® FPending bit to indicate end devices that there is more downlinks available. In class A downlink, this typically triggers the device to send an uplink message to receive the downlink message. In class C, the Network Server automatically transmits all queued downlink messages.

      We define some user parameters that will be used below:

      APP_ID="app1"
      DEVICE_ID="dev1"
      PAYLOAD="01020304"
      PRIORITY="NORMAL"
      F_PORT="42"
      

      Make sure to modify these according to your setup.

      Push and replace downlink queue

      To push downlink to the end of the queue:

      ttn-lw-cli end-devices downlink push $APP_ID $DEVICE_ID \
        --frm-payload $PAYLOAD \
        --priority $PRIORITY \
        --f-port $F_PORT
      

      You must pass an FPort with the --f-port flag. Confirmed downlinks can be set using --confirmed.

      To replace the existing queue with a new item:

      ttn-lw-cli end-devices downlink replace $APP_ID $DEVICE_ID \
        --frm-payload $PAYLOAD \
        --priority $PRIORITY \
        --f-port $F_PORT
      

      The Things Stack limits the application downlink queue on 10k messages per end device. When this limit is reached, no more scheduled downlinks can be placed in the queue and The Things Stack will drop them. In order to avoid hitting the application downlink queue limit and loosing downlinks, we advise scheduling downlink messages in batches.

      List queue

      To see currently scheduled downlink messages:

      ttn-lw-cli end-devices downlink list $APP_ID $DEVICE_ID
      

      Clear queue

      To clear scheduled downlink messages:

      ttn-lw-cli end-devices downlink clear $APP_ID $DEVICE_ID
      
      ← Multicast Groups Payload Crypto Override →

      On this page

      • Push and replace downlink queue
      • List queue
      • Clear queue

      Sections

      Getting Started

      Concepts

      Cloud

      Enterprise

      Integrations

      API

      Hardware

      Sitemap

      View our Sitemap

      Contributing

      GitHub

      About Us

      The Things Industries

      Privacy Policy

      Cookie settings

      Cookie Settings

      We use cookies to enhance your experience, analyze site traffic and deliver personalized content. Read our Privacy Policy.

      Cookie categories