Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.



Each JSON formatted messages which may be received from the Cloud Injector Modules include a Topic and Payload.

The Topic contains the following key/value pairs:

    • namespace
      • Set as "spBv1.0"
    • edgeNodeDescriptor
      • The combination of the Group ID and Edge Node ID which provides a unique identifier for the Edge Node
    • groupId
      • The Group ID
    • edgeNodeId
      • The Edge Node ID
    • deviceId
      • The Device ID
    • type
      • Message type including:
        • NBIRTH
        • DBIRTH
        • DDATA
        • NDEATH
        • DDEATH
Note
The deviceId is only included for the device level message types of DBIRTH, DDATA and DDEATH



Anchor
NBIRTH
NBIRTH
NBIRTH

The Edge Node BIRTH message will contain the following:a Topic and Payload:

  • Topic
    • Namespace
    • Edge Node Descriptor
    • Group ID
    • Edge Node ID
    • Message Type
  • Payload
    • Timestamp - timestamp
  • The Sparkplug elements: Namespace, Group ID, Edge Node ID. They will be grouped under "topic" along with Edge Node Descriptor and Message Type
  • A "timestamp"
    • for when the payload was constructed
    • Metrics - array containing 
      • A
    "bdSeq"
      • Birth/Death sequence number to track the
    "
      • Sparkplug session
    "
      • of the
    Tag Agent
      • Edge client
      • Any Edge Node tags defined in the Edge Node folder
    (in our example we have none).
    • Seq - the
    A
    • message sequence number


Code Block
titleEdge Node Birth message
{
  "topic": {
    "namespace": "spBv1.0",
	"edgeNodeDescriptor": "G1/E1",
    "groupId": "G1",
    "edgeNodeId": "E1"
	"type": "NBIRTH"
  },
  "payload": {
    "timestamp": 1638223073190,
    "metrics": [
      {
        "name": "bdSeq",
        "timestamp": 1638223073187,
        "dataType": "Int64",
        "value": 05
      }
    ],
    "seq": 0
  }
}


Anchor
DBIRTH
DBIRTH
DBIRTH

The Device BIRTH message will contain the following:

  • The Sparkplug elements: Namespace, Group ID, Edge Node ID, Device ID.  They will be grouped under "topic" along with Message Type
  • A "timestamp" for when the payload was constructed
  • Any Device tags defined in the Device folder
  • A message sequence number


Code Block
titleDevice BIRTH message
{
  "topic": {
      "namespace": "spBv1.0",
      "edgeNodeDescriptor": "G1/E1",
      "groupId": "G1",
      "edgeNodeId": "E1",
      "deviceId": "D1",
      "type": "DBIRTH"
  },
  "payload": {
    "timestamp": 1638223073192,
    "metrics": [
        {
            "name": "T1",
            "timestamp": 1638223073192,
            "dataType": "Int32",
            "metaData": {},
            "properties": {
                "Quality": {
                    "type": "Int32",
                    "value": 192
                }
            },
            "value": 12
        }
    ],
    "seq": 1
  }
}


Anchor
DDATA
DDATA
DDATA

The Device DDATA message will contain the following:

  • The Sparkplug elements: Namespace, Group ID, Edge Node ID, Device ID.  They will be grouped under "topic" along with Message Type
  • A "timestamp" for when the payload was constructed
  • Any Device tags defined in the "Device folder that have changed
  • A message sequence number


Code Block
titleDevice DATA message
{
  "topic": {
    "namespace": "spBv1.0",
	"edgeNodeDescriptor": "G1/E1",
    "groupId": "G1",
    "edgeNodeId": "E1",
    "deviceId": "D1"
	"type": "DDATA"
  },
  "payload": {
    "timestamp": 1638223663812,
    "metrics": [
      {
        "name": "T1",
        "timestamp": 1638223662800,
        "dataType": "INT32",
        "value": 100
      }
    ],
    "seq": 2
  }
}


Anchor
NDEATH
NDEATH
NDEATH


Anchor
DDEATH
DDEATH
DDEATH





Understanding and decoding Ignition QualityCodes

...