MQTT Broker disconnected

#1

Hello there,

I got a Problem with my Moska MQTT Broker. If i want to use the Broker it says, Broker is unconnected.
the Debug window says the following:

msg : string[73]
“Error starting mosca mqtt server, cause: Error: listen EADDRINUSE :::1883”

I have no idea what s wrong…

0 Likes

#2

EADDRINUSE means something is already listening on port 1883 preventing your mosca instance from running.

0 Likes

#3

okay, so what can I do that this port is free for the Broker?

0 Likes

#4

Most likely you already have an MQTT broker running. Run the command

netstat -nlp|grep 1883

to find what is using it. Perhaps Moska is already running or perhaps you have installed mosquitto or another broker.

0 Likes

#5

okay, you re right, it is still running a mosquitto… with which command can I delet this?

0 Likes

#6

Have you tried google?

0 Likes

#7

yes i do… but don t find, what i exactly need

0 Likes

#8

What OS are you running this on?
How did you install mosquitto?
If you already have mosquitto installed and running, why do you want to also use Mosca?

0 Likes

#9

it is running on a raspberry Pi with Raspbian.

…cause i trie to communicate with Node-red from my Pi and the node red from my Windows PC. And all my tries to fix this with mosquitto are just with out a result, so I tried to fix it with Mosca cause it seems beeing easier with mosca and node red…

0 Likes

#10

…and i find a Topic which handle the communication as i want it, with mosca…

0 Likes

#11

sudo apt-get remove mosquitto

0 Likes

#12

okay, well of corse this would be the easiest way… but for the Moment I use mosquitto as a intern communication for an other program…

0 Likes

#13

You asked how to delete mosquitto, which Colin answered. You didn’t say you needed both mosquitto and mosca to be running at the same time.

If you truly want them both running, then you’ll have to configure one to use a different port - they cannot both use 1883.

But if you’re already using mosquitto, I don’t see why you’d need mosca at all. You haven’t said what issues you had with mosquitto and node-red - maybe that’s the thing to solve here.

0 Likes

#14

If you need booth u will require to define a different port for each mqtt server…

0 Likes

#15

I got mosquitto on a diferent port… the port 1883 is not in use but still exist. so i want just delete the mosquitto for the port 1883…

sorry if this wasn t clear, my english is not that good…

0 Likes

#16

The error you have is because port 1883 was already in use, so take a look deeply and chechk what you have, maybe you have configured incorrectly on node red and you have now some instance with booth configured on same port, try to stop for a moment mosquitto and check if node red start with “sudo service mosquitto stop”.

Regards

0 Likes

#17

Run the command I posted to find what is using the port.

0 Likes

#18

And @Colin means the ‘netstat’ command not the ‘apt-get remove…’ one.

0 Likes

#19

Yes, netstat. But actually I agree with Nick, work out what the problem was with mosquitto and sort that. Most using MQTT on a pi use mosquitto so you are more likely to find support with that than another broker I think.

0 Likes

#20

Does the MQTT node on the Windows box have the RPi’s IP (or hostname.local if you’ve got Bonjour installed) as the broker address?

0 Likes