pikapython/examples/mqtt/mqtt_connect.py

11 lines
147 B
Python

import mqtt
client = mqtt.MQTT('192.168.1.255')
client.setHost('test.mosquitto.org')
client.setPort(1883)
client.connect()
client.disconnect()