Help needed when publishing data to Ignition using MQTT Sparkplug B using Python script

Hi,

I am trying to post data from a csv file to Ignition Scada using python script which reads the data from csv file and publishes it to chariot broker using MQTT Sparkplug B. I have multiple csv files and data from each file is posted by separate python scripts.

When I run only one python script the data gets posted in Ignition Scada but when I run two scripts the tags inside Ignition Scada goes “bad_stale”. The group id and node id is same for all the scripts but the device id is different.

I have also used MQTTfx and Node-Red to subscribe to the the topic and the data is being published there. I think the issue is with Ignition Scada.

Kindly help me to resolve the above issue. I am sharing screen shots of scripts and ignition for the reference.

Script 1

Script 2

Ignition Tag Browser when running Single Script

Ignition Tag Browser when running both scripts together

@wes0johnson maybe?

Hi Kevin,

Is there a workaround to solve this problem?

Sparkplug requires that every MQTT client have a unique combination of the Group ID and Edge Node ID. In your case you have two MQTT clients (one per script) with the group_id=‘Site A’ and edge_node_id=‘Area 1’. If you change one of these to be something different, it should resolve your issue.

1 Like

Actually, the data is being published when I subscribe to the Chariot broker with other applications such as MQTTfx and Node-Red. They also support MQTT Sparkplug B.

One node can have many different devices and the device IDs are unique. I don’t think the issue is with Sparkplug B

Yes, but Wes is suggesting that each node be represented by 1 MQTT client connection and by running 2 scripts for the same node you have 2 MQTT client connections for that node.