hello,
I have some data like temperatures that are being published to my MQTT server but then I want to acces them in Ignition through sparkplugB. This is what I get in my MQTT server
and I want to have acces to the temperature value in my ignition. I have already set up a connection with the server in the websever and I can see the topic in the designer but it is like this
I have no idea how to work with sparkplug B and cannot find it on the internet either so hope that there is someone here that can help me out.
This doesn't look like sparkplug B to me. This is just a JSON string/document being passed over MQTT that you'll need to break out on your own. Sparkplug B will show up in your MQTT Engine tag provider with tags split out automatically for you with timestamps and quality being passed over the MQTT message.
Okay but how can I transform this to sparkplug B and publish it back in the mqtt server so that it is visible in ignition? I see people use node red but I don't know how to translate the json topic into sparkplug B
Are you using the CirrusLink module to push this data to your MQTT server or are you trying to do it by manually? Sparkplug B entails more than just pushing a specially formatted topic payload. There's the birth, last will and testament, etc that all needs to be part of it. It's easier to just use the CirrusLink module (I haven't used NodeRed with anything besides JSON payloads for MQTT, so not sure how well it complies with Sparkplug B).
Yes, you'll use the MQTT transmission module on the edge devices where the tags and data are collected (the spokes of a hub and spoke architecture). The MQTT engine module will be used to collect the data from all of the transmission modules and allows you to write to these same tags which will automatically write to the NCMD/DCMD topics to write data back. The engine module is the hub of a hub and spoke architecture. Finally the distributor module is the MQTT broker and facilitates the hub and spokes communications. This doesn't have to be the distributor module and can be any MQTT broker for the most part. I use EMQx, others use Mosquitto.
Time to look at the logs.. I'm not sure of which ones off the top of my head, but I know there are some DEBUG/TRACE loggers in MQTT Engine that you can enable to get more visibility of when messages are published to topics that you're subscribing to with your Custom Namespace configuration.
Sparkplug B will come under "Edge Nodes/Group ID/Node ID/Device ID/" in the MQTT Engine tag provider. MQTT engine is by default setup to subscribe to SpB topic, so you only need to connect MQTT engine to the MQTT server. The setup you show there, is for custom namespaces. SpB is not a custom namespace. From what I see on the broker, you're at a minimum missing the Birth Certificate.
The easiest "intro" to Sparkplug B is to use the Cirrus Link modules. Transmission you use to primarily convert Ignition-tags into Sparkplug B payloads. MQTT engine consumes the SpB namespace and converts SpB payloads into Ignition-tags.
If you want to send SpB payloads and topics writing a custom application, I highly recommend getting a descent grasp on the Sparkplug B specification prior to beginning. There are a few good resources on Youtube and some blogs around. Look for Kudzai Manditereza's content, it's good and technically detailed.
A Birth Certificate is an MQTT payload sent to a specific topic that announces to the "world" what tags/metrics/data is contained in the "node". It needs to be formatted according to the SpB specification.
Kind of. MQTT engine takes payloads from a sparkplug B compliant MQTT client, and turns them into Ignition-tags. These Ignition-tags are "useable" in Ignition. Have you read through the manual on how to setup a transmitter?
I have read it but still not sure how to use it properly.
I tried posting a topic with node red to my mqtt server but it is just not coming under edge nodes/plc 1
the transmitter is giving all the tags I have in a certain tag provider to my MQTT server but I want a way to send data from the MQTT server to ignition. For example, I have a temperature in our office that is being published to my mqtt broker and I want to use that temperature in my ignition. I'm just not getting it available in ignition. Not even when I try to publish a sparkplug b formatted topic with node red to mqtt.
Sounds like you don't need to use Sparkplug B. You can publish regular mqtt instead. Back to the original post you sent, it seems you just need to active "json-payload" in your custom namespace configuration, and the values should show up as Ignition-tags. It's under MQTT Engine settings in the gateway config.