Add files for MQTT messaging

This commit is contained in:
DSTO\pivatom
2018-11-27 15:14:22 +10:30
parent c7c8e96710
commit 77c1422000
2 changed files with 23 additions and 0 deletions

21
Messaging/clientEx.py Normal file
View File

@@ -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="")

View File

@@ -0,0 +1,2 @@
class Message: