MQTT_TX_BUFFER_TOO_SHORT_ERROR on AWS IoT embedded C

smeedy
Posts: 15
Joined: Sun Jan 22, 2017 10:35 pm

MQTT_TX_BUFFER_TOO_SHORT_ERROR on AWS IoT embedded C

Postby smeedy » Mon May 01, 2017 1:17 pm

Hi there,

We've been busy using the AWS IoT from the embedded C within the IDF. We also use shadow and everything works nicely, be it that initializing/retrieving the shadow state can sometimes cause random crashes which we have still under investigation.

We run a publishing loop just like the examples and for all messages < 512 bytes publishing an MQTT message on AWS IoT works like a charm. But as messages will be around 1000 and 2000 bytes in real life application, we run into the MQTT_TX_BUFFER_TOO_SHORT_ERROR (-33) message.

These settings are defined within the aws_iot_config.h file, but overriding these settings to 1024 or 2048 when sending just over 512 bytes will still return the MQTT_TX_BUFFER_TOO_SHORT_ERROR error.

Could this be a bug?

Kind regards,
Martijn

Koulwa
Posts: 19
Joined: Wed Feb 07, 2018 11:12 pm

Re: MQTT_TX_BUFFER_TOO_SHORT_ERROR on AWS IoT embedded C

Postby Koulwa » Thu May 31, 2018 9:00 pm

I know this message is a bit old now, but i was running into the same issue today.

Solution is, you dont just change it in the .h file, as that will be overwritten by the values in "make menuconfig"

so: make menuconfig -> component config -> amazon web services .. -> MQTT Tx Buffer length (512)

Change that to another size, make sure that your thread created for MQTT will be of sufficient size to hold it though.



Good luck!
Hive.Tech :: www.hive.technology
Pure Engineering :: www.pureengineering.com

Who is online

Users browsing this forum: No registered users and 129 guests