The difference between aws-iot-device-sdk and Amazon freertos internal lib?

embeddedx wrote on September 13, 2019:

I’m trying to have deep understanding of the AWS-IOT-APIs.
I can see that the SDK documentation [] differs from the github repo implementation [] .
Could some one clear this to me?

Edited by: embeddedx on Sep 13, 2019 4:48 AM

gordon-AWS wrote on September 13, 2019:


The documentation you linked is the documentation for version 4 of the C SDK. Version 4 is currently in beta, and available on the v4_beta branch of the GitHub repo.

The master branch of the C SDK contains version 3 (stable). Documentation for version 3 is available here:

embeddedx wrote on September 15, 2019:

Thanks for your reply.
The poin is the APIs in the SDK differs from used in the awsFreertos.
For example:
aws_iot_mqtt_init is not found in amazonFreeRTOS.

Kind regards

Gaurav-Aggarwal-AWS wrote on September 16, 2019:

As mentioned by Gordon, there are two versions AWS IoT Device SDK for C - Version 3 and Version 4.
The version of C-SDK libraries in Amazon FreeRTOS are same as version 4 and not version 3.

aws_iot_mqtt_init is an API which exists in version 3 of C-SDK and therefore is not expected to be in Amazon FreeRTOS. The corresponding API is IotMqtt_Init which exists both in Amazon FreeRTOS and version 4 of C-SDK. Note that there are still some minor differences between the libraries in Amazon FreeRTOS and C-SDK version 4 and we are working on making them same.


embeddedx wrote on September 19, 2019:

Thanks for your reply.

I have a couple of questions:
1- Is iot_mqtt_agent.c a part of the library or just a wrapper to handle MQTTv1/v2?
2- I’m trying to merge the greengrass demo with the OTA demo but the issue that the greengrass uses the mqtt agent APIs and the OTA uses the mqtt v2 APIs directly, so is it better to use the agent APIs or the MQTTv2 directly in both demos?
3- Can I create multiple MQTT clients?
4- If I have Single/Multiple MQTT clients, are the mqtt APIs thread save or should I use synchronization between tasks?


aggarg wrote on September 19, 2019:

It is a wrapper and internally calls v2 APIs.

Thank you for bringing it to our attention. You should use v2 APIs directly. We will update our demos to use v2 APIs directly.

Yes you can. You are only limited by the amount of RAM you have.

The MQTT APIs are thread safe.


Excuse me, i bring up the topic here, i get the message that the API beween with AFR(Amazon FreeRTOS) and C-SDK will keep same finally in version 4. i checked the page - GitHub - aws/aws-iot-device-sdk-embedded-C at v3.1.2, now the API is not same with AFR(Amazon FreeRTOS), for example, C-SDK use aws_iot_mqtt_init, while AFR use MQTT_Init(in core_mqtt.c). So in the version 4, C-SDK will use the API in core_mqtt.c,same with AFR, right ?
BTW, what’s the plan for version 4?

Some things have changed since then. Our libraries are standalone consumable now and live in their own repositories. We also provide long term support (LTS) for our libraries - LTS Libraries - FreeRTOS

C-SDK, Amazon FreeRTOS and FreeRTOS/FreeRTOS all use the same libraries.

We use date based version numbers for C-SDK and the latest version is 202108.00: Tags · aws/aws-iot-device-sdk-embedded-C · GitHub

There is no version 4 as I mentioned above. The latest (and future) versions of C-SDK will continue to use coreMQTT.


Thanks, i understand the mechanism, it make sense.