Two way Communication In ignition via MQTT using mosquitto broker

I am trying to establish two way communication between ignition and my device (raspberrypi).
There are some control devices which are connected to Raspberrypi publishing the data to ignition using mosquitto broker . I want to control the devices from ignition like switching them on/off. I have setup Read/Write access to the tags as well as in the designer . i am running a subscriber in the raspberrypi by subscibing to the required topic .But when i try to switch it on by pressing on the boolean tag , i am getting an error like “Error writing to the tag : Bad_Read only” . I am not able to control the devices .

I guess you are using cirrus mqtt engine… If so the tags can only write to sparkplug nodes. Are you using the sparkplug specification?

An easier way around would be to use system.Mqtt.Publish(). You can put that on an event script based on a memory tag. Also, the same memory tag can be updated by a tag change script on the original tag from the mqtt engine

What are you running on the pi, nodered?

Hello ,
Yes you are right . I am using cirrus link MQTT engine module in Ignition.
I didn’t know that mqtt engine module only supports sparkplug node writes.

We are not using NodeREd.
We are writing a python script to read the data from the sensors and to publish the data to mosquitto broker without using sparkplug specification.
Thank you for this info .

And also i have another doubt like something.
We have used Sparkplug specification before . The reason we are not using sparkplug specification now is because we have stuck with a problem in sparkplug . It’s like if we run two or three sparkplug written programs simultaneously , the program which was exectuted in the last is only publishing the tags to the ignition and the remaining programs are not publishing .Those programs are not stopped , we are not seeing bad stale on the tag .They are still running ,but they are not publishing the tags . Only the last executed program is publishing the tags. I am not getting where am i doing wrong . Do you or anyone using sparkplug and ignition know the reason for this ??
It would be a great help if someone can solve this issue.

I am using sparkplug, I’ve tried with python c and java script. Can there be that you are not setting it up properly? Just mentioning this because I found it a bit difficult setting up the DBIRTH certificates. Make sure you gather all DBIRTH for a device. And remember that you can only call NBIRTH once. All devices under a node gets killed during NBiRTH, and reborn with DBIRTH if properly setup.

Sounds like your programs all run separately. If you make global variables, and make sure that only the first one give NBiRTH. Create watchdogs, and make sure the last one is sending NDEATH.

Or create completely segregated programs, with unique nodes

yes we executed all the programs seperately. And we have checked using unique nodes just now , but the result is the same as above mentioned .

And the naming for the programs are also unique. Node names, (and mqtt client name)?

I think you have to debug and check the logs.

Yup ! i will try and let you know .

Thank you .