diff --git a/dayglo_detector/dayglo_detector.py b/dayglo_detector/dayglo_detector.py index 92e7233..f6727a6 100644 --- a/dayglo_detector/dayglo_detector.py +++ b/dayglo_detector/dayglo_detector.py @@ -28,7 +28,7 @@ UPPER_COLOR = np.array([35, 255, 255]) # Track if the initial snapshot has been processed initial_snapshot_processed = False -def on_connect(client, userdata, flags, rc): +def on_connect(client, userdata, flags, reasonCode, properties=None): if rc == 0: print("Connected successfully to MQTT broker") client.subscribe(MQTT_SNAPSHOT_TOPIC, qos=1) @@ -131,7 +131,7 @@ if len(sys.argv) > 1: print(f"File not found: {image_file}") # Set up MQTT client for normal operation -client = mqtt.Client(protocol=mqtt.MQTTv5) +client = mqtt.Client(protocol=mqtt.MQTTv311) client.username_pw_set(MQTT_USERNAME, MQTT_PASSWORD) client.on_connect = on_connect client.on_message = on_message