Git Product home page Git Product logo

Comments (4)

Namoshek avatar Namoshek commented on September 3, 2024

A connection timeout is most likely caused by a blocked firewall. Are you certain the device, from which you connect, can access the broker?

from client-examples.

ashu5130 avatar ashu5130 commented on September 3, 2024

Yes my device can access the broker. Still getting the same error.

from client-examples.

Namoshek avatar Namoshek commented on September 3, 2024

Ok, so I've given this a try myself and it did work as expected. Are you using the onboarding tutorial for a device or are you already familiar with AWS IoT Core? The part which might be an issue is the policy which contains the allowed client id(s) and topic(s):

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "iot:Publish",
        "iot:Receive"
      ],
      "Resource": [
        "arn:aws:iot:eu-central-1:<account>:topic/sdk/test/java",
        "arn:aws:iot:eu-central-1:<account>:topic/sdk/test/python",
        "arn:aws:iot:eu-central-1:<account>:topic/sdk/test/js"
      ]
    },
    {
      "Effect": "Allow",
      "Action": [
        "iot:Subscribe"
      ],
      "Resource": [
        "arn:aws:iot:eu-central-1:<account>:topicfilter/sdk/test/java",
        "arn:aws:iot:eu-central-1:<account>:topicfilter/sdk/test/python",
        "arn:aws:iot:eu-central-1:<account>:topicfilter/sdk/test/js"
      ]
    },
    {
      "Effect": "Allow",
      "Action": [
        "iot:Connect"
      ],
      "Resource": [
        "arn:aws:iot:eu-central-1:<account>:client/sdk-java",
        "arn:aws:iot:eu-central-1:<account>:client/basicPubSub",
        "arn:aws:iot:eu-central-1:<account>:client/sdk-nodejs-*"
      ]
    }
  ]
}

Allowed client ids are therefore sdk-java, basicPubSub and sdk-nodejs-* (prefix). And publishing as well as subscribing is allowed for the topic patterns sdk/test/java, sdk/test/python and sdk/test/js.

from client-examples.

ashu5130 avatar ashu5130 commented on September 3, 2024

Thanks, this has solved my issue.

from client-examples.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.