mqtt loop so it doesnt disconect

This commit is contained in:
2024-10-23 12:24:58 +00:00
parent d768be0b18
commit e523018fec

View File

@@ -7,8 +7,8 @@ mqtt_client = mqtt.Client()
# Verbinding maken met de Raspberry Pi (broker) # Verbinding maken met de Raspberry Pi (broker)
mqtt_client.username_pw_set("ishak", "kobuki") mqtt_client.username_pw_set("ishak", "kobuki")
mqtt_client.connect("ishakpi.ddns.net", 1883, 60) mqtt_client.connect("localhost", 1883, 60)
mqtt_client.loop_forever() mqtt_client.loop_start()
@app.route('/') @app.route('/')
def index(): def index():
return render_template('index.html') return render_template('index.html')