What is the most reliable way to use the Python Paho MQTT client? I want to be able to handle connection interruptions due to WiFi drops and keep trying to reconnect until it\'s
These options will help ensure that any messages published while disconnected will be delivered once the connection is restored.
You can set the client_id and clean_session flag in the constructor
client = mqtt.Client(client_id="foo123", clean_session=False)
And set the QOS of the subscription after the topic
client.subscribe(topic, qos=1)