FreeRTOS MQTT Example CC3220SF

lukelee36 wrote on March 22, 2018:

Hello, I make my bacholar work based on this work.
I need to know, how to use this example. I make in main.c several task. I measure value od Carbon dioxide from I2C and save value to Queue.

But I don’t know, how to use aws_hellow_word example to send this value of Carbon Dioxide to AWS IoT service via MQTT. Would you advise me how to proceed?

Thanks you

Gaurav-Aggarwal-AWS wrote on April 02, 2018:

Hello,

Here is how the aws_hello_world demo works:

  1. The MQTT client subscribes to the freertos/demos/echo topic and then publishes a message on the same topic every 5 seconds.
  2. Since the client is subscribed to the same topic, it receives the same message back from the broker.
  3. It then appends the string “ACK” to the received message and re-publishes it on the same topic.
  4. The client receives the “ACK” message (which was published in step 3) back from the broker but does not publish it again as it sees the “ACK” string in the message.

So if you just want to send your data to AWS IoT over MQTT, you need to publish it on some topic. You can take a look at the function prvPublishNextMessage in the file aws_hello_world.c for an example of how to publish data on an MQTT topic.

Let us know if that helps.

Thanks,
Gaurav