lorawanv3DownlinkMessage
JSON Schema for lorawanv3DownlinkMessage, extracted from The Things Stack v3.36 api.swagger.json
LoRaWANIoTInternet Of ThingsOpen SourceNetwork ServerLPWANTelemetrySensorsGatewaysConnectivityApache 2.0
JSON Schema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://api-evangelist.github.io/the-things-network/json-schema/the-things-stack-downlink-message-schema.json",
"title": "lorawanv3DownlinkMessage",
"description": "JSON Schema for lorawanv3DownlinkMessage, extracted from The Things Stack v3.36 api.swagger.json",
"definitions": {
"lorawanv3DownlinkMessage": {
"type": "object",
"properties": {
"raw_payload": {
"type": "string",
"format": "byte"
},
"payload": {
"$ref": "#/definitions/lorawanv3Message"
},
"end_device_ids": {
"$ref": "#/definitions/v3EndDeviceIdentifiers"
},
"request": {
"$ref": "#/definitions/v3TxRequest"
},
"scheduled": {
"$ref": "#/definitions/lorawanv3TxSettings"
},
"correlation_ids": {
"type": "array",
"items": {
"type": "string"
}
},
"session_key_id": {
"type": "string",
"format": "byte"
}
},
"description": "Mapping from UDP message:\n\n imme: -\n tmst: scheduled.timestamp\n tmms: scheduled.time\n freq: scheduled.frequency\n rfch: (0)\n powe: scheduled.tx_power\n modu: scheduled.modulation\n datr: scheduled.data_rate_index (derived)\n codr: scheduled.coding_rate\n fdev: (derived from bandwidth)\n ipol: scheduled.invert_polarization\n prea: [scheduled.advanced]\n size: (derived from len(raw_payload))\n data: raw_payload\n ncrc: [scheduled.advanced]",
"title": "Downlink message from the network to the end device"
},
"lorawanv3Message": {
"type": "object",
"properties": {
"m_hdr": {
"$ref": "#/definitions/lorawanv3MHDR"
},
"mic": {
"type": "string",
"format": "byte"
},
"mac_payload": {
"$ref": "#/definitions/lorawanv3MACPayload"
},
"join_request_payload": {
"$ref": "#/definitions/v3JoinRequestPayload"
},
"join_accept_payload": {
"$ref": "#/definitions/v3JoinAcceptPayload"
},
"rejoin_request_payload": {
"$ref": "#/definitions/v3RejoinRequestPayload"
}
},
"title": "Message represents a LoRaWAN message"
},
"v3RejoinRequestPayload": {
"type": "object",
"properties": {
"rejoin_type": {
"$ref": "#/definitions/v3RejoinRequestType"
},
"net_id": {
"type": "string",
"format": "string",
"example": "000013"
},
"join_eui": {
"type": "string",
"format": "string",
"example": "70B3D57ED000ABCD"
},
"dev_eui": {
"type": "string",
"format": "string",
"example": "70B3D57ED000ABCD"
},
"rejoin_cnt": {
"type": "integer",
"format": "int64",
"description": "Contains RJCount0 or RJCount1 depending on rejoin_type."
}
}
},
"v3RejoinRequestType": {
"type": "string",
"enum": [
"CONTEXT",
"SESSION",
"KEYS"
],
"default": "CONTEXT",
"description": " - CONTEXT: Resets DevAddr, Session Keys, Frame Counters, Radio Parameters.\n - SESSION: Equivalent to the initial JoinRequest.\n - KEYS: Resets DevAddr, Session Keys, Frame Counters, while keeping the Radio Parameters."
},
"v3JoinAcceptPayload": {
"type": "object",
"properties": {
"encrypted": {
"type": "string",
"format": "byte"
},
"join_nonce": {
"type": "string",
"format": "string",
"example": "ABCDEF"
},
"net_id": {
"type": "string",
"format": "string",
"example": "000013"
},
"dev_addr": {
"type": "string",
"format": "string",
"example": "2600ABCD"
},
"dl_settings": {
"$ref": "#/definitions/v3DLSettings"
},
"rx_delay": {
"$ref": "#/definitions/v3RxDelay"
},
"cf_list": {
"$ref": "#/definitions/v3CFList"
}
}
},
"v3RxDelay": {
"type": "string",
"enum": [
"RX_DELAY_0",
"RX_DELAY_1",
"RX_DELAY_2",
"RX_DELAY_3",
"RX_DELAY_4",
"RX_DELAY_5",
"RX_DELAY_6",
"RX_DELAY_7",
"RX_DELAY_8",
"RX_DELAY_9",
"RX_DELAY_10",
"RX_DELAY_11",
"RX_DELAY_12",
"RX_DELAY_13",
"RX_DELAY_14",
"RX_DELAY_15"
],
"default": "RX_DELAY_0",
"description": " - RX_DELAY_0: 1 second.\n - RX_DELAY_1: 1 second.\n - RX_DELAY_2: 2 seconds.\n - RX_DELAY_3: 3 seconds.\n - RX_DELAY_4: 4 seconds.\n - RX_DELAY_5: 5 seconds.\n - RX_DELAY_6: 6 seconds.\n - RX_DELAY_7: 7 seconds.\n - RX_DELAY_8: 8 seconds.\n - RX_DELAY_9: 9 seconds.\n - RX_DELAY_10: 10 seconds.\n - RX_DELAY_11: 11 seconds.\n - RX_DELAY_12: 12 seconds.\n - RX_DELAY_13: 13 seconds.\n - RX_DELAY_14: 14 seconds.\n - RX_DELAY_15: 15 seconds."
},
"v3DLSettings": {
"type": "object",
"properties": {
"rx1_dr_offset": {
"$ref": "#/definitions/v3DataRateOffset"
},
"rx2_dr": {
"$ref": "#/definitions/v3DataRateIndex"
},
"opt_neg": {
"type": "boolean",
"description": "OptNeg is set if Network Server implements LoRaWAN 1.1 or greater."
}
}
},
"v3DataRateOffset": {
"type": "string",
"enum": [
"DATA_RATE_OFFSET_0",
"DATA_RATE_OFFSET_1",
"DATA_RATE_OFFSET_2",
"DATA_RATE_OFFSET_3",
"DATA_RATE_OFFSET_4",
"DATA_RATE_OFFSET_5",
"DATA_RATE_OFFSET_6",
"DATA_RATE_OFFSET_7"
],
"default": "DATA_RATE_OFFSET_0"
},
"v3DataRateIndex": {
"type": "string",
"enum": [
"DATA_RATE_0",
"DATA_RATE_1",
"DATA_RATE_2",
"DATA_RATE_3",
"DATA_RATE_4",
"DATA_RATE_5",
"DATA_RATE_6",
"DATA_RATE_7",
"DATA_RATE_8",
"DATA_RATE_9",
"DATA_RATE_10",
"DATA_RATE_11",
"DATA_RATE_12",
"DATA_RATE_13",
"DATA_RATE_14",
"DATA_RATE_15"
],
"default": "DATA_RATE_0"
},
"v3CFList": {
"type": "object",
"properties": {
"type": {
"$ref": "#/definitions/v3CFListType"
},
"freq": {
"type": "array",
"items": {
"type": "integer",
"format": "int64"
},
"description": "Frequencies to be broadcasted, in hecto-Hz.\nThese values are broadcasted as 24 bits unsigned integers.\nThis field should not contain default values."
},
"ch_masks": {
"type": "array",
"items": {
"type": "boolean"
},
"description": "ChMasks controlling the channels to be used.\nLength of this field must be equal to the amount of uplink channels\ndefined by the selected frequency plan."
}
}
},
"v3CFListType": {
"type": "string",
"enum": [
"FREQUENCIES",
"CHANNEL_MASKS"
],
"default": "FREQUENCIES"
},
"lorawanv3MHDR": {
"type": "object",
"properties": {
"m_type": {
"$ref": "#/definitions/v3MType"
},
"major": {
"$ref": "#/definitions/v3Major"
}
}
},
"v3MType": {
"type": "string",
"enum": [
"JOIN_REQUEST",
"JOIN_ACCEPT",
"UNCONFIRMED_UP",
"UNCONFIRMED_DOWN",
"CONFIRMED_UP",
"CONFIRMED_DOWN",
"REJOIN_REQUEST",
"PROPRIETARY"
],
"default": "JOIN_REQUEST"
},
"v3Major": {
"type": "string",
"enum": [
"LORAWAN_R1"
],
"default": "LORAWAN_R1"
},
"v3JoinRequestPayload": {
"type": "object",
"properties": {
"join_eui": {
"type": "string",
"format": "string",
"example": "70B3D57ED000ABCD"
},
"dev_eui": {
"type": "string",
"format": "string",
"example": "70B3D57ED000ABCD"
},
"dev_nonce": {
"type": "string",
"format": "string",
"example": "ABCD"
}
}
},
"lorawanv3MACPayload": {
"type": "object",
"properties": {
"f_hdr": {
"$ref": "#/definitions/v3FHDR"
},
"f_port": {
"type": "integer",
"format": "int64"
},
"frm_payload": {
"type": "string",
"format": "byte"
},
"decoded_payload": {
"type": "object"
},
"full_f_cnt": {
"type": "integer",
"format": "int64",
"description": "Full 32-bit FCnt value. Used internally by Network Server."
}
}
},
"v3FHDR": {
"type": "object",
"properties": {
"dev_addr": {
"type": "string",
"format": "string",
"example": "2600ABCD"
},
"f_ctrl": {
"$ref": "#/definitions/v3FCtrl"
},
"f_cnt": {
"type": "integer",
"format": "int64"
},
"f_opts": {
"type": "string",
"format": "byte"
}
}
},
"v3FCtrl": {
"type": "object",
"properties": {
"adr": {
"type": "boolean"
},
"adr_ack_req": {
"type": "boolean",
"description": "Only on uplink."
},
"ack": {
"type": "boolean"
},
"f_pending": {
"type": "boolean",
"description": "Only on downlink."
},
"class_b": {
"type": "boolean",
"description": "Only on uplink."
}
}
},
"lorawanv3TxSettings": {
"type": "object",
"properties": {
"data_rate": {
"$ref": "#/definitions/v3DataRate",
"description": "Data rate."
},
"frequency": {
"type": "string",
"format": "uint64",
"description": "Frequency (Hz)."
},
"enable_crc": {
"type": "boolean",
"description": "Send a CRC in the packet; only on uplink; on downlink, CRC should not be enabled."
},
"timestamp": {
"type": "integer",
"format": "int64",
"description": "Timestamp of the gateway concentrator when the uplink message was received, or when the downlink message should be transmitted (microseconds).\nOn downlink, set timestamp to 0 and time to null to use immediate scheduling."
},
"time": {
"type": "string",
"format": "date-time",
"description": "Time of the gateway when the uplink message was received, or when the downlink message should be transmitted.\nFor downlink, this requires the gateway to have GPS time synchronization."
},
"downlink": {
"$ref": "#/definitions/TxSettingsDownlink",
"description": "Transmission settings for downlink."
},
"concentrator_timestamp": {
"type": "string",
"format": "int64",
"description": "Concentrator timestamp for the downlink as calculated by the Gateway Server scheduler.\nThis value takes into account necessary offsets such as the RTT (Round Trip Time) and TOA (Time Of Arrival).\nThis field is set and used only by the Gateway Server."
}
},
"description": "TxSettings contains the settings for a transmission.\nThis message is used on both uplink and downlink.\nOn downlink, this is a scheduled transmission."
},
"TxSettingsDownlink": {
"type": "object",
"properties": {
"antenna_index": {
"type": "integer",
"format": "int64",
"description": "Index of the antenna on which the uplink was received and/or downlink must be sent."
},
"tx_power": {
"type": "number",
"format": "float",
"description": "Transmission power (dBm). Only on downlink."
},
"invert_polarization": {
"type": "boolean",
"description": "Invert LoRa polarization; false for LoRaWAN uplink, true for downlink."
}
},
"description": "Transmission settings for downlink."
},
"v3DataRate": {
"type": "object",
"properties": {
"lora": {
"$ref": "#/definitions/v3LoRaDataRate"
},
"fsk": {
"$ref": "#/definitions/v3FSKDataRate"
},
"lrfhss": {
"$ref": "#/definitions/v3LRFHSSDataRate"
}
}
},
"v3FSKDataRate": {
"type": "object",
"properties": {
"bit_rate": {
"type": "integer",
"format": "int64",
"description": "Bit rate (bps)."
}
}
},
"v3LoRaDataRate": {
"type": "object",
"properties": {
"bandwidth": {
"type": "integer",
"format": "int64",
"description": "Bandwidth (Hz)."
},
"spreading_factor": {
"type": "integer",
"format": "int64"
},
"coding_rate": {
"type": "string"
}
}
},
"v3LRFHSSDataRate": {
"type": "object",
"properties": {
"modulation_type": {
"type": "integer",
"format": "int64"
},
"operating_channel_width": {
"type": "integer",
"format": "int64",
"description": "Operating Channel Width (Hz)."
},
"coding_rate": {
"type": "string"
}
}
},
"v3TxRequest": {
"type": "object",
"properties": {
"class": {
"$ref": "#/definitions/v3Class"
},
"downlink_paths": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/v3DownlinkPath"
},
"description": "Downlink paths used to select a gateway for downlink.\nIn class A, the downlink paths are required to only contain uplink tokens.\nIn class B and C, the downlink paths may contain uplink tokens and fixed gateways antenna identifiers."
},
"rx1_delay": {
"$ref": "#/definitions/v3RxDelay",
"description": "Rx1 delay (Rx2 delay is Rx1 delay + 1 second)."
},
"rx1_data_rate": {
"$ref": "#/definitions/v3DataRate",
"description": "LoRaWAN data rate for Rx1."
},
"rx1_frequency": {
"type": "string",
"format": "uint64",
"description": "Frequency (Hz) for Rx1."
},
"rx2_data_rate": {
"$ref": "#/definitions/v3DataRate",
"description": "LoRaWAN data rate for Rx2."
},
"rx2_frequency": {
"type": "string",
"format": "uint64",
"description": "Frequency (Hz) for Rx2."
},
"priority": {
"$ref": "#/definitions/v3TxSchedulePriority",
"description": "Priority for scheduling.\nRequests with a higher priority are allocated more channel time than messages with a lower priority, in duty-cycle limited regions.\nA priority of HIGH or higher sets the HiPriorityFlag in the DLMetadata Object."
},
"absolute_time": {
"type": "string",
"format": "date-time",
"description": "Time when the downlink message should be transmitted.\nThis value is only valid for class C downlink; class A downlink uses uplink tokens and class B downlink is scheduled on ping slots.\nThis requires the gateway to have GPS time sychronization.\nIf the absolute time is not set, the first available time will be used that does not conflict or violate regional limitations."
},
"frequency_plan_id": {
"type": "string",
"description": "Frequency plan ID from which the frequencies in this message are retrieved."
},
"advanced": {
"type": "object",
"title": "Advanced metadata fields\n- can be used for advanced information or experimental features that are not yet formally defined in the API\n- field names are written in snake_case"
}
},
"description": "TxRequest is a request for transmission.\nIf sent to a roaming partner, this request is used to generate the DLMetadata Object (see Backend Interfaces 1.0, Table 22).\nIf the gateway has a scheduler, this request is sent to the gateway, in the order of gateway_ids.\nOtherwise, the Gateway Server attempts to schedule the request and creates the TxSettings."
},
"v3DownlinkPath": {
"type": "object",
"properties": {
"uplink_token": {
"type": "string",
"format": "byte"
},
"fixed": {
"$ref": "#/definitions/v3GatewayAntennaIdentifiers"
}
}
},
"v3GatewayAntennaIdentifiers": {
"type": "object",
"properties": {
"gateway_ids": {
"$ref": "#/definitions/lorawanv3GatewayIdentifiers"
},
"antenna_index": {
"type": "integer",
"format": "int64"
}
}
},
"lorawanv3GatewayIdentifiers": {
"type": "object",
"properties": {
"gateway_id": {
"type": "string"
},
"eui": {
"type": "string",
"format": "string",
"example": "70B3D57ED000ABCD",
"description": "Secondary identifier, which can only be used in specific requests."
}
}
},
"v3TxSchedulePriority": {
"type": "string",
"enum": [
"LOWEST",
"LOW",
"BELOW_NORMAL",
"NORMAL",
"ABOVE_NORMAL",
"HIGH",
"HIGHEST"
],
"default": "LOWEST"
},
"v3Class": {
"type": "string",
"enum": [
"CLASS_A",
"CLASS_B",
"CLASS_C"
],
"default": "CLASS_A"
},
"v3EndDeviceIdentifiers": {
"type": "object",
"properties": {
"device_id": {
"type": "string"
},
"application_ids": {
"$ref": "#/definitions/v3ApplicationIdentifiers"
},
"dev_eui": {
"type": "string",
"format": "string",
"example": "70B3D57ED000ABCD",
"description": "The LoRaWAN DevEUI."
},
"join_eui": {
"type": "string",
"format": "string",
"example": "70B3D57ED000ABCD",
"description": "The LoRaWAN JoinEUI (AppEUI until LoRaWAN 1.0.3 end devices)."
},
"dev_addr": {
"type": "string",
"format": "string",
"example": "2600ABCD",
"description": "The LoRaWAN DevAddr."
}
}
},
"v3ApplicationIdentifiers": {
"type": "object",
"properties": {
"application_id": {
"type": "string"
}
}
}
},
"$ref": "#/definitions/lorawanv3DownlinkMessage"
}