From 5fa12e05a8547073bc7346c87ef403a5b03217f9 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Fri, 6 Sep 2024 20:05:04 -0600 Subject: [PATCH] Switch train MQTT broker to local --- main.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/main.py b/main.py index 6851735..66da191 100755 --- a/main.py +++ b/main.py @@ -155,11 +155,9 @@ def mqtt_publish(topic, message): publish.single( topic, str(message), - hostname='webhost.protospace.ca', - port=8883, + hostname='172.17.17.181', + port=1883, client_id='protovac', - auth=dict(username='writer', password=secrets.MQTT_WRITER_PASSWORD), - tls=dict(ca_certs='/etc/ssl/certs/ISRG_Root_X1.pem'), keepalive=5, # timeout ) except BaseException as e: @@ -1483,13 +1481,13 @@ I will be terse in my responses. res = '' if button == 'r': - res = mqtt_publish('train/control', -140) + res = mqtt_publish('train/control/speed', -140) logging.info('Setting train speed to: -140') elif button == 't': - res = mqtt_publish('train/control', 0) + res = mqtt_publish('train/control/speed', 0) logging.info('Setting train speed to: 0') elif button == 'y': - res = mqtt_publish('train/control', 160) + res = mqtt_publish('train/control/speed', 160) logging.info('Setting train speed to: 160') elif button == 'b' or c == KEY_ESCAPE: