pikapython/test/python/mqtt/mqtt_init.py
2022-11-18 21:20:52 +08:00

15 lines
213 B
Python

import mqtt
client = mqtt.MQTT()
client.set_host('broker.emqx.io')
client.set_port(1883)
ret = client.connect()
print('client.connect:%d' % ret)
ret = client.disconnect()
print('client.disconnect:%d' % ret)