Add files for MQTT messaging
This commit is contained in:
21
Messaging/clientEx.py
Normal file
21
Messaging/clientEx.py
Normal 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="")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
2
Messaging/messagingInterface.py
Normal file
2
Messaging/messagingInterface.py
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
class Message:
|
||||||
|
|
||||||
Reference in New Issue
Block a user