简体   繁体   English

带有mosquitto mqtt的Arduino

[英]Arduino with mosquitto mqtt

When I ran the Mosquitto (MQTT) broker for the first time there was no issue. 当我第一次经营Mosquitto(MQTT)经纪人时,没有任何问题。 However when running it for the second time using the default config I could not run the code successfully because of the following error on Windows 8: 但是,使用默认配置第二次运行它时,由于Windows 8上出现以下错误,我无法成功运行代码:

1379497253: mosquitto version 1.2 (build date 2013-09-17 17:59:39+0530) starting 1379497253: Using default config. 1379497253: Opening ipv6 listen socket on port 1883. 1379497253: Error: Address already in use

How can I resolve this error, or more importantly what does this error mean? 如何解决此错误,或更重要的是,此错误是什么意思?

Address already in use usually means that the port (in your case 1883 ) is already being used by another process. Address already in use通常意味着该端口(在您的情况下为1883 )已被另一个进程使用。 The most likely situation given your description is that another copy of mosquitto is already running. 根据您的描述,最可能的情况是另一份mosquitto已在运行。 If you want to run two (or more) you'll need to configure each to use a separate port number. 如果要运行两个(或多个),则需要将每个配置为使用单独的端口号。

You have to check the mosquitto.conf in a bin folder in which you installed the mosquitto server. 你必须检查mosquitto.conf在其中安装mosquitto服务器bin文件夹。

Make sure all lines are commented with '#' especially the following line, port 1883 or listener 1883. 确保所有行都用“#”注释,尤其是以下行,端口1883或侦听器1883。

then, find some available port or whether the port 1883 is used by using command like netstat. 然后,使用诸如netstat之类的命令查找一些可用端口或是否使用了端口1883。

In windows, you can use this, 在Windows中,您可以使用此功能,

netstat -an| netstat -an | findStr 1883 findStr 1883

You have to change your default port on mosquitto when found any message from the prompt. 在提示符下找到任何消息时,您必须更改mosquitto的默认端口。

Append some specific number on the line below which is indicating the port whatever you prefer to. 在下面的行上添加一些特定的数字,该数字表示您希望使用的端口。

listener XXX
protocol mqtt

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

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