2017-03-17 141 views
0

我想将本地(Windows)MQTT mosquitto中介桥接到test.mosquitto.org。不幸的是,它引发了一个未知错误。Mosquitto MQTT桥错误

我使用的是在这个问题上使用 Verify that local mosquitto MQTT Broker is bridged to test.mosquitto.org

配置文件相同的配置:

connection test 
address test.mosquitto.org 
topic oust_topicst_topic out 0 
try_private false 
notifications false 
bridge_attempt_unsubscribe true 

输出:

1489747961: mosquitto version 1.4.11 (build date 20/02/2017 23:24:29.40) starting 
1489747961: Config loaded from Configurations/bridge.conf. 
1489747961: Opening ipv6 listen socket on port 1883. 
1489747961: Opening ipv4 listen socket on port 1883. 
1489747961: Bridge local.NicolasJourdan.test doing local SUBSCRIBE on topic oust_topicst_topic 
1489747961: Connecting bridge test (test.mosquitto.org:1883) 
1489747961: Bridge NicolasJourdan.test sending CONNECT 
1489747961: Error creating bridge: Unknown error. 
1489747961: Warning: Unable to connect to bridge test. 
1489747969: mosquitto version 1.4.11 terminating 

什么可能产生这个错误?我没有运行另一个mosquitto实例,并且test.mosquitto.org已启动

+0

如果将-v添加到命令行以启用详细日志记录,会得到什么结果? – hardillb

+0

这已经是详细记录的输出。如果我不添加-v,则不会输出。有没有扩展消息或类似的另一个日志文件? – nicoj

+0

好的,这个配置在我的Linux机器上工作正常。你有没有试过关掉你的防火墙?你也可以ping同一台机器的test.mosquitto.org? – hardillb

回答

0

第一个问题是您是运行本地代理还是仅作为客户端进行连接。

如果您正在运行代理,请尝试首先使用-c“配置文件路径”运行mosquitto,以查看您的配置文件是否有错误。在终端中运行(在Linux为例):

mosquitto -c /etc/mosquitto/mosquitto.conf

如果控制台会告诉它,你把它从那里错误。

接下来,尝试格式化你的主题这样的(它被称为话题重新映射): 话题测试出0本地/本地/

现在你可以从你的代码或终端发布到本地/测试,以及消息将发布到远程代理上的本地/测试,它将通过订阅相同主题来接收消息。