LabVIEW-Open-Source/MQTT-Client

MQTT CLINET offline abnormal.

cyroan opened this issue · 2 comments

We use MQTT clinet sample for testing mqtt broker(test.mosquitto.org). It disconnet abnormal after connect for about 1minutes. This condition did not happened in our python test program. Is there any parameter we should modify to test.

@cyroan you can look into the keep-alive parameter that is part of the Connect parameters. If I'm not mistaken, it is set to 60s by default.

You can either increase this parameter or send ping packets every <60s to keep the connection alive.

Mosquitto changed their default behavior about two years ago where they pushed an update that used to interpret 0 as "never disconnect" to "disconnect immediately". As a consequence, LV MQTT client default value was changed from 0 to 60.

We added ping to solve this problem according to your suggestion. It works well.
Thanks a lot.