Sending MQTT Protobuf via Script


I want to send mqtt messages from a script using the existing MQTT Engine connection to field devices. For this purpose, system.cirruslink.engine.publish() looks like the right tool for the job, but it doesn’t seem to encode the message with Protobuf.

All messages currently sent to / from the MQTT Engine connection is already encoded with Protobuf, but messages sent manually using this script is not.

Is there a function or feature or option that I’m not aware of to help us do this?

Kind regards,

There isn’t anything built into the MQTT Engine scripting API to support publishing of Sparkplug/protobuf messages. However, Ignition does support importing custom Python libraries. See the following links:

Using this method, you could add ‘Tahu’ to Ignition:

This would allow you to write scripts such the one below in Ignition: