Change MQTT example to connect to local network virtual machine.

This commit is contained in:
Michael Pivato
2019-01-07 14:23:33 +10:30
parent e600dfea61
commit ce4858bcbe

View File

@@ -22,7 +22,7 @@ def on_disconnect(client, userdata, rc):
if rc != 0:
print("Unexpected disconnection.")
mqttc = mqtt.Client(transport="websockets")
mqttc = mqtt.Client()
# mqttc.tls_set_context(context = ssl.create_default_context())
@@ -30,7 +30,7 @@ mqttc.on_connect = on_connect
mqttc.on_disconnect = on_disconnect
mqttc.on_message = on_message
mqttc.connect('iot.eclipse.org', 1883, 60)
mqttc.connect('172.16.13.128', 1883, 60)
mqttc.loop_start()