MQTT Broker disconnected

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..

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

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

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.

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

Have you tried google?

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

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?

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…

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

sudo apt-get remove mosquitto

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…

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.

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

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…

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

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

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

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.

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?