简体   繁体   中英

Arduino with mosquitto mqtt

When I ran the Mosquitto (MQTT) broker for the first time there was no issue. 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:

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. The most likely situation given your description is that another copy of mosquitto is already running. 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.

Make sure all lines are commented with '#' especially the following line, port 1883 or listener 1883.

then, find some available port or whether the port 1883 is used by using command like netstat.

In windows, you can use this,

netstat -an| findStr 1883

You have to change your default port on mosquitto when found any message from the prompt.

Append some specific number on the line below which is indicating the port whatever you prefer to.

listener XXX
protocol mqtt

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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