Python の mosquitto (mqtt) ライブラリを使用して、mqtt 再接続コマンドを記述する正しい方法は何ですか?
下は疲れたのに、それがうまくいかない...何か見逃したの?
mqttc = mosquitto.Mosquitto()
mqttc.on_message = on_message
mqttc.on_connect = on_connect
mqttc.on_disconnect = on_disconnect
mqttc.on_publish = on_publish
mqttc.on_subscribe = on_subscribe
mqttc.reconnect_delay_set(120, 300, True)
mqttc.connect("test.mosquitto.org", 1883, 60)
mqttc.subscribe("/foo/bar", 0)