From f9880ad8cf845912fc4eabeb8a73403ee1d9d863 Mon Sep 17 00:00:00 2001 From: Graham Date: Sun, 24 Mar 2024 08:21:55 -0400 Subject: [PATCH] Update due to new version of Paho-mqtt --- code/Python/Dockerfile | 4 ++-- code/Python/classic_mqtt.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/Python/Dockerfile b/code/Python/Dockerfile index 2d212b0..58f37e0 100644 --- a/code/Python/Dockerfile +++ b/code/Python/Dockerfile @@ -1,8 +1,8 @@ -FROM python:3.7.6-slim-stretch +FROM python:3.9.19-slim RUN pip install --no-cache-dir pymodbus paho-mqtt ADD classic_mqtt.py / ADD support/*.py support/ -ENTRYPOINT ["python3", "classic_mqtt.py"] \ No newline at end of file +ENTRYPOINT ["python3", "classic_mqtt.py"] diff --git a/code/Python/classic_mqtt.py b/code/Python/classic_mqtt.py index 6e7dbd1..35e2786 100755 --- a/code/Python/classic_mqtt.py +++ b/code/Python/classic_mqtt.py @@ -477,7 +477,7 @@ def run(argv): #setup the MQTT Client for publishing and subscribing clientId = argumentValues['mqttUser'] + "_mqttclient_" + str(randint(100, 999)) log.info("Connecting with clientId=" + clientId) - mqttClient = mqttclient.Client(clientId) + mqttClient = mqttclient.Client(mqttclient.CallbackAPIVersion.VERSION1, clientId) mqttClient.username_pw_set(argumentValues['mqttUser'], password=argumentValues['mqttPassword']) mqttClient.on_connect = on_connect mqttClient.on_disconnect = on_disconnect