fixed call back
Signed-off-by: Ebbe Baß <ebbe.bass>
This commit is contained in:
+4
-3
@@ -97,13 +97,14 @@ def get_eth0_ip():
|
|||||||
except (KeyError, IndexError, OSError) as e:
|
except (KeyError, IndexError, OSError) as e:
|
||||||
print(f"Error getting eth0 IP: {e}")
|
print(f"Error getting eth0 IP: {e}")
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def connect_mqtt():
|
def on_connect(client, rc, flags):
|
||||||
def on_connect(client, userdata, flags, rc):
|
|
||||||
if rc == 0:
|
if rc == 0:
|
||||||
print("Connected to MQTT Broker!")
|
print("Connected to MQTT Broker!")
|
||||||
else:
|
else:
|
||||||
print("Failed to connect, return code %d\n", rc)
|
print("Failed to connect, return code %d\n", rc)
|
||||||
|
|
||||||
|
def connect_mqtt():
|
||||||
# Set Connecting Client ID
|
# Set Connecting Client ID
|
||||||
client = mqtt.Client("mqtt_client_id")
|
client = mqtt.Client("mqtt_client_id")
|
||||||
# client.username_pw_set(username, password)
|
# client.username_pw_set(username, password)
|
||||||
|
|||||||
Reference in New Issue
Block a user