Logo

Conductor Documentation

  • Account
  • Application Tokens
  • Network Tokens
  • Downlink Modes
  • Downlink Mechanisms
  • Subscriptions
  • Asset Groups
  • Event Count
  • Changelog
    • v1.6.5a1
    • BugFixes
    • v1.6.4
    • Features
    • BugFixes
    • v1.6.4a10
    • BugFixes
    • v1.6.4a9
    • Features
    • v1.6.4a8
    • BugFixes
    • v1.6.4a6
    • BugFixes
    • v1.6.4a5
    • BugFixes
    • v1.6.4a4
    • BugFixes
    • v1.6.4a3
    • BugFixes
    • v1.6.4a2
    • BugFixes
    • v1.6.4a1
    • BugFixes
    • v1.6.3
    • Features
    • v1.6.3a12
    • Features
    • v1.6.3a11
    • Bug Fixes
    • v1.6.3a10
    • Features
    • Bug Fixes
    • v1.6.3a9
    • Features
    • Bug Fixes
    • v1.6.3a8
    • Bug Fixes
    • v1.6.3a7
    • Features
    • v1.6.3a6
    • Features
    • v1.6.3a5
    • Features
    • BugFixes
    • v1.6.3a5
    • Features
    • BugFixes
    • v1.6.3a4
    • BugFixes
    • v1.6.3a3
    • BugFixes
    • v1.6.3a2
    • Features
    • BugFixes
    • v1.6.3a1
    • BugFixes
    • v1.6.2
    • Features
    • Bug Fixes
    • v1.6.2a9
    • Bug Fixes
    • v1.6.2a8
    • Features
    • Bug Fixes
    • v1.6.2a7
    • Bug Fixes
    • v1.6.2a6
    • Bug Fixes
    • v1.6.2a5
    • Features
    • Bug Fixes
    • v1.6.2a4
    • Bug Fixes
    • v1.6.2a3
      • New Features
    • v1.6.2a2
      • Bug Fixes
    • v1.6.2a2
      • Changes
    • v1.6.2a1
      • New Features
    • v1.6.1
      • New Features
      • Bug Fixes
    • v1.6.0
      • New Features
    • v1.6.0b17
      • New Features
      • Fixes
    • v1.6.0b16
      • New Features
      • Fixes
    • v1.6.0b15
      • New Features
      • Fixes
    • v1.6.0b14
      • Fixes
    • v1.6.0b13
      • New Features
    • v1.6.0b12
      • New Features
    • v1.6.0b11
    • v1.6.0b10
    • v1.6.0b9
    • v1.6.0b8
      • New Features
    • v1.6.0b7
      • New Features
    • v1.6.0b6
      • Fixes
    • v1.6.0b5
      • New Features
    • v1.6.0b4
      • New Features
      • Fixes
    • v1.6.0b3
      • New Features
      • Fixes
    • v1.6.0b2
      • New Features
      • Fixes
    • v1.6.0b1
      • New Features
      • Fixes
    • v1.6.0a10
      • New Features
      • Fixes
    • v1.6.0a9
      • New Features
      • Fixes
      • Other Changes
    • v1.6.0a8
    • v1.6.0a7
      • Fixes
    • v1.6.0a6
      • Fixes
    • v1.6.0a5
      • New Features
      • Fixes
      • Other Changes
    • v1.6.0a4
      • New Features
      • Deprecated
      • Other Changes
    • v1.6.0a3
      • New Features
    • v1.6.0a2
      • New Features
      • Other Changes
    • v1.6.0a1
      • New Features
      • Other Changes
    • v1.5.4
      • New Features
    • v1.5.4b2
      • Fixed
    • v1.5.4b1
      • New Features
      • Fixed
    • v1.5.2
      • Fixed
    • v1.5.1
      • New Features
      • Other Changes
    • v1.5.0
      • Deprecated
      • Other Changes
    • v1.4.0
      • New Features

Conductor API Documentation

  • Conductor Package
    • Conductor Package
    • Account Module
    • Asset Group Module
    • Event Count Module
    • Subject Module
    • Subscriptions Module
    • Tokens Module
    • Util Module
  • Conductor Devices Package
    • Devices Package
    • Gateway Module
    • Module Module

Airfinder Documentation

  • Airfinder
  • User
  • Sites

