Skip to main content
Version: 1.8.5

CREATING AN AWS Greengrass with MQTT CONNECTION

This page explains how to connect the MQTT connector to the MQTT broker of an AWS IoT Greengrass core device.

The data follows this path: LoRaWAN® device → ThingPark Enterprise → ThingPark X IoT Flow connection → AWS IoT Greengrass core device.

Before you create the connection, you need a Greengrass core device installed and configured, as described in AWS Greengrass. Then create an MQTT connection with the values below.

Collecting Expected Information​

Parameters required

UI FieldDescription
CertificateClient certificate of your associated client device.
Private KeyClient private key file of your associated client device.
CA CertificateTrusted CA certificate of your core device.
Client IDClient ID used to connect to your MQTT broker.
ProtocolSet to SSL.
Connection TimeoutSet to 10000 ms.
Action TimeoutSet to 10000 ms.

Certificate and Private Key​

Collect the certificate and the private key of the associated client device. Associated client device

CA Certificate​

Retrieve the CA certificate of your core device (represented by a thing) with the Greengrass discovery API. The following example gives the certificates of a client device to authenticate a request to the Greengrass discovery API endpoint.

curl -i --cert 1a23bc4d56.cert.pem \
--key 1a23bc4d56.private.key \
https://greengrass-ats.iot.us-west-2.amazonaws.com:8443/greengrass/discover/thing/MyClientDevice1

If the request succeeds, this command returns a response similar to this example:

{ "GGGroups": [ { "GGGroupId": "greengrassV2-coreDevice-MyGreengrassCore", "Cores": [ { "thingArn": "arn:aws:iot:us-west-2:123456789012:thing/MyGreengrassCore", "Connectivity": [ { "Id": "AUTOIP_192.168.1.4_1", "HostAddress": "192.168.1.5", "PortNumber": 8883, "Metadata": "" } ] } ], "CAs": [ "-----BEGIN CERTIFICATE-----\ncert-contents\n-----END CERTIFICATE-----\n" ] } ] }

The certificate returned in this response is the CA of the Greengrass core device.

Client ID​

The client ID of your MQTT connection must be the thing name of your core device. Thing name

Attention Points​

  • Do not use MQTT credentials (username and password). The thing is authenticated with its private key and certificate.
  • The MQTT client ID must be the name of the thing that the connector represents.
  • The thing that represents the connector must also have permission to perform the greengrass:Discover action.
  • The default Connection Timeout and Action Timeout settings of the MQTT connector are too short to connect to an AWS Greengrass core device. Set them to 10 seconds.