From 77c1422000e371c7c891bf0444d0185012d3017c Mon Sep 17 00:00:00 2001 From: "DSTO\\pivatom" Date: Tue, 27 Nov 2018 15:14:22 +1030 Subject: [PATCH] Add files for MQTT messaging --- Messaging/clientEx.py | 21 +++++++++++++++++++++ Messaging/messagingInterface.py | 2 ++ 2 files changed, 23 insertions(+) create mode 100644 Messaging/clientEx.py create mode 100644 Messaging/messagingInterface.py diff --git a/Messaging/clientEx.py b/Messaging/clientEx.py new file mode 100644 index 0000000..aa5ed3e --- /dev/null +++ b/Messaging/clientEx.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +""" +Created on Tue Nov 27 14:17:45 2018 + +@author: pivatom +""" + +import paho.mqtt.client as mqtt + +# These are just the defaults. +mqttc = mqtt.Client(client_id="", clean_session=True, userdata=None, protocol=MQTTv311, transport="tcp") + +mqttc.tls_set(ca_certs=None, certfile=None, keyfile=None, cert_reqs=ssl.CERT_REQUIRED, + tls_version=ssl.PROTOCOL_TLS, ciphers=None) + +# Use port 8883 for SSL +# Host is just an ip address or hostname of the broker. +mqttc.connect(host, port=1883, keepalive=60, bind_address="") + + + diff --git a/Messaging/messagingInterface.py b/Messaging/messagingInterface.py new file mode 100644 index 0000000..556333f --- /dev/null +++ b/Messaging/messagingInterface.py @@ -0,0 +1,2 @@ +class Message: + \ No newline at end of file