Airfinder API Documenation

  • Airfinder Package
    • Airfinder Package
    • Area Module
    • Base Module
    • Site Module
    • User Module
    • Zone Module
  • Airfinder Devices Package
    • Devices Package
    • Access Point Module
    • Alert Tag Module
    • Node Module
    • Location Beacon Module
    • Supertag Module
    • tag Module
conductor-py
  • Downlink Mechanisms
  • View page source

Downlink Mechanisms

When a DownlinkMessage conductor needs a route to send the message to. Routes consists of the recipient end-node address, appended by the Gateway that the message will be sent to. The routes are saved in Conductor from the route that the class:.UplinkMessage takes when sending data to Conductor. These routes are persisted in conductor for some time and can be retrieved from both Module and DownlinkMessage objects

my_mod = account.get_module("$301$0-0-0-03000XXXX")
my_mod.get_routes()

dl_msg = my_mod.send_message(b'Hello World')
dl_msg.get_routes()

Which, in both cases, returns

[
    '$301$0-0-0-03000XXXX!101!$101$0-0-0-dbYYYYYYY',
    '$301$0-0-0-03000XXXX!101!$101$0-0-0-dbZZZZZZZ'
]

By default, Conductor will use all routes that the module has used in the recent past to send the message. This means that each gateway in that list will receive the DownlinkMessage. In cases where this is not the desired behavior, the gateway parameter can be used in the Module.send_message() method to use only one route

# Using the Gateay's Address
dl_msg = my_mod.send_message(b'Hello World', gateway="$101$0-0-0-dbYYYYYYY")

# Or a Gateway Object.
my_gw = account.get_gateway("$101$0-0-0-dbYYYYYYY")
dl_msg = my_mod.send_message(b'Hello World', gateway=my_gw)

# Which only uses this route: "$301$0-0-0-03000XXXX!101!$101$0-0-0-dbYYYYYYY"

When the DownlinkMessage is sent, you can check it’s status by getting the Downlink Events for that downlink: DownlinkMessage.get_events(). This returns an array of events, with their correlated timestamps, for each route utilized.

dl_msg = my_mod.send_message(b'Hello World')

dl_msg.get_events()
{
    '$301$0-0-0-03000XXXX!101!$101$0-0-0-dbYYYYYYY': [
        ('Issued', datetime.datetime(2016, 6, 9, 21, 45, 56, 585000)),
        ('Submitting', datetime.datetime(2016, 6, 9, 21, 45, 57, 158000)),
        ('Submitted', datetime.datetime(2016, 6, 9, 21, 45, 57, 349000)),
        ('Sending', datetime.datetime(2016, 6, 9, 21, 45, 57, 403000)),
        ('Sent', datetime.datetime(2016, 6, 9, 21, 45, 57, 945000)),
        ('Expired', datetime.datetime(2016, 6, 9, 21, 47, 36, 531000))
  ],
  '$301$0-0-0-03000XXXX!101!$101$0-0-0-dbZZZZZZZ': [
        ('Issued', datetime.datetime(2016, 6, 9, 21, 45, 56, 585000)),
        ('Expired', datetime.datetime(2016, 6, 9, 21, 47, 36, 531000))
  ]
}

The possible Conductor Events, and their significance are as follows…

Status Message

Description

Pending

Has not yet expired and has not yet met its acknowledgement requirements.

Expired

Has not met its acknowledgement requirements within the Time to Live expiration of the Command given its issuance time.

Failed

Has either not been able to be propagated to its intended targets or the intended targets have not accepted it.

AcknowledgedSuccessful

Has met its successful acknowledgement requirements.

Successful

Has met its acknowledgement requirements of any type.

The only way to be sure that a node received a DownlinkMessage, however, is to use the Acknowledgement Mechanism. This is enabled by default for standard Unicast messages (with one recipient). This can be explicitly set like this

dl_msg = mod.send_message(b'Hello World', acked=True)

This will then add the “AcknowledgedSuccessful” event to the Downlink Events.

Warning

The Acknowledgement Mechanism only works for Unicast Downlink Messages; Multicast Downlink Messages are not Acknowledged. See Application Tokens for more information regarding Multicast Downlink.

When a Downlink is sent, you can also wait for the message to be recieved using the blocking method DownlinkMessage.wait_for_success()

msg = module.send_message(b'hello')
msg.wait_for_success()
Previous Next

© Copyright 2019, Thomas Steinholz, Allen Welkie, Scott Wohler.

Built with Sphinx using a theme provided by Read the Docs.