简体   繁体   English

MQTT-Mosquitto桥不发送消息

[英]MQTT - Mosquitto Bridge not sending messages

I've got a pretty basic two node mosquitto setup. 我有一个非常基本的两节点蚊子设置。 One of the machines is behind a firewall not accepting incoming connections, but I can send information out. 其中一台计算机位于防火墙后面,不接受传入连接,但是我可以将信息发送出去。 I've not implemented SSL or an ACL yet. 我尚未实现SSL或ACL。 Trying to keep this verry simple right now. 现在尝试保持这种简单。 Anyway, the machine behind the firewall is getting messages from some Pi's then sending it to the local broker. 无论如何,防火墙后面的机器正在从某些Pi获取消息,然后将其发送到本地代理。 Another local application is connecting to that machine over websockets. 另一个本地应用程序通过websockets连接到该计算机。 I need to have these messages published to another broker outside the firewall. 我需要将这些消息发布到防火墙之外的另一个代理。

I'm seeing the firewalled broker connecting to the external one, but I am unable to see any messages. 我看到防火墙代理连接到外部代理,但是看不到任何消息。 Further more, I need to have the devices behind the firewall continue to receive messages from the local broker. 此外,我需要让防火墙后面的设备继续接收来自本地代理的消息。

The following is my bridge config 以下是我的网桥配置

connection bridge
address hostname-to-external-mqtt
topic both 0 #
bridge_attempt_unsubscribe false
local_clientid local
remote_clientid remote
start_type automatic
try_private false
cleansession true

The following is the verbose output from my the firewalled machine that needs to duplicate the messages on the remote machine 以下是我的防火墙机器的详细输出,需要在远程机器上复制消息

mosquitto -c ./mosquitto.conf -v
1441942973: mosquitto version 1.4.2 (build date 2015-07-02 21:31:17-0400) starting
1441942973: Config loaded from ./mosquitto.conf.
1441942973: Opening ipv4 listen socket on port 1883.
1441942973: Opening ipv6 listen socket on port 1883.
1441942973: Opening websockets listen socket on port 9001.
1441942973: Bridge local doing local SUBSCRIBE on topic NODE-1/
1441942973: Connecting bridge bridge (remotehost:1883)
1441942973: Bridge remote sending CONNECT
1441942973: Received CONNACK on connection local.
1441942973: Bridge local sending SUBSCRIBE (Mid: 2, Topic: NODE-1/, QoS: 0)
1441942973: Received PUBACK from local (Mid: 1)
1441942973: Received SUBACK from local
1441942974: New connection from 192.168.1.18 on port 1883.
1441942974: New client connected from 192.168.1.18 as paho/AE8E0FF0F7A0180A22 (c1, k60).
1441942974: Sending CONNACK to paho/AE8E0FF0F7A0180A22 (0, 0)
1441942974: New connection from 192.168.1.3 on port 1883.
1441942974: New client connected from 192.168.1.3 as paho/9EE5A8894DD7E6EDC3 (c1, k60).
1441942974: Sending CONNACK to paho/9EE5A8894DD7E6EDC3 (0, 0)

And the following is the the verbose output from the remote machine 以下是远程计算机的详细输出

1441943193: New connection from firewalled-ip on port 1883.
1441943193: New client connected from firewalled-ip as local (c1, k60).
1441943193: Sending CONNACK to local (0, 0)
1441943193: Received PUBLISH from local (d0, q1, r1, m1, '$SYS/broker/connection/local/state', ... (1 bytes))
1441943193: Sending PUBACK to local (Mid: 1)
1441943194: Received SUBSCRIBE from local
1441943194:     NODE-1/ (QoS 0)
1441943194: local 0 NODE-1/
1441943194: Sending SUBACK to local

Can anyone help point me in the right direction please? 有人可以帮我指出正确的方向吗?

It doesn't look like the config you posted and the logs match. 它看起来与您发布的配置和日志不匹配。

Config states: 配置状态:

topic both 0 #

Yet the log shows: 但是日志显示:

1441943194: Received SUBSCRIBE from local
1441943194:     NODE-1/ (QoS 0)

It should be subscribing to # instead of NODE-1/ . 它应该订阅#而不是NODE-1/

Could you check that you are using the config that you think? 您能检查您是否正在使用您认为的配置?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM