Skip to main content

Uplink Message

Important Note

For more informations, please refer to the full documentation, check the only endpoint documentation, you can found example and description of all fields.

Message structure

  • All Uplink (UL) and Downlink (DL) messages use JSON format.

  • All datetimes use the ISO8601 format.

Multiple parameters set on the connection configuration can impact the output format (For instance, sendRawDecodedFormat).

See below an uplink example:

message

Original message

The following Uplink message is sent by all connections from ThingPark X IoT Flow to any IoT cloud platform (regardless of connector type).

{
"DevEUI_uplink": {
"Time": "2018-10-03T15:38:46.882+02:00",
"DevEUI": "0018B20000000B20",
"FPort": "1",
"FCntUp": "1174",
"ADRbit": "1",
"MType": "4",
"FCntDn": "1229",
"payload_hex": "9e1c4852512000220020e3831071",
"mic_hex": "cfffc70f",
"Lrcid": "00000206",
"LrrRSSI": "-80.000000",
"LrrSNR": "7.000000",
"SpFact": "7",
"SubBand": "G2",
"Channel": "LC6",
"DevLrrCnt": "1",
"Lrrid": "004A18E3",
"Late": "0",
"LrrLAT": "45.851032",
"LrrLON": "1.266230",
"Lrrs": {
"Lrr": [
{
"Lrrid": "004A18E3",
"Chain": "0",
"LrrRSSI": "-80.000000",
"LrrSNR": "7.000000",
"LrrESP": "-80.790100"
}
]
},
"CustomerID": "1100000077",
"CustomerData": {
"alr": {
"pro": "ADRF/DEMO",
"ver": "2"
},
"tags": [
"site=Paris"
],
"name": "My Demo Device"
},
"ModelCfg": "1:TemperatureService, 2:SwissPostDevice",
"InstantPER": 0.0,
"MeanPER": 0.0,
"DevAddr": "04D2848E",
"AckRequested": 1,
"TxPower": 2.0,
"NbTrans": 1,
"Frequency": 868.1,
"DynamicClass": "A"
}
}
PropertiesDescription
TimeTime when the message is send
DevEUIId of the device which send the message
FPortPort used by the device
FCntUpUplink frame counter. Used to know if the device lost any frame.
ADRbitADRBit set by the device. ADRbit is not filled in the document, if not set in the uplink frame. Syntax: NUMBER (Unsigned integer: 0..1)
MTypeLoRaWAN® MType of the packet. Syntax: NUMBER (Unsigned integer: 0..7)
FCntDnDownlink frame counter. Used to know if the device lost any frame.
payload_hexMessage in its crypted format.
mic_hexMIC in hexadecimal ASCII format. Syntax: STRING (Hexadecimal representation)
CustomerIDId of the customer
CustomerDataJSON customer data set by provisioning:
  • "loc": administrative location (OPTIONAL)
    • "lat" (latitude) and "lon" (longitude) sub-attributes.
  • "alr": application layer (OPTIONAL)
    • "pro" (product) and "ver" (version) sub-attributes
  • XML Syntax: STRING. JSON Syntax: OBJECT
InstantPERInstant PER (Packet Error Rate). The instant PER is computed from a sliding window of last packets. Syntax: NUMBER (Float)
MeanPERMean PER (Packet Error Rate). Syntax: NUMBER (Float)
DevAddrDevice DevAddr. Syntax: STRING (Hexadecimal representation)
AckRequestedACK requested indicator (Boolean). Syntax: NUMBER (Unsigned integer: 0..1)
rawMacCommandsHexadecimal ASCII dump of the LoRaWAN® MAC option or LoRaWAN® MAC payload (port=0). Syntax: STRING (Hexadecimal representation)
NbTransThe number of transmissions for each uplink message requested by the LRC, according to ADR algorithm and validated by the device through a LinkADRAns MAC command. If no LinkADRAns have been yet validated by the device, NbTrans = 1. Syntax: NUMBER (Unsigned Integer)
TxPowerThe transmission power of the device (in dBm), computed by the LRC based on ADR algorithm and validated by the device through a LinkADRAns. If no LinkADRAns have been yet validated by the device, the device boot parameter is used instead. Syntax: NUMBER (Float)

Gateway properties

