This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP432E401Y: Unable to publish data more than 1024 bytes using NO-RTOS lwip mqtt

Part Number: MSP432E401Y

Hello,

I am using MSP432E401Y for implementing cloud based IoT data logging. I have used "simplelink_msp432e4_sdk_3_10_00_11" sdk in NO-RTOS mode and used its mbedtls library with lwip+mqtt.

I have successfully connected and published data upto 1000bytes to secure mqtt broker (viz. AWS/ Mosquitto, etc.). But when my data length goes beyond 1024 bytes, then while trying to publish data, it won't get received on broker; instead my connection with broker got disconnected. In mqtt library file, 'mqtt_recv_callback' function called with null pbuf which indicates connection is disconnected when I try to publish more than 1024bytes data.

Observations:

1. Data gets published to any mqtt broker successfully if length of the data is less than 1024 byes

2. I tried to publish data of length 2048 bytes using third party mqtt client viz. 'MQTT_BOX' on both AWS & Mosquitto secure broker and it got published successfully. (i.e. No error on broker side)

3. In lwipopts.h file I have set macros as: #define TCP_WND   4096, #define TCP_MSS    4096

4. In mqtt_opt.h file macro set as: #define MQTT_OUTPUT_RINGBUF_SIZE   5120

5. Below is the wireshark log where yellow highlighted row indicates the data being published by device (using lwip mqtt file) to secure mosquitto broker. But the broker sends disconnect i.e. (FIN,ACK) in response.

6. Below wireshark screenshot shows data being published successfully when its length is less than 1024 bytes (note highlighted yellow marked lines)

 

Kindly suggest some solution on this.

  • Hi,

    Thanks for describing you problem clearly and showing the steps you've taken.

    I tried to publish data of length 2048 bytes using third party mqtt client viz. 'MQTT_BOX' on both AWS & Mosquitto secure broker and it got published successfully. (i.e. No error on broker side)

    What happens if you publish 1175 bytes with a 3rd party client? What happens if you try to send 2048 bytes in your code?

    Is it possible to capture the 3rd party client TCP transaction using wireshark?

    Regards,

    Evan

  • Hi Evan, Thank you for the reply.

    1. When I try to publish data from 3rd party client then it got published successfully. Here attached the wireshark screenshot. Note in this case, data length is 1772 bytes.

    2. When I try to send 2048 bytes from my code, the result is same i.e. it got FIN,ACK from mqtt  broker and it got disconnected.

  • Are you able to inspect the contents of the packet to determine what is different between the working and non-working cases?

    Regards,

    Evan