AWS re:Post을(를) 사용하면 다음에 동의하게 됩니다. AWS re:Post 이용 약관

AWS Greengrass: Trouble with MQTT-IPC bridging with 1 Client device -> multiple Core devices

0

I am following this tutorial for MQTT messaging: https://docs.aws.amazon.com/greengrass/v2/developerguide/client-devices-tutorial.html#develop-client-device-subscriber-component

I have 1 Client device associated with 2 Core devices (whereas the tutorial has 1 Client and 1 Core device, my understanding is that one-to-many should work as well). On both Core devices, I've deployed an aws.greengrass.clientdevices.mqtt.Bridge with the following topic mapping:

"mqttTopicMapping": {
      "HelloWorldIotCoreMapping": {
        "topic": "test_topic",
        "source": "LocalMqtt",
        "target": "IotCore"
      },
      "HelloWorldPubsubMapping": {
        "topic": "test_topic",
        "source": "LocalMqtt",
        "target": "Pubsub"
      }
    }

When sending messages using the tutorial's basic_discovery.py script, I run the following command on both Core devices – and see messages being sent. That works great: sudo /greengrass/v2/bin/greengrass-cli iotcore sub -t 'test_topic' Result:

Successfully subscribed to topic: test_topic
{"message": "Hello World! ", "sequence": 0}
{"message": "Hello World! ", "sequence": 1}
...

But - when I re-run the discovery script on Client and run this command on both Core devices, only ONE of the two Core devices outputs the IPC messages sudo /greengrass/v2/bin/greengrass-cli pubsub sub -t 'test_topic'

Why might the MQTT bridge relay be working on only one of the two Core devices? Deployments are identical on both Cores.

I'll call the Core device successfully receiving IPC messages device A, and the Core device receiving MQTT messages (but failing to receive IPC) device B. Something else I noticed — when I go to Core device A's console and disassociate the Client device from device A, the IPC messages immediately start coming up on device B.

Policies and selectionRule in clientdevices.Auth are definitely set correctly.

Also – as a test, I added a third Core device, device C. Now, only device C receives pubsub messages, while all 3 devices continue to receive iotcore messages. It's almost as if the MQTT bridge mapping is working on one of the three Core devices, at random.

I have tried:

  • Reinstalling Greengrass core
  • Restarting Greengrass service
  • Restarting the MQTT / Moquette services
  • Trying the same basic_discovery script on a different client device
  • Resolved; I didn't look at the implementation of basic_discovery.py closely enough, it just takes the first valid IoT endpoint connection and disregards the rest.

질문됨 8달 전243회 조회
1개 답변
1
수락된 답변

Resolved; I didn't look at the implementation of basic_discovery.py closely enough, it just takes the first valid IoT endpoint connection and disregards the rest.

답변함 8달 전
profile picture
전문가
검토됨 8달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인