[Solved] Problem with mosquitto in raspbian

(Ariel Peña) #1

root@LightEASY-Server:~# mosquitto -v
1550205525: mosquitto version 1.4.10 (build date Wed, 06 Feb 2019 17:03:31 +0000) starting
1550205525: Using default config.
1550205525: Opening ipv4 listen socket on port 1883.
1550205525: Error: Address already in use

0 Likes

(Lou Erickson) #2

That error suggest there’s already something running on that port, probably another MQTT server.

try:

sudo netstat -nlpt | grep 1883

That should give you something like this:

tcp        0      0 0.0.0.0:1883            0.0.0.0:*               LISTEN      413/mosquitto       
tcp6       0      0 :::1883                 :::*                    LISTEN      413/mosquitto

The last column on the right will show you the process ID and name of the process.

Some of the distributions will offer to start mosquitto for you, and later OpenHAB has it built in. I don’t know if it’ll show as mosquitto or if it runs a built-in Java version.

Once you know what process it is, maybe you can tell where it came from.

You might also try:

sudo systemctl status mosquitto

That will tell you about a running service, or that it has no service with that name. If it’s listed as a running service, something has already set it up on that host for you.

0 Likes

(Ariel Peña) #3

thanks I go to try this solution and comment my result

0 Likes

(Markus Storm) #4

That’s not right. The MQTT2 binding comes with a broker functionality but it’s not mosquitto.
So if you run openHAB >=2.4 with the mqtt binding it’ll use the same port that mosquitto would use but cannot.
openHABian on the other hand provides a mosquitto bundle.
@Ariel_Pena if you run on Raspi (I guess you do if you run Raspbian) you should consider moving to openHABian.
And please follow this on your next post

0 Likes

(Ariel Peña) #5

thanks yes the problem it is it eject two server with the same port , then if I stop the mosquitto services it work … how can mark it topic like solution to my problem

0 Likes

(Markus Storm) #6

click the “solution” checkmark, it’s hidden behind the 3 dots

0 Likes

(CM6.5 H102) #7

Here’s a Visual guide as well.
image

0 Likes