mosquitto和python的使用

2023-01-31 05:01:38 python mosquitto

Http://publib.boulder.ibm.com/infocenter/wMQv7/v7r0/index.jsp?topic=/com.ibm.mq.amQtat.doc/tt00000_.htm

 

启动

 

mosquitto -c /etc/mosquitto/mosquitto.conf

 

订阅

 

vim /usr/local/src/mosquitto-1.1.3/lib/python/sub.py

修改 地址(127.0.0.1) 和 订阅名(test)

 

然后执行

Python sub.py

 

最后发布

 

python

 

import mosquitto

c = mosquitto.Mosquitto()

c.connect("127.0.0.1",1883)

c.publish("test","test")

 

相关文章