diff --git a/main.py b/main.py index 1a78f96..89f281c 100644 --- a/main.py +++ b/main.py @@ -46,6 +46,7 @@ if MQTT_TLS: mq.tls_set() mq.enable_logger(LOGGER) +LOGGER.info("Connecting to MQTT broker...") mq.connect(MQTT_BROKER_HOST, MQTT_BROKER_PORT) @@ -176,8 +177,5 @@ def rotate_points_azimuth(input_stream): pipe_heading = source_heading.latest() pipe_rotate = source.zip(pipe_heading).map(rotate_points_azimuth).map(to_brefv_raw).sink(to_mqtt) - LOGGER.info("Connecting to MQTT broker...") - mq.connect(MQTT_BROKER_HOST, MQTT_BROKER_PORT) - LOGGER.info("Setting up MQTT listener...") subscribe_to_mqtt()