LabVIEW-Open-Source / MQTT-Client

A LabVIEW-based client for MQTT
Other
27 stars 4 forks source link

MQTT CLINET offline abnormal. #17

Closed cyroan closed 1 year ago

cyroan commented 1 year ago

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.

francois-normandin commented 1 year ago

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

cyroan commented 1 year ago

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