having trouble in using MQTT in my application

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

cross mob
Anonymous
Not applicable

in my application, i am using MQTT protocol and and it works fine for half and hour than it does not work properly.

However i have kept keep alive time for an hour and i am sending ping massage on PINGREQ  topic at regular interval

so can i get any solution for the same?

0 Likes
10 Replies
MichaelF_56
Moderator
Moderator
Moderator
250 sign-ins 25 comments on blog 10 comments on blog

Adding aky and vik86 from the applications team.

0 Likes
badic_1722426
Level 3
Level 3
First like received First like given

Hi ineev_teksun,

I have noticed the same behaviour in the SDK 3.7.0-3, if we have no mqtt message, just PINGREQ during this time (1H30, more longer maybe because we change the heartbeat time to 15s) I've MQTT disconnection.

Do you relsove this problem ?

Best regards,

Baptiste

0 Likes

I see similar thing on SDK-3.5.2

Track back:

     ----------- NetX -----------

     socket.nx_tcp_disconnect_callback =>

     internal_nx_tcp_socket_disconnect_callback =>

     internal_defer_tcp_callback_to_wiced_network_thread =>

     ----------- WICED_NETWORKING_WORKER_THREAD -----------

     internal_wiced_tcp_disconnect_socket_callback =>

     socket->callbacks.disconnect =>

     mqtt_disconnect_callback (in mqtt_network.c, this pushes a MQTT_DISCONNECT_EVENT to MQTT lib)

In my case I don't see the reason for the NetX TCP disconnect event.

baptistepdci​, is this the same thing on your side?

0 Likes

Sorry, maybe it was a bad manipulation in my side (I've re-flash with my last software and there is no problem). xavier@candyhouse​, yes I see the same beahaviour when I used the SDK 3.5.2 but with the SDK 3.7.0 the TCP-IP stack seems to be more reliable, (if you used the nx_user.h from the SDK 3.7.0 normally the stability of the stack of the SDK 3.5.2 is better).

0 Likes

Hi baptistepdci

I'm now working on 4.0, and the "TCP disconnect" problem still bites me.

I'm really interested in your experience that "with the SDK 3.7.0 the TCP-IP stack seems to be more reliable", but I don't quite understand "(if you used the nx_user.h from the SDK 3.7.0 normally the stability of the stack of the SDK 3.5.2 is better)".

Could you kindly share some more information?

Are you seeing "TCP disconnect" problem on your platform recently?

0 Likes

Hi xavier@candyhouse,

Developping a mqtt application which remains connected was very painful with this SDK, because the mqtt library is bugged. I make several modifications is this lib like the modification of the heartbeat interval (set to 1s in default, very too short for internet application) for a variable heartbeat interval set by the server. Moreover the mqtt disconnect and de-init function not working properly (the init function and de-init was completely review to have re-connection without problem).

In my case, my application no need a big stream, so I changed the wifi data rate (wwd_wifi_set_legacy_rate) to prefer stability and long range  against a big rate.

Best regards,

Baptiste

Thank you for sharing.

Appreciated.

0 Likes
Anonymous
Not applicable

Hi baptistepdci,

I am also facing several issues with MQTT Reconnect. From your reply it seems like you have some solution for this. If so can you give me some insight on what changes you did to the MQTT Library to make it more stable. I am not able to do a reconnect with the MQTT in 3.5.2

Thanks in advance

0 Likes

Totally agree with your comment "very painful"...

I gave up MQTT reconnect and mostly rely on reboot.

JeGu_2199941
Level 5
Level 5
25 likes received 10 likes received 10 likes given

baptistepdci​ Thanks for your information. I'll try 3.7.0 once this issue can be fixed.

0 Likes