Set up IOT with MQTT?

0

Hi,

I've read that the recommended way to use IOT services is via MQTT topics, and I'd like to do that, but I'm unsure how. Is there some MQTT topic already created that is associated with my IOT instance? Or, do I need to create the topic myself and link it to my IOT instance? If the latter, how is this done?

Thanks.

3개 답변
1

So if I decide I want to have a topic called "temperature", I just post to that topic? I don't have to pre-configure it anywhere?

Frank
답변함 2년 전
  • Correct. You can create a topic like so /myThing/Temperature and then you can publish to it. Or have a thing subscribe to it.

  • Thanks. Can there be a topic like /Temperature that multiple things can post to? Also, is there a way I can see a list of topics that have messages?

  • Posting to a topic is dictated by the IoT Policy attached to the certificate for the device. If the policy allows publishing to a single topic, then yes - you should be able to publish from multiple places to the same topic.

    I am not aware of a way to see all topics that have messages. I will look into that.

1

Topics are ephemeral resources in your IoT Core account. Your devices publish and subscribe to topics at runtime, so long as they have the permission to do so through their policy. If you are brand new to AWS IoT Core, you may find useful the first few lessons in this Skill Builder series: https://explore.skillbuilder.aws/learn/public/learning_plan/view/86/iot-learning-plan

AWS
Ryan_B
답변함 2년 전
0

There are some reserved topics that you can access depending on the services you're using. A common one is the Shadow service where the updates to a device shadow are published.

Other than that, you can follow this guide on how to design your topics and can subscribe or publish to them.

As an example, when you create a Thing in the device registry, you can download a starter kit. It shows you a python example on how a client can subscribe to a topic. Here's a relevant example from the SDK repository

AWS
답변함 2년 전

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

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

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

관련 콘텐츠