MQTT Agent to Connect with AWS

We have set up a number of MQTT Agent assets in OR to connect with various brokers. In most cases we just need the Host and Port to connect.
We now need to connect to a MQTT broker hosted in AWS and need to use their credentials along the lines of this:

const options = {
protocol: ‘mqtt’,
host: ‘a1o1xxyyzz86k-ats.iot.us-east-1.amazonaws.com’,
port: 8883,
ca: [fs.readFileSync(‘./AmazonRootCA1.pem’)],
cert: fs.readFileSync(‘./device.pem.crt’),
key: fs.readFileSync(‘./private.pem.key’),
};

Can anyone please advise how to deal with this in OR where we have to authenticate via certificates?

Hey there,

To connect to the AWS MQTT broker from OR using certificates:

Ensure you have the necessary certificates ready.
Create a new MQTT Agent in OR with the provided details.
Save the configuration.
This setup allows your MQTT Agent to authenticate with the AWS MQTT broker using the certificates provided.

Let me know if you need more help!

Thanks Shawn - I just noticed your reply.

I have created a new MQTT Agent with the Host address and Port and it goes into a waiting status.
Are there particular attributes etc to save the certificates and keys into?

Thanks again

Hello

To connect an MQTT Agent in OpenRemote (OR) to an AWS MQTT broker using certificate authentication, you can try below steps -

Ensure you have the following files: AmazonRootCA1.pem, device.pem.crt, private.pem.key.
Go to the OpenRemote Manager.
Navigate to the MQTT Agent asset configuration.
Upload or specify the paths for the certificate files.
Set up the MQTT Agent with these details:

{
“protocol”: “mqtts”,
“host”: “a1o1xxyyzz86k-ats.iot.us-east-1.amazonaws.com”,
“port”: 8883,
“caPath”: “/path/to/AmazonRootCA1.pem”,
“certPath”: “/path/to/device.pem.crt”,
“keyPath”: “/path/to/private.pem.key”
}
Adjust the paths to where your certificates are stored in OpenRemote.
Save the configuration and test the connection to ensure it works.

Hope it helps ! :slightly_smiling_face:

Thank you

Thanks coolmarco

I will give this a try and let you know how I go.

Regards
Clint

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.