# FreeRTOS MQTT Example CC3220SF

**URL:** <https://forums.freertos.org/t/freertos-mqtt-example-cc3220sf/8833>\
**Category:** AWS\
**Created:** [March 22, 2018, 4:53pm UTC](https://forums.freertos.org/t/freertos-mqtt-example-cc3220sf/8833 "2018-03-22T16:53:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [March 22, 2018, 4:53pm UTC](https://forums.freertos.org/t/freertos-mqtt-example-cc3220sf/8833/1 "2018-03-22T16:53:51Z")

</div>

**[lukelee36](https://forums.aws.amazon.com/profile.jspa?userID=445920)** 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

---

<div class="post-metadata">

**Author:** ![aggarg](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/aggarg/32/4245_2.png) [@aggarg](https://forums.freertos.org/u/aggarg)\
**Post date:** [April 2, 2018, 11:51pm UTC](https://forums.freertos.org/t/freertos-mqtt-example-cc3220sf/8833/2 "2018-04-02T23:51:19Z")

</div>

**[Gaurav-Aggarwal-AWS](https://forums.aws.amazon.com/profile.jspa?userID=447386)** 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
