From a04e6f77532009a87d95fd5abc8992c6ca2a7f01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Tue, 13 Feb 2024 00:11:47 +0100 Subject: [PATCH] changed connect MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- server/app.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/app.py b/server/app.py index 6ade0e5..cd093e4 100644 --- a/server/app.py +++ b/server/app.py @@ -98,15 +98,15 @@ def get_eth0_ip(): print(f"Error getting eth0 IP: {e}") return None - def connect_mqtt(): def on_connect(client, userdata, flags, rc): if rc == 0: print("Connected to MQTT Broker!") else: - print("Failed to connect to MQTT broker, return code %d\n", rc) - + print("Failed to connect, return code %d\n", rc) + # Set Connecting Client ID client = mqtt.Client(mqtt_client_id) + # client.username_pw_set(username, password) client.on_connect = on_connect client.connect("localhost", 1883) return client