In order to catch the problem with the connection, I use on_disconnect like this:
local function mqtt_disconnect_callback()
print("MQTT disconnect!")
end
local function mqtt_connect_callback()
print("MQTT connect!")
end
mqtt.wb:on_disconnect(mqtt_disconnect_callback)
mqtt.wb:on_connect(mqtt_connect_callback)
But in this case I get on_disconnect events about every second (together with on_connect). It seems to me that this is not the correct work of the subscription system for the disconnect event
In order to catch the problem with the connection, I use on_disconnect like this:
But in this case I get on_disconnect events about every second (together with on_connect). It seems to me that this is not the correct work of the subscription system for the disconnect event