4

Working on a edge case with AWS greengrass we plan to run multiple docker container on the device which shall communicate with each other using MQTT.

So far we managed to install and connect greengrass, deploy container and use the interprocess communication with the greengrass component aws.greengrass.clientdevices.mqtt.Moquette.

ipc_client = awsiot.greengrasscoreipc.connect()

Which is using a socket connection.

How can I connect my applications to the local MQTT broker using Host, Port and Authentication?

something like this

myAWSIoTMQTTClient = AWSIoTPyMQTT.AWSIoTMQTTClient(CLIENT_ID)
myAWSIoTMQTTClient.configureEndpoint(ENDPOINT, PORT)
if PATH_TO_ROOT and PATH_TO_KEY and PATH_TO_CERT:
  myAWSIoTMQTTClient.configureCredentials(PATH_TO_ROOT, PATH_TO_KEY, PATH_TO_CERT)
myAWSIoTMQTTClient.connect()

So far I can only establish a connection using IPC. Especially for development an alternative connection mode would be helpful. Furthermore we would also like to attach external Devices to the MQTT broker.

Thanks for your support!

1 Answers1

0

The moquette broker enforces the same mutual TLS for clients that AWS IoT does. All MQTT clients that connect must be registered as things in IoT core, have an X.509 certificate, and be associated with the Greengrass core for discovery (needed for connecting other devices). Once that is done and the client device auth component configured, you can use the discovery mechanism of Greengrass to obtain moquette's endpoint and the signing CA used for the moquette server certificate (contents would be used for PATH_TO_ROOT). Check out the basic discovery sample for how this works.

I would stick with using the IPC method, even during development. Is there something missing by using the IPC that makes development more difficult?

gadams999
  • 53
  • 1
  • 6