Wiced 4.x.x MQTT publish over 1200 byte occurs fail.

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hello!

Please help, I developed application that use MQTT protocol over TCP/TLS 1.2 connection.

If I try send payload messages that small than 1200 bytes this messages successfully send to AWS MQTT broker or my custom RabbitMQ broker on my local server.

If payload over 1200 bytes my app stuck, but not hard fault.

I tried to use Wiced studio 4.0.x and last version Wiсed studio 4.1 and two boards BCM943362WCD4 and BCM94343WWCD2 result same for this two boards.

May be anyone faced this problem.

Thank you.

0 Likes
7 Replies
GauravS_31
Moderator
Moderator
Moderator
10 questions asked 250 solutions authored 250 sign-ins

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".

0 Likes

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.

0 Likes
Anonymous
Not applicable

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.

0 Likes
GauravS_31
Moderator
Moderator
Moderator
10 questions asked 250 solutions authored 250 sign-ins

Check if you are still facing this problem in the latest release of Wiced Studio 4.1.1 and let me know.

0 Likes
Anonymous
Not applicable

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.

GiCe_1962491
Level 3
Level 3
10 replies posted 10 questions asked 5 replies posted

Hello folks!

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.