Page tree
Skip to end of metadata
Go to start of metadata


Contents


Sending Plaintext


LORIOT Network Server users can send data down to end devices, and the applications can respond to over-the-air join requests.

send downlink messages using either plaintext (we encrypt the data in the server) or ciphertext (you encrypt the data).

Messages will be enqueued and delivered based on target device class.

Message format Typescript interface notation

{
    cmd        : 'tx';	  // must always have the value 'tx'
    EUI        : string;  // device EUI, 16 hex digits (without dashes)
    port       : number;  // port to be used (1..223)
    confirmed? : boolean; // NEW!  (optional) request confirmation (ACK) from end-device
    data       : string;  // data payload (to be encrypted by our server)
                          // if no APPSKEY is assigned to device, this will return an error
}
                


Example Message

  {
    "cmd"       : "tx",
    "EUI"       : "0102030405060708",
    "port"      : 1,
    "confirmed" : true,
    "data"      : "0102AABB"
}               


ParameterTypeDescription
cmdstringidentifies type of message, always 'tx' for downlink messages
EUIstringdevice EUI, 16 hex digits (without dashes)
portnumberport number (1 to 223)
confirmedboolean (optional)NEW! request confirmation (ACK) from end-device
datastringdata payload (to be encrypted by our server) as a hexadecimal stringm, minimum two hex characters (equivalent of one byte).


Sending ciphertext 


The payload has to be encrypted using the latest downlink FCnt and the appropriate APPSKEY.

The FCntDown must correspond to the latest FCntDown reported by the 'txd' message.

If FCnt doesn't match, an error will be returned with the current seqdn.

Message format Typescript interface notation


{
    cmd        : 'tx';	 // must always have the value 'tx'
    EUI        : string;  // device EUI, 16 hex digits (without dashes)
    port       : number;  // port to be used (1..223)
    confirmed? : boolean; // NEW! (optional) request confirmation (ACK) from end-device
    encdata    : string;  // data payload (already APPSKEY encrypted)
    seqno      : number;  // must correspond to the latest FCnt reported by the 'txd' message
}              


Example Message

{
    "cmd"       : "tx",
    "EUI"       : "0102030405060708",
    "port"      : 1,
    "confirmed" : true,
    "encdata"   : "0102AABB"
    "seqno"     : 1,
}


ParameterTypeDescription
cmdstringidentifies type of message, always 'tx' for downlink messages
EUIstringdevice EUI, 16 hex digits (without dashes)
portnumberport number (1 to 223)
confirmedboolean (optional)NEW! request confirmation (ACK) from end-device
encdatastringdata payload (APPSKEY encrypted) as a hexadecimal string, minimum two hex characters (equivalent of one byte).
seqnonumbermust correspond to the latest FCnt reported by the 'txd' message


Acknowledgement of send request 


Acknowledgement is returned immediately after issuing the 'tx' command.

Message format Typescript interface notation

{
    cmd      : 'tx';	// always has the value 'tx'
    EUI      : string;  // device EUI, 16 hex digits (without dashes)
    success? : string;  // on success, will contain a confirmation message
                        // only present if the command succeeded
    error?   : string;  // string describing the encountered error
                        // only present if the command failed
    data?    : string;  // data that was enqueued (either plaintext or ciphertext)
                        // only present if the command succeeded
}


Example Message

{
    "cmd"     : "tx",
    "EUI"     : "0102030405060708",
    "success" : "Downlink message enqueued.",
    "data"    : "0102AABB"
}


ParameterTypeDescription
cmdstringidentifies type of message, always 'tx' for this type of message
EUIstringdevice EUI, 16 hex digits (without dashes)
successstring(optional)If command succeeded, it will contain a confirmation message.
errorstring (optional)If command failed, it will report the error description.
datastring (optional)data that was enqueued (either plaintext or ciphertext), only present on success.


Downlink Conformation Event


The confirmation event is sent once the packet has been sent to gateway for delivery.


Message format Typescript interface notation

{
    cmd      : 'txd';	// always has the value 'txd'
    EUI      : string;  // device EUI, 16 hex digits (without dashes)
    seqdn    : number;  // FCnt used for the downlink
    ts       : number;  // unix timestamp, moment of the transfer to gateway
}


Example Message

{
    "cmd"   : "txd",
    "EUI"   : "0102030405060708",
    "seqdn" : 1,
    "ts"    : 1470850675434
}


ParameterTypeDescription
cmdstringidentifies type of message, always 'txd' for this type of message
EUIstringdevice EUI, 16 hex digits (without dashes)
seqdnnumberFCnt used for the downlink.
tsnumberUnix timestamp, at the moment of the transfer to gateway.
  • No labels