Forums - MQTT With Max Payload Length

6 posts / 0 new
Last post
MQTT With Max Payload Length
congngale
Join Date: 13 Jul 18
Posts: 3
Posted: Fri, 2018-07-13 10:51

Hi All,

I am developing a product base on QCA4010 which will receive a signal from IR module and send it to a Broker over MQTT protocol.

I have done with developing MQTT client to publish/subscribe message but I could not publish a message with payload length more than 400.

When I try to send a packet with size is 512 or 1024 the MQTT library return error -5 which is (PUBLISH_ERROR).

So, There is anyway to help me to get the MQTT client able to publish message with size more than 400.

Thanks,

Cong Nga Le

 

  • Up0
  • Down0
jbhanu Moderator
Join Date: 6 Feb 17
Posts: 80
Posted: Wed, 2018-07-18 02:36

Hi , 

The maximum payload length of MQTT publish is 512 . It also includes Topic and thing name. 

Regards

Jyotiranjan 

  • Up0
  • Down0
congngale
Join Date: 13 Jul 18
Posts: 3
Posted: Thu, 2018-07-19 03:58

Hi jbhanu,

Thank for your information. I have managed to only publish/subcribe message with payload length under 480 bytes then it is worked.

But, I face another problem which is the MQTT client disconnected and throw SOCKET_CLOSE error message if I receive round 8 - 10 messages.

I guess it is an issue in socket layer about buffering, do I have any way to verify and fix this problem?

Thanks,

Cong Nga Le

  • Up0
  • Down0
jbhanu Moderator
Join Date: 6 Feb 17
Posts: 80
Posted: Thu, 2018-07-19 05:14

Ok. What is the size of each messages? 

 

Regards

Jyotiranjan 

  • Up0
  • Down0
congngale
Join Date: 13 Jul 18
Posts: 3
Posted: Thu, 2018-07-19 08:49

Hi jbhanu,

I usually send 2 packet a time, with 452 bytes for first packet and 258 bytes for second packet. I have send multiple time which is around 8  to 10 times, in total I have sent 16 - 20 packets then the issue happens.

Thanks,

Cong Nga Le

  • Up0
  • Down0
jbhanu Moderator
Join Date: 6 Feb 17
Posts: 80
Posted: Wed, 2018-07-25 10:48

Can you please try to reproduce the same with mosquitto broker locally and share me the steps. 

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.