1 of 1 people found this helpful
How frequently are you publishing the payload messages? The MQTT RTOS queue has a finite size and enough time should be provided for the queue to send messages. Does the function wiced_mqtt_publish() return WICED_SUCCESS? Can you consider using retries so that the messages are published again? Also at what QOS are you publishing?
I think the point of original report is about "payload over 1200 bytes". Should be nothing to do with "frequency".
Hello! Thank you for response.
I mean one published message about "payload over 1200 bytes".
I tried use all QoS mode, in all QoS mode this problem is the same.
My standard use case:
Init MQTT - OK.
Connect to broker - OK. (secure tls 1.2)
Subscribe to topic - OK.
Send one publish message - if this messages payload over than 1200 byte after few seconds function return "publish failed". if the payload for one publish message is less than 1200 publish success and I receive this message in Mqtt-Spy.
I just wanted to find out if he is publishing the message repeatedly in a loop. Now it is clear that he is getting this problem even after publishing the message once over MQTT.
Check if you are still facing this problem in the latest release of Wiced Studio 4.1.1 and let me know.
4 of 4 people found this helpful
Hello! I downloaded latest release and facing with this problem again.
I try to debug this problem and that's what I discovered.
While creating frame for publish messages in function "mqtt_backend_put_publish"
TCP stack allocates memory for this frame across function "mqtt_frame_create" an argument is passed to this function "MQTT_CONNECTION_FRAME_MAX" that set to dafault 4096 byte.
But in functions in NetX_Duo/WICED/tcpip.c - "wiced_packet_create_tcp"
where memory for frame must be allocated, argument "content_length" set as UNUSED_PARAMETER( content_length );
and tcpip stack allocates not more than 1375 bytes.
After this in "mqtt_frame_put_publish" created publish message and copy all payload that overflow allocated space.
I tried to limit args->data_len to 1300 byte and this fragmentation mqtt message will be published.
Any improvement for such issue? I am facing the same problem where I have a message of approx. 2200 bytes and this make the mqtt publish hang and the board will reset eventually.