[英]What port do I use to send MQTT messages to FairCom MQ from Python?
I'm trying to send MQTT messages to FairCom MQ using Paho.我正在尝试使用 Paho 将 MQTT 消息发送到 FairCom MQ。 What port would I use?
我会使用什么端口?
In my paho.mqtt.publish() call I understand to set hostname to "localhost" or the IP of the machine FairCom MQ is running on but what do I set port to?在我的 paho.mqtt.publish() 调用中,我知道将主机名设置为“localhost”或运行 FairCom MQ 的机器的 IP,但是我应该将端口设置为什么?
1883 is the default port for MQTT in general.一般情况下,1883 是 MQTT 的默认端口。 FairCom MQ defaults to this port, so if you have not changed the MQTT port by editing cthttpd.json in the config folder use 1883. IE
FairCom MQ 默认使用此端口,因此如果您没有通过在配置文件夹中编辑 cthttpd.json 来更改 MQTT 端口,请使用 1883。IE
paho.mqtt.publish(topic, payload="My payload", qos=0, hostname="localhost", port=1883) paho.mqtt.publish(topic, payload="My payload", qos=0, hostname="localhost", port=1883)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.