PropertiesDescription
LrcidID of the LRC that processed the packet. Syntax: STRING (Hexadecimal representation)
LrrRSSIGateway's signal strengh (including disturbance).
LrrSNRGateway's signal to noise ratio. (min: -20, max: 19). The higher the number is, the purest the signal is.
SpFactSpreading factor used by the device. It's the transmission speed on air. (min: 7, max: 12).
SubBandSub-band used by the device. Syntax: STRING
ChannelChannel used by the gateway to send the packet.
DevLrrCntFrame counter of the gateway. (a verifier si c'est en relation avec fcntup)
LrridId of the gateway used to send the packet.
LateIndicates if the packet was queued by the LRR. Late is always filled.
  • 0 means that the packet was not queued by the LRR.
  • 1 means that the packet was queued (the LRR queues packets when the connection between the LRR and the LRC is temporarily out of service).
Syntax: NUMBER (Unsigned integer: 0..1)
LrrLATLatitude of the gateway
LrrLONLongitude of the gateway
LrrsList of associated gateways
Important note

The following properties are particular to the driver:

  • ModelCfg
  • DriverCfg
  • messageType
  • mode
  • batteryVoltage
  • ackToken
  • firmwareVersion
  • bleFwVersion
  • resetCause
  • periodicPosition
  • userAction
  • appState
  • onDemand

Decoded message

When using a driver, the hexadecimal payload is decoded. The following message include this decoded payload.

    {
"DevEUI_uplink": {
"Time": "2020-01-06T12:46:54.285+01:00",
"DevEUI": "20635F0108000E09",
"FPort": 17,
"FCntUp": 265,
"ADRbit": 1,
"MType": 2,
"FCntDn": 9,
"payload_hex": "0520be8800400108c9000000",
"mic_hex": "3bcf2927",
"Lrcid": "00000127",
"LrrRSSI": -65.0,
"LrrSNR": 9.5,
"SpFact": 7,
"SubBand": "G1",
"Channel": "LC3",
"DevLrrCnt": 2,
"Lrrid": "08050376",
"Late": 0,
"LrrLAT": 43.615501,
"LrrLON": 7.066182,
"Lrrs": {
"Lrr": [
{
"Lrrid": "08050376",
"Chain": 0,
"LrrRSSI": -65.0,
"LrrSNR": 9.5,
"LrrESP": -65.461838
},
{
"Lrrid": "C0001BC3",
"Chain": 0,
"LrrRSSI": -69.0,
"LrrSNR": 8.75,
"LrrESP": -69.543648
}
]
},
"CustomerID": "100002164",
"CustomerData": {
"alr": {
"pro": "ABEE/APY",
"ver": "1"
},
"tags": [
"site=Paris"
],
"name": "My Demo Device"
},
"ModelCfg": "1:TWA_100002157.11278.AS",
"DriverCfg": {
"app": {
"mId": "asset-tracker",
"pId": "abeeway",
"ver": "1"
},
"id": "abeeway:asset-tracker:1"
},
"InstantPER": 0.0,
"MeanPER": 0.0,
"DevAddr": "04D2848E",
"AckRequested": 1,
"TxPower": 2.0,
"NbTrans": 1,
"Frequency": 868.1,
"DynamicClass": "A",
"payload": {
"messageType": "HEARTBEAT",
"mode": "MOTION_TRACKING",
"batteryVoltage": 3.85,
"ackToken": 0,
"firmwareVersion": "1.8.201",
"bleFwVersion": "0.0.0",
"resetCause": 40,
"periodicPosition": false,
"temperature": 24.8,
"userAction": 0,
"appState": 0,
"moving": false,
"onDemand": false,
"payload": "0520be8800400108c9000000",
"InstantPER": 0.0,
"MeanPER": 0.0,
"DevAddr": "055E1C4E",
"AckRequested": 0,
"rawMacCommands": "",
"TxPower": 2.0,
"NbTrans": 1,
"Frequency": 867.9,
"DynamicClass": "A"
}
}
}

Decoded payload only

When you expect receive only the result of a decoded message, on your connection configuration, you need to set the parameter sendRawDecodedFormat=true.

    {
"messageType": "HEARTBEAT",
"mode": "MOTION_TRACKING",
"batteryVoltage": 3.85,
"ackToken": 0,
"firmwareVersion": "1.8.201",
"bleFwVersion": "0.0.0",
"resetCause": 40,
"periodicPosition": false,
"temperature": 24.8,
"userAction": 0,
"appState": 0,
"moving": false,
"onDemand": false,
"payload": "0520be8800400108c9000000"
}

Error while decoding the message

When an uplink is not properly decoded due to any possible reason, the payload received while look similar to this:

    {
"DevEUI_uplink": {
"Time": "2022-02-09T12:45:00.380+00:00",
"DevEUI": "70B3D531C00027C8",
"FPort": 1,
"FCntUp": 80,
"ADRbit": 1,
"MType": 2,
"FCntDn": 3,
"payload_hex": "4c0500021d0f3701573c627f38385a553c313b343d3937301b2b292c201e221f161611120a0a0a07",
"mic_hex": "50e6783d",
"Lrcid": "000000CB",
"LrrRSSI": -52,
"LrrSNR": 13,
"LrrESP": -52.212383,
"SpFact": 12,
"SubBand": "G2",
"Channel": "LC4",
"DevLrrCnt": 5,
"Lrrid": "1000050A",
"Late": 0,
"LrrLAT": 48.874847,
"LrrLON": 2.333962,
"Lrrs": {
"Lrr": [
{
"Lrrid": "1000050A",
"Chain": 0,
"LrrRSSI": -52,
"LrrSNR": 13,
"LrrESP": -52.212383
}
]
},
"CustomerID": "100002164",
"CustomerData": {
"loc": {
"lat": "48.886091468604",
"lon": "2.2618200552642787"
},
"alr": {
"pro": "WECO/bob",
"ver": "1"
},
"tags": [
"PDM"
],
"name": "Bob Device"
},
"ModelCfg": "1:TWA_100002164.1105.AS",
"DriverCfg": {
"mod": {
"pId": "nke",
"mId": "bob",
"ver": "1"
},
"app": {
"pId": "eolane",
"mId": "bob",
"ver": "1"
}
},
"InstantPER": 0,
"MeanPER": 0.000005,
"DevAddr": "04A8D6E2",
"AckRequested": 0,
"rawMacCommands": "",
"TxPower": 13,
"NbTrans": 1,
"Frequency": 867.1,
"DynamicClass": "A",
"payloadDecodedError": {
"code": "com-5002",
"message": "driver internal error: Error: Invalid fPort!"
}
}
}
Note

The field payloadDecodedError contains the reason of the unavailability of the decoded payload.

Legacy format

When you expect to receive the legacy format (Dx-Dataflow product), on your connection configuration, you need to set the parameter sendMetadata=true.

{
"Time": "2020-01-06T12:46:54.285+01:00",
"DevEUI": "20635F0108000E09",
"FPort": 17,
"FCntUp": 265,
"ADRbit": 1,
"MType": 2,
"FCntDn": 9,
"payload_hex": "0520be8800400108c9000000",
"mic_hex": "3bcf2927",
"Lrcid": "00000127",
"LrrRSSI": -65.0,
"LrrSNR": 9.5,
"SpFact": 7,
"SubBand": "G1",
"Channel": "LC3",
"DevLrrCnt": 2,
"Lrrid": "08050376",
"Late": 0,
"LrrLAT": 43.615501,
"LrrLON": 7.066182,
"Lrrs": {
"Lrr": [
{
"Lrrid": "08050376",
"Chain": 0,
"LrrRSSI": -65.0,
"LrrSNR": 9.5,
"LrrESP": -65.461838
},
{
"Lrrid": "C0001BC3",
"Chain": 0,
"LrrRSSI": -69.0,
"LrrSNR": 8.75,
"LrrESP": -69.543648
}
]
},
"CustomerID": "100002164",
"CustomerData": {
"alr": {
"pro": "ABEE/APY",
"ver": "1"
}
},
"ModelCfg": "1:TWA_100002157.11278.AS",
"DriverCfg": {
"app": {
"mId": "asset-tracker",
"pId": "abeeway",
"ver": "1"
},
"id": "abeeway:asset-tracker:1"
},
"payload": {
"messageType": "HEARTBEAT",
"mode": "MOTION_TRACKING",
"batteryVoltage": 3.85,
"ackToken": 0,
"firmwareVersion": "1.8.201",
"bleFwVersion": "0.0.0",
"resetCause": 40,
"periodicPosition": false,
"temperature": 24.8,
"userAction": 0,
"appState": 0,
"moving": false,
"onDemand": false,
"payload": "0520be8800400108c9000000",
"InstantPER": 0.0,
"MeanPER": 0.0,
"DevAddr": "055E1C4E",
"AckRequested": 0,
"rawMacCommands": "",
"TxPower": 2.0,
"NbTrans": 1,
"Frequency": 867.9,
"DynamicClass": "A"
}
}