Mqtt 两位莫斯基托经纪人之间的桥梁

Mqtt 两位莫斯基托经纪人之间的桥梁,mqtt,mosquitto,Mqtt,Mosquitto,我想在运行在Raspberry Pi上的mosquitto代理和PC上的mosquitto代理之间建立一座桥梁 在mosquitto.conf文件(在Raspberry Pi上)中,我将桥接设置设置为: connection raspi-PC address 192.168.0.104:1883 -> Pc address topic # both 0 local/sensor remote/sensor 连接似乎很好,但当我尝试发布本地主题时,我无法在订阅的远程/主题客户端中看到消息

我想在运行在Raspberry Pi上的mosquitto代理和PC上的mosquitto代理之间建立一座桥梁

在mosquitto.conf文件(在Raspberry Pi上)中,我将桥接设置设置为:

connection raspi-PC
address 192.168.0.104:1883 -> Pc address
topic # both 0 local/sensor remote/sensor
连接似乎很好,但当我尝试发布本地主题时,我无法在订阅的远程/主题客户端中看到消息

例如:

client1 : mosquitto_pub -t local/sensor/room -m "23C"
client2 : mosquitto_sub -h 192.168.0.104 -t remote/sensor/# ->> here is not published msg

我做错了什么?

您缺少主题“重新映射字符串”的最后一个
/
,如手册页中所述。你应使用:

topic # both 0 local/sensor/ remote/sensor/

看起来好像是先发布后订阅-是这样吗?如果是这样的话,换一种方式试试。您是否启用了登录mosquito.conf log\u dest dest dest destinations