Mqtt Topic in IOT Core

0

Hi,

I have two out of four IoT devices successfully subscribing to my broker on the topic 'sdk/test/js'. They are working fine and receiving the messages as expected. After that, I created a second topic 'sdk/test/akm'. However, the other two devices are unable to subscribe to this new topic. Could this issue be related to certificates, or is there something else I'm missing?

Additionally, how do I create extra topics? I thought it was possible to do this by simply adding a "/" to the topic.

Thank you for your assistance!

已提問 3 個月前檢視次數 172 次
2 個答案
3
已接受的答案

Each device should have a unique certificate to authenticate with AWS IoT. When multiple devices use the same certificate, it might be a security breach.
For the problematic device(s): go to IoT Core -> Things -> select the thing -> Certificates -> click on the attached certificate -> Policies -> click on the policy (default policy name: GreengrassV2IoTThingPolicy) -> check to have something similar to:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "iot:Connect",
        "iot:Publish",
        "iot:Subscribe",
        "iot:Receive"
      ],
      "Resource": "*"
    }
  ]
}

Ressource line should be "*" (access to all topics, less secure but good for testing) or only the arn of the intended topic. Your current policy attached to the problematic devices might include only the arn of "sdk/test/js" which explains limited access to this topic only.

profile pictureAWS
已回答 3 個月前
profile picture
專家
已審閱 3 個月前
2

Please check the IoT policy attached to the new devices - does it include permissions to connect and subscribe to 'sdk/test/akm'?

profile pictureAWS
已回答 3 個月前
  • The new Device are all connected with the same certificates? I cant find anything about policies by All Devices>Things. When i change the topic in the two newer devices to sdk/test/js it works.... So i guess the policies are correct? Correct me if im wrong

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南