Sparkplug and AWS IoT


#1

Hello All, I’m trying to connect an Epic PR1 Sparkplug to an AWS IOT thing. I’ve followed the AWS IoT setup documentation and created the AWS thing and have set up an AWS Policy with allow access to IOT:* resource * and have created a certificate linking it to the policy and thing.

I’ve downloaded the required certificates and can connect to the thing and publish using MQTT.fx and also read that same data using the test tool.

The question is, how do I connect the epic PR1 Sparkplug, which uses a username and single CA certificate.

Any help would be appreciated.


#2

I’ve experimented with AWS IoT before but I haven’t tried what I think you are going for here, I haven’t used Sparkplug with AWS IoT at all.
What are you trying to accomplish with this setup and do you have any references or examples?


#3

Terry, right now, we are just in the experimenting stage.

i’m actually just trying to learn and experiment with Epic and MQTT at this point in time. We’ve experimented with Groov connections to the public Opto22 provided broker. I’ve reviewed your video with MQTT and sparkplug as well.

We wanted to begin experimenting with our own private broker on the AWS cloud. I suppose we could have begun experimenting with other cloud brokers like cloudMQTT, but thought we would begin with AWS.

Our ultimate goal would be to begin using MQTT to connect our multiple PLC’s at various locations to various HMI’s and data stores.


#4

If you want your AWS IoT Thing data in your EPIC, going across the AWS private broker, you could try subscribing to that broker from Node-RED using the built-in MQTT client. Once you’ve read in the Thing data using the MQTT input node you can save it to an Opto tag, display it in groov View, or move it wherever you need.

Does that sound like the kind of approach you’re looking for?


#5

Oh. I’m trying to send data FROM the Epic PLC TO the IoT Thing


#6

If I can jump in here… Have you looked at sending data with a Node-RED MQTT node?
You can upload a certificate for that broker in the node, so that ‘gets around’ the fact that EPIC only has the one certificate that you mentioned in your first post.
In fact, it seems you can have any number of MQTT brokers each with their own certificates. Pretty cool.


#7

right… I’ve been successful at the Node-RED MQTT node into the IoT Thing. I didn’t know if I was doing something wrong with the configuration for Sparkplug. I liked the much more regimented JSON data that get’s transmitted through the sparkplug configuration as well.

Thank you


#8

I’m glad you have it communicating in both directions! You also might find this forum post useful, it covers how to decode (and can encode) Sparkplug messages in a Node-RED flow.

Also thanks for the tip @Beno.


#9

Ok, thanks guys. I appreciate your help.