pikapython/test/python/mqtt/mqtt_init.py

15 lines
213 B
Python
Raw Normal View History

2022-11-13 15:16:08 +08:00
import mqtt
2022-11-18 21:20:52 +08:00
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)