22 lines
538 B
Python
22 lines
538 B
Python
# -*- 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="")
|
|
|
|
|
|
|