MQTTAgent Publish is slow as compare to FreeRTOS MQTT


I am trying to upgrading the CC3220SF-LAUNCHXL device with AWS-IOT FreeRTOS SDK 202002 to 202107.

With the same device (clock speed) configurations, I am trying to publish the data(~135kb) by using coreMQTT Agent v1.0.0.

But previous version I used to publish the same data using FreeRTOS MQTT V2.1.1 is much faster than the current coreMQTT Agent version (almost double time taken).

Instead of Agent I tried standalone coreMQTT as well but no much use.

Is this expected behaviour with the latest coreMQTT Agent v1.0.0 ?
If possible how can I overcome this with the latest upgrade process to save battery Power.


Please post a link to the original project. Which tcp stack is it using? Asking as different tcp stacks have different event mechanisms.

Hi rtel,

Thanks a lot for your suggestion, I have downloaded the code base from the following link. Please find below link for your reference. (Both old and new code base downloaded from the same as below).

version Info:

Latest code Base: AWS FreeRTOS 202107.00
Old code Base: AWS FreeRTOS 202002.00


Hi rtel,

Case 1:
I tried using the MQTTAgent Connection context passing to the coreMQTT-Publish, in this case I can see improvement in speed. but huge data loss observed.

Case 2:
Direct CoreMQTT connection (without Agent) and tried publishing, Not much increase in speed but data loss observed.

  1. Please help me out speeding up the MQTT-Agent .
  2. Or else Please help me to avoid data loss for the case1. (QOS1 also didn’t help me)


I think QOS will always make your transfer slower as it adds data to the link, but data loss should never happen on a TCP socket even without QOS1, in fact if data loss happens on a MQTT connection the connection would break and need teardown as the MQTT protocol cannot handle data loss.

I think you should understand why you are losing data because that is definitely not normal, there is no case where you should ever see any data loss during normal operation.

If you can provide Wireshark logs to us then that’d be great. I would also like to understand what do you mean by data loss since as Cobus pointed out, without a break in the connection, there should not be any data loss over MQTT (which uses underlying TCP) connection.

EDIT: Additionally, would you mind checking whether the configASSERT is defined in your copy of FreeRTOSConfig.h file?