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 Respuestas
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
respondido hace 2 años
  • 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
respondido hace 2 años
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
respondido hace 2 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas