Fixed Interval MQTT Publishing

Hi. We are quite keen to start using Ignition Edge with MQTT Transmission module across a number of our client sites, but we’re hitting an issue that I’m hoping someone can shed some light on.

We are involved in Industrial Energy Efficiency, so a lot of the data we gather in sites is energy data, often in the form of totalised values from energy meters.

Our preferred architecture for getting the data from the edge to our cloud platform is MQTT publishing to AWS IOT Core. I’m aware IOT Core is not properly Sparkplug compliant, but it’s sufficient for our purposes.

My issue is that we want to know the latest value for all of our edge tags every minute, regardless of whether it’s changed or not. A unchanged totalised value is just as informative as a changed one, in that it indicates no energy was consumed in that preceding minute. The problem is that the MQTT Transmission module only seems to publish when the tag value changes and that’s no good to us.

Could I suggest an enhancement to the configuration of a MQTT Transmitter to tell it that all tags it’s responsible for publishing, should be published on a fixed interval (configurable), regardless of whether they have changed since last published. That would solve our problem perfectly and allow us get started on a rollout of Ignition Edge.

Thanks, John.

Hi John, I am currently experimenting pushing Ignition Data directly to AWS IoT Core. However, I am unable to get it to work. Just want to check whether are you able to do it? Would be nice if you share your experience as well. Thanks!

Have you taken a look at the python scripting extensions that are now available with MQTT Transmission (and other modules)? Those might help you craft a more specific solution, though you’d likely need to have an Edge Compute license that allows for gateway event scripts.

Hi. Yes, we’ve looked at the Python scripting, but could not get it working the way we wanted. It also seemed like an overly complicated workaround for what seemed like a reasonably simple use case.

Yes, we have data being published from Ignition to IOT Core directly. Can you describe the sort of issues you’re encountering? The main things to get right are the uploading of the three files (Root CA file, Key File and Cert file) and then referencing these in the TLS section of MQTT Broker config. Also, you need to ensure the Client ID in the Advanced section is the exact name of the Thing created in IOT Core for which you have the Cert/Key files. Finally, if a restrictive policy has been applied, you have to ensure you’re not trying to publish or subscribe to topics the policy doesn’t permit. That will cause the connection to be dropped. Also, having another client anywhere else connecting with the same Client ID will cause the connection to be dropped.

Thanks for response!

Basically after creating the sever with the certs, AWS IoT Core says that unauthorised access. I have followed your method, but fails to connect. I am using iot:* as permission for testing purpose. I suspect is the Transmitter configuration. Do you have any special configurations?

Nothing special, no. I’ll see if I can paste in screen snippets of all the relevant config areas.

Within Config → Mqtt Transmission → MQTT Transmission Settings

Within the Main settings for my connection to IOT Core:

Within the TLS settings for my connection to IOT Core:

where those files referenced are previously uploaded using the “Certificates” tab beside the Settings tab:

and within the Advanced settings for same:

And within the Sparkplug Settings for the Transmitter config:

which controls the structure of the topic the transmitter will publish to.

Assuming then you associate a very loose policy with the Thing and Cert you created, it would only need the following:

That’s what’s required to get connected and it does work, but you have to be careful to associate the correct files (CA, Cert and Key) with the right fields, and the ThingName as the Client ID to ensure when connected, it knows what Thing is connecting and what Cert it’s expecting to see, and also what Policy to apply. It’s easy enough to get part of it wrong, but Ignition does work if you configure it correctly.

Thanks for your detailed explanation!

Turns out my policy was wrongly configured! I never use “*” for “Resource”!

Thanks once again! :slight_smile:

Jumping on this discussion…

So is there an option to publish tags at a fixed rate? In our case I would like to publish a complete UDT, not just the values that changed. If this option exists, it would be great if someone could point me in the right direction.