Python3发布MQTT消息(模拟终端)
需使用python编写程序进行测试MQTT的发布功能。也就是模拟终端(mote)、节点,也叫传感器。 MQTT部署在华为云的服务器上面,在本地编写python程序进行测试。 代码: # -*- coding: utf-8 -*- # @Time : 2020/3/14 0014 17:10 # @Author : Liqiju # @File : MQTTpublish.py # @Software : PyCharm import paho.mqtt.client as mqtt #MQTT服务器 host = XXX.XX.XX.XXX #端口 port = 1883 #主题 top
下载地址
用户评论