MQTT Broker error: 1883 port in use

Greetings Community,

RPI4 running on:
Raspbian GNU/Linux 10 (buster)
NodeRED v1.2.3.

on the publishing PI:

Error: [error] [aedes broker:MQTT Broker] Error: Port 1883 is already in use

I ran the command sudo netstat -nlp|grep 1883

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

I was reading through the forum for possible solutions I attempted to uninstall mosquito thinking I have an external instance running. But it says abort after I select Y when I run:
sudo apt-get remove mosquitto

My only confusion is, I have not altered with MQTT aedes broker node and all of a sudden it stopped working when I was creating a new topic for an MQTT out node, it shows connected. But the broker shows disconnected.

On the subscriber PI:

Flows stopped due to missing node types.
position-config
server

pi@zone4:~ $ sudo netstat -nlp|grep 1883
tcp 0 0 0.0.0.0:1883 0.0.0.0:* LISTEN 506/mosquitto
tcp6 0 0 :::1883 :::* LISTEN 506/mosquitto

How do I disable that TCP thingy(see above) that's using port 1883 all of a sudden?

If I am not clear enough I can reiterate anything for clarity.

All the best

Trivial: I have also tried turning both devices off and on again :sweat_smile:

Looks like you have Mosquitto running on the device.
Try uninstalling it
sudo apt-get remove mosquitto

Why do you want to stop using Mosquitto and use Aedes instead? Mosquitto is generally considered better.

I have tried that , but when I put the command in(see original post midway), it says abort after I hit Y.

Colin : I generally have no preference, I'm attempting to really just fix what had stopped working all of a sudden.

I'm open to any suggestions

If you can't remove mosquitto something odd is going on. Show us the full output when you run the remove, including the command you enter. Also what happens if you run sudo apt update

Thank you collin. I will attempt that as soon as I get home and post the response soon.

Nice, I did the sudo apt update, then the remove command. that worked to restore the provider p!

for the subscriber pi, I had a buttload of unused nodes from early imports I did then deleted. I was able to restore this pi too.

Thank you for the helpful and prompt support!

If you are using mqtt I recommend mosquitto rather than aedes.

to implement that, Do i just remove the aedes node and configure the mosquitto through the terminal?

You don't usually need to do any configuration with mosquitto. Just install it and it goes. Take out aedes and uninstall it first so mosquitto can run as soon as you install it.

1 Like

Ok, I got rid of Aedes and reinstalled Mosquitto and used that instead.

I now learned two ways how to implement an MQTT server, thanks.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.