OldPCGuy
Posts: 72
Joined: Mon Jan 02, 2017 4:53 pm
Location: Detroit Michigan

Mosquito Error:Address already in use

Sat Mar 31, 2018 2:34 pm

When I launch Mosquitto on a PI3 with the intent to run as a Broker I get the following error;

Code: Select all

pi@raspberrypi:~ $ mosquitto -v
1522506340: mosquitto version 1.4.10 (build date Mon, 29 May 2017 13:43:29 +0100) starting
1522506340: Using default config.
1522506340: Opening ipv4 listen socket on port 1883.
1522506340: Error: Address already in use
What is the error "address already in use" Do I need to worry about it?

User avatar
DougieLawson
Posts: 32342
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Mosquito Error:Address already in use

Sat Mar 31, 2018 3:42 pm

You've got two copies running. A stock install sets mosquitto up as a systemd service that will start at boot time.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3B*3, 3B+

Please post ALL technical questions on the forum. Do not send private messages.

OldPCGuy
Posts: 72
Joined: Mon Jan 02, 2017 4:53 pm
Location: Detroit Michigan

Re: Mosquito Error:Address already in use

Sat Mar 31, 2018 7:38 pm

DougieLawson wrote:
Sat Mar 31, 2018 3:42 pm
You've got two copies running. A stock install sets mosquitto up as a systemd service that will start at boot time.
I did not realise that.

Rather than generate a test Sub and Pub is there a command line Ping_Req to check that the Broker is running? I can't find any syntax examples in my searches.

User avatar
DougieLawson
Posts: 32342
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Mosquito Error:Address already in use

Sat Mar 31, 2018 9:42 pm

How about: http://www.steves-internet-guide.com/wp ... tt-ping.7z

Needs p7zip and paho-mqtt to extract that and run it.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3B*3, 3B+

Please post ALL technical questions on the forum. Do not send private messages.

droleary
Posts: 104
Joined: Fri Feb 09, 2018 3:45 am
Location: Minneapolis, MN USA
Contact: Website

Re: Mosquito Error:Address already in use

Sun Apr 01, 2018 2:15 am

OldPCGuy wrote:
Sat Mar 31, 2018 7:38 pm
Rather than generate a test Sub and Pub is there a command line Ping_Req to check that the Broker is running?
Same as any system service:

Code: Select all

pi@raspberrypi:~ $ service mosquitto status
● mosquitto.service - LSB: mosquitto MQTT v3.1 message broker
   Loaded: loaded (/etc/init.d/mosquitto; generated; vendor preset: enabled)
   Active: active (running) since Sun 2018-03-18 01:37:56 UTC; 2 weeks 0 days ag
     Docs: man:systemd-sysv-generator(8)
   CGroup: /system.slice/mosquitto.service
           └─18287 /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf

Mar 18 01:37:56 raspberrypi systemd[1]: Starting LSB: mosquitto MQTT v3.1 messag
Mar 18 01:37:56 raspberrypi mosquitto[18281]: Starting network daemon:: mosquitt
Mar 18 01:37:56 raspberrypi systemd[1]: Started LSB: mosquitto MQTT v3.1 message

Heater
Posts: 8959
Joined: Tue Jul 17, 2012 3:02 pm

Re: Mosquito Error:Address already in use

Sun Apr 01, 2018 7:50 am

Don't you mean:

$ sudo systemctl status mosquitto

?

droleary
Posts: 104
Joined: Fri Feb 09, 2018 3:45 am
Location: Minneapolis, MN USA
Contact: Website

Re: Mosquito Error:Address already in use

Sun Apr 01, 2018 2:10 pm

No I do not. Using systemctl is specific to systemd. While that may be the Debian default now and for the foreseeable future, service is more compatible on a wider variety of Linux installs.

Heater
Posts: 8959
Joined: Tue Jul 17, 2012 3:02 pm

Re: Mosquito Error:Address already in use

Sun Apr 01, 2018 4:17 pm

Good point.

I guess I have been stuck in Debian land for two decades now so I don't think about any other distros.

Return to “General programming discussion”

Who is online

Users browsing this forum: No registered users and 4 guests