Use Local MQTT Broker With AWS Greengrass Component

0

I have an existing component that uses both Greengrass IPC messages, and MQTT messages, to communicate to other local components (via IPC) and AWS cloud (MQTT).

I now need to enable a messaging integration with a non-Greengrass Docker running on the same device. I was thinking of using MQTT messaging from the Greengrass Docker image, and implementing Greengrass between the two.

Could someone suggest a way of implementing this, where I could use existing AWS Greengrass resources to implement a local MQTT publisher, such that a non greengrass container can implement an MQTT subscriber and receive those messages ?

asked 10 months ago423 views
2 Answers
0

About the question for bridging IPC to EMQx MQTT broker, yes, you can use the MQTT Bridge component for that as you indicated. For sending pubsub messages, not sure why you would want to use greengrass-cli, please use the PubSub APIs: https://docs.aws.amazon.com/greengrass/v2/developerguide/ipc-publish-subscribe.html#ipc-operation-publishtotopic Note that the MQTT client subscriber on the non-greengrass docker image needs to be registered as an IoT Thing.

answered 10 months ago
  • Thanks for the answer. With regards to the greengrass cli pubsub, that's just for initial testing, we will use the pubsub APi's for the final version.

    is it possible to implement the MQTT subscriber on the non-greengrass image, while not as in IOT Thing ? Or does greengrass only support sending messages via MQTT to IoT Things.

  • Correct, at this time, MQTT subscriber (non-greengrass image) must to be registered as an IoT Thing.

0

Follow-Up Clarification:

I would like to receive local messages, inside a docker container, from Greengrass. This docker container runs entirely separately and is not greengrass related, though it runs on the same device as greengrass.

What I am trying:

  • MQTT subscriber in the non-gg container (using paho mqtt in python)
  • In Greengrass:
    • Greengrass MQTT broker (EMQX) component
    • Greengrass MQTT Bridge component (configured with src: Pubsub and target: LocalMQTT)
    • Sending pubsub messages with greengrass-cli pubsub

Am I way off in my approach ? Is it possible to bridge in this way, gg IPC messages to EMQX MQTT broker ?

answered 10 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions