- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
With 3.5.2. When connecting to a MQTT broker over wifi, if the network is disconnected the connection to the MQTT broker is not resumed when the network comes back up. I tried different things (bring everything down and back up, reuse the MQTT connection, etc) but I'm not sure the MQTT library handles the broken connection correctly.
Is there a newer version of the SDK I can try or an example on how to do this?
Thank you
- Tags:
- mqtt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Make sure you deinit the mqtt and connect again. Its a good find , we can have this logic incorporated in our sample apps. Thnx for pointing it .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm pretty sure I tried that but there was an issue when trying to bring the connection back up. I'll try again. Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
same problem here. There is a no graceful way of deinit of MQTT and starting over again. Moreover, once you move the whole MQTT into an application thread, things get murkier, since now you have to join and delete the thread and then start the thread again.
All the snippets on MQTT assume that the end-application will have MQTT running in the main application ... which is not practical.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
vik86 wrote:
Make sure you deinit the mqtt and connect again. Its a good find , we can have this logic incorporated in our sample apps. Thnx for pointing it .
Hi vik86,
The follow up comments in this thread shows "deinit the mqtt and connect again" does not work.
Does it really work for you? Or any further comments?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No it does not work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you please provide example to "deinit and connect again" on MQTT disconnect. Without this, i can hardly imagine going into production.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I think there was a major memory leak in the tls library, I did help for us.
U can try this link. every mqtt connection consume about 8k ram
in mqtt_network_deinit() /mqtt_network.c file/ -> missing wiced_tls_deinit_indentity()...
below fix:
wiced_result_t mqtt_network_deinit( mqtt_socket_t *socket )
{
wiced_tcp_unregister_callbacks( &socket->socket );
mqtt_network_disconnect( socket );
if ( socket->socket.tls_context != NULL )
{
wiced_tls_reset_context( socket->socket.tls_context );
wiced_tls_deinit_identity( &socket->tls_identity ); // add this call
}
if ( socket->socket.tls_context != NULL )
{
wiced_tls_deinit_root_ca_certificates( );
}
wiced_tcp_delete_socket( &socket->socket );
return WICED_SUCCESS;
}
Regards,
Nishal