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

**URL:** <https://forum.inductiveautomation.com/t/help-needed-when-publishing-data-to-ignition-using-mqtt-sparkplug-b-using-python-script/43298>\
**Category:** Ignition\
**Created:** [February 11, 2021, 12:59pm UTC](https://forum.inductiveautomation.com/t/help-needed-when-publishing-data-to-ignition-using-mqtt-sparkplug-b-using-python-script/43298 "2021-02-11T12:59:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sayyammehra](https://avatars.discourse-cdn.com/v4/letter/s/e79b87/32.png) [@sayyammehra](https://forum.inductiveautomation.com/u/sayyammehra)\
**Post date:** [February 11, 2021, 12:59pm UTC](https://forum.inductiveautomation.com/t/help-needed-when-publishing-data-to-ignition-using-mqtt-sparkplug-b-using-python-script/43298/1 "2021-02-11T12:59:26Z")

</div>

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_1](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/2/129d1f2915515e86cf28251a45e250211f6859c4.png)

Script 2

 ![script_2](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/6/e6bfb938caf5fedb1797ef9958d81131ec7e16d9.png)

Ignition Tag Browser when running Single Script

 ![Ignition_1](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/6/a65d1f1de0384662666406c2d1eb975164f5cb22.png)

Ignition Tag Browser when running both scripts together

 ![Ignition_2](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/e/de4352b798f8e3df9fa47b2cbe5df890b3f33db3.png)

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [February 11, 2021, 5:58pm UTC](https://forum.inductiveautomation.com/t/help-needed-when-publishing-data-to-ignition-using-mqtt-sparkplug-b-using-python-script/43298/2 "2021-02-11T17:58:57Z")

</div>

@wes0johnson maybe?

---

<div class="post-metadata">

**Author:** ![sayyammehra](https://avatars.discourse-cdn.com/v4/letter/s/e79b87/32.png) [@sayyammehra](https://forum.inductiveautomation.com/u/sayyammehra)\
**Post date:** [February 11, 2021, 6:12pm UTC](https://forum.inductiveautomation.com/t/help-needed-when-publishing-data-to-ignition-using-mqtt-sparkplug-b-using-python-script/43298/3 "2021-02-11T18:12:03Z")

</div>

Hi Kevin,

Is there a workaround to solve this problem?

---

<div class="post-metadata">

**Author:** ![wes0johnson](https://avatars.discourse-cdn.com/v4/letter/w/7ab992/32.png) [@wes0johnson](https://forum.inductiveautomation.com/u/wes0johnson)\
**Post date:** [February 11, 2021, 6:32pm UTC](https://forum.inductiveautomation.com/t/help-needed-when-publishing-data-to-ignition-using-mqtt-sparkplug-b-using-python-script/43298/4 "2021-02-11T18:32:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![sayyammehra](https://avatars.discourse-cdn.com/v4/letter/s/e79b87/32.png) [@sayyammehra](https://forum.inductiveautomation.com/u/sayyammehra)\
**Post date:** [February 12, 2021, 6:49am UTC](https://forum.inductiveautomation.com/t/help-needed-when-publishing-data-to-ignition-using-mqtt-sparkplug-b-using-python-script/43298/5 "2021-02-12T06:49:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [February 12, 2021, 1:09pm UTC](https://forum.inductiveautomation.com/t/help-needed-when-publishing-data-to-ignition-using-mqtt-sparkplug-b-using-python-script/43298/6 "2021-02-12T13:09:24Z")

</div>

> [@sayyammehra](#):
>
> 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.
