Documentation
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

MQTT V2 Integration

Overview

MQTT V2 connects the Network Server to an external MQTT broker and supports V2 data converters, extended MQTT settings, and configurable topics.

Only V2 data converters can be used with MQTT V2.

MQTT V2 Integration Parameters

NOTE: that document describes version 2.0 (v2) of MQTT Integration. It contains extended list of configuration parameters.

Use the same table structure as MQTT V1 and include all MQTT V2-specific fields exposed by the current UI. For REST-only options, link to MQTT Integration V2 API.

  • Name
    any unique Integration Name

  • Type
    Integration Type

  • Data Converter
    Name of the Data Converter which will be used to decode and encode payload of Devices provisioned to the current Integration. NOTE: Only Converter v2 can be used with Integration v2.

  • Application address
    MQTT Broker address. Domain name or IP

  • Port
    MQTT Broker Port

  • Username/Token
    provided by MQTT Broker

  • Password
    provided by MQTT Broker

  • Push Topic
    Topic where Network Server will publish UL messages.
    To use separate MQTT topics per device please use placeholder in ${deviceEUI} format. example: v1/push/${deviceEUI}

  • Pull Topic
    Topic on which Network Server will listen for DL messages

  • Enable TLS
    Enable or disable TLS / MQTTs

  • Client ID
    MQTT client ID
    MQTT v3.1 → max len 23 symbols
    MQTT v3.1.1 → max len 256 symbols

  • pendingQueue max size
    Set the maximum number of outgoing messages with QoS>0 that can be pending in the outgoing message queue

  • max inflight messages
    Set the maximum number of UL messages with QoS>0 that can be in the process of being transmitted simultaneously

  • connection timeout (seconds)
    This value defines the maximum time interval the Network Server will wait for the network connection to the MQTT Broker to be established

  • cleanSession
    Tells the broker whether the client wants to establish a persistent session or not. In a persistent session (CleanSession = false), the broker stores all subscriptions for the client and all missed messages for the client that subscribed with a Quality of Service (QoS) level 1 or 2. If the session is not persistent (CleanSession = true), the broker does not store anything for the client and purges all information from any previous persistent session

  • keepAlive interval (seconds)
    This interval defines the longest period of time that the broker and client can endure without sending a message. The client commits to sending regular PING Request messages to the broker. The broker responds with a PING response

  • push retained
    Retained defines whether the message is saved by the Broker as the last known good value for a specified topic. When a new client subscribes to a topic, they receive the last message that is retained on that topic

  • push QoS
    QoS for push topic

  • Send empty payload
    If selected LoRa packet will be pushed to application via MQTT even if FRMPayload is empty

  • Allow All Ports
    Defines which LoRa ports can be used

  • clientCertificate
    clientCertificate can be:

    • passed as string
    • drag-and-dropped
    • uploaded file from PC
  • caCertificate
    caCertificate can be:

    • passed as string
    • drag-and-dropped
    • uploaded file from PC
  • clientPrivateKey
    clientPrivateKey can be:

    • passed as string
    • drag-and-dropped
    • uploaded file from PC

{
  "devAddr": "076d51cf",
  "adrBit": true,
  "recvTime": 1393250970,
  "margin": 0,
  "deviceEui": "{devEUI}",
  "deviceModelName": "{deviceModelName}",
  "deviceName": "{deviceName}",
  "deviceModelId": "{deviceModelId}",
  "deviceClass": "{deviceClass}",
  "fPort": 10,
  "gatewayCount": 2,
  "rfRegion": "EU868",
  "dataRate": 7,
  "fCntUp": 427,
  "fCntDown": 25,
  "battery": 0,
  "confirmed": false,
  "ackBit": false,
  "frmPayload": "AQAACAQAAA3CAQAWAggAA2cBFgRoGGA/AWQ=",
  "devStatusTimeMillis": 0,
  "applicationId": "{applicationId}",
  "applicationName": "{applicationName}",
  "uLFreq": 867300000,
  "gatewayRxInfo": [
    {
      "gwEui": "{gatewayMac}",
      "antennaId": 0,
      "rssi": -115,
      "snr": -1,
      "lat": null,
      "lon": null,
      "alt": null,
      "gatewayName": "{gatewayName}",
      "channel": 1,
      "codeRate": "4/5",
      "crcStatus": 1,
      "dataRate": {
        "modulation": "LORA",
        "spreadFactor": 7,
        "bandwidth": 125
      },
      "gwTimeUtcMillis": null,
      "gwTimeGpsMillis": null,
      "rsig": null
    }
  ]
}
  • recvTime
    GPS Seconds - the moment NS received the UL, represented as GPS time in seconds (number of seconds since January 6, 1980). This is not a Unix/UTC timestamp: the two epochs differ by 315964800 seconds (3657 days), so a recvTime value read directly as Unix time is off by about 10 years. To convert: unixSeconds = recvTime + 315964800 - 18, where 18 is the number of leap seconds between UTC and GPS time as of 2017.

  • gatewayRxInfo[].gwTimeGpsMillis
    Gateway reception time in GPS milliseconds, using the same epoch as recvTime. May be null.

  • gatewayRxInfo[].gwTimeUtcMillis
    Gateway reception time in Unix/UTC milliseconds. May be null.

{
  "deviceEui": "647FDA0000000000",
  "confirmed": false,
  "msgId": "1",
  "data": {
    "field1": "value1", 
    "field2": "value2"
    ...
  }
}

Troubleshooting

In addition to the MQTT V1 checks:

  • verify that ${deviceEUI} is spelled exactly as supported;
  • verify the V2 converter output;
  • review retry statistics for publish failures.