MQTT Engine JSON Parsing Error on NBIRTH Payload

Cross posting from the Inductive Forum here: MQTT Engine JSON Parsing Error on NBIRTH Payload - 3rd Party Modules - Inductive Automation Forum

Ignition Version: 8.1.38
MQTT Engine Version: 4.0.21
MQTT Transmission Version: 4.0.21

I am currently testing the MQTT Transmission and Engine Modules with HiveMQ as the broker. When I set my Transmission side server to use JSON encoding instead of protobuf the engine side stops being able to process the payloads.

I start seeing the following error on the engine side:

Looking at the NBIRTH payload it appears to be valid to me:

{
“timestamp”: 1712061288423,
“metrics”: [
{
“name”: “Node Control/Next Server”,
“timestamp”: 1712061288423,
“dataType”: “Boolean”,
“value”: false
},
{
“name”: “Node Info/Transmission Version”,
“timestamp”: 1712061288425,
“dataType”: “String”,
“value”: “4.0.21 (b2024012622)”
},
{
“name”: “bdSeq”,
“timestamp”: 1712061288423,
“dataType”: “Int64”,
“value”: 5
},
{
“name”: “Node Control/Rebirth”,
“timestamp”: 1712061288423,
“dataType”: “Boolean”,
“value”: false
}
],
“seq”: 0
}

Switching the encoding to Protobuf resolves the problem, so worst case scenario that becomes the solve, but having the payloads in JSON makes processing them easier downstream and helps at the current system testing stages.

Any thoughts would be appreciated.

Hello Marc,

Yes, this is to be expected. If our Sparkplug B Default Namespace is enabled it will choke on a JSON message coming from Transmission as it expects any message on the spBv1.0/ Topics to be encoded in Protobuf.

At MQTT Engine, you will have to disable the Default SparkplugB Namespace so that your Custom Namespace is the only namespace enabled to process the JSON from Transmission if you don’t want to see these messages.

I should add that to get the JSON message processed properly at Engine while using the Transmission module to send that JSON (not Protobuf) payload you will need to add the String Conversion to remove the ‘.’ period character from the spBv1.0 Topic. We usually see spBv1.0 become spBv1_0 or something legal in Ignition.

In general, we don’t consider this a proper configuration.

Daniel