MQTT/mosquitto OFFLINE

openhabian 2.5.6-2 on a RPi 3B+
I’m not sure what happened, but no MQTT and now I get the following error every 60 secs:

2020-07-27 12:13:06.320 [hingStatusInfoChangedEvent] - ‘mqtt:broker:b34f45a4’ changed from OFFLINE (COMMUNICATION_ERROR): io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: /10.0.20.5:1883 to OFFLINE

2020-07-27 12:13:06.344 [hingStatusInfoChangedEvent] - ‘mqtt:broker:b34f45a4’ changed from OFFLINE to OFFLINE (COMMUNICATION_ERROR): io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: /10.0.20.5:1883

I’ve poked around searching the Community with about similar issues, so far no positive results

Are Mosquitto and openHAB on the same device? Both on 10.0.20.5?

Has your Pi updated itself?

Have you tried restarting openHAB, and restarting Mosquitto?

What do you get with the following command?

sudo systemctl status mosquitto

EDIT: Another option - is the Pi OK? It hasn’t run out of memory for some reason?

Yes, both on the same Pi at 10.0.20.5
Not sure if it has updated itself. How?
Yes, restarted openhab; not sure how to restart mosquitto
One of the first things I checked; I get:

Jul 27 10:28:35 openhab systemd[1]: mosquitto.service: Service RestartSec=100ms expired, schedulin
Jul 27 10:28:35 openhab systemd[1]: mosquitto.service: Scheduled restart job, restart counter is a
Jul 27 10:28:35 openhab systemd[1]: Stopped Mosquitto MQTT v3.1/v3.1.1 Broker.
Jul 27 10:28:35 openhab systemd[1]: mosquitto.service: Start request repeated too quickly.
Jul 27 10:28:35 openhab systemd[1]: mosquitto.service: Failed with result 'exit-code'.
Jul 27 10:28:35 openhab systemd[1]: Failed to start Mosquitto MQTT v3.1/v3.1.1 Broker.

Thanks!

Last Q: shouldn’t have, it’s a recent attempt with a recent build: 2.5.6

So the problem is clear: Mosquitto isn’t running. Is that really the full output of

sudo systemctl status mosquitto

?

Mine looks like this - can you paste the full output?:

● mosquitto.service - LSB: mosquitto MQTT v3.1 message broker
   Loaded: loaded (/etc/init.d/mosquitto; generated; vendor preset: enabled)
   Active: active (running) since Wed 2020-07-15 22:28:39 BST; 1 weeks 3 days ago
     Docs: man:systemd-sysv-generator(8)
  Process: 370 ExecStart=/etc/init.d/mosquitto start (code=exited, status=0/SUCCESS)
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/mosquitto.service
           └─457 /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf

Jul 15 22:28:38 raspberrypi systemd[1]: Starting LSB: mosquitto MQTT v3.1 message broker...
Jul 15 22:28:39 raspberrypi mosquitto[370]: Starting network daemon:: mosquitto.
Jul 15 22:28:39 raspberrypi systemd[1]: Started LSB: mosquitto MQTT v3.1 message broker.

To restart Mosquitto:

sudo systemctl restart mosquitto

So it never worked, or just magically stopped working? Can you check your resources, though: lookup the htop command.

use journalctl -xu mosquitto to get the full output

Was working, not sure what happened for it to fail. Always proper shutdown.
sudo systemctl status mosquitto:

● mosquitto.service - Mosquitto MQTT v3.1/v3.1.1 Broker
   Loaded: loaded (/lib/systemd/system/mosquitto.service; enabled; vendor preset
   Active: failed (Result: exit-code) since Mon 2020-07-27 10:28:35 MST; 2 days
     Docs: man:mosquitto.conf(5)
           man:mosquitto(8)
  Process: 935 ExecStart=/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf (c
 Main PID: 935 (code=exited, status=1/FAILURE)

Jul 27 10:28:35 openhab systemd[1]: mosquitto.service: Service RestartSec=100ms
Jul 27 10:28:35 openhab systemd[1]: mosquitto.service: Scheduled restart job, re
Jul 27 10:28:35 openhab systemd[1]: Stopped Mosquitto MQTT v3.1/v3.1.1 Broker.
Jul 27 10:28:35 openhab systemd[1]: mosquitto.service: Start request repeated to
Jul 27 10:28:35 openhab systemd[1]: mosquitto.service: Failed with result 'exit-
Jul 27 10:28:35 openhab systemd[1]: Failed to start Mosquitto MQTT v3.1/v3.1.1 B

[15:18:37] openhabian@openhab:~$ sudo systemctl restart mosquitto
Job for mosquitto.service failed because the control process exited with error code.
See "systemctl status mosquitto.service" and "journalctl -xe" for details.

journalctl -xu mosquitto:

-- Logs begin at Thu 2019-02-14 03:11:59 MST, end at Wed 2020-07-29 15:25:02 MST. --
Jul 06 13:08:26 openhab systemd[1]: Starting Mosquitto MQTT v3.1/v3.1.1 Broker...
-- Subject: A start job for unit mosquitto.service has begun execution
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit mosquitto.service has begun execution.
--
-- The job identifier is 1044.
Jul 06 13:08:26 openhab systemd[1]: Started Mosquitto MQTT v3.1/v3.1.1 Broker.
-- Subject: A start job for unit mosquitto.service has finished successfully
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit mosquitto.service has finished successfully.
--
-- The job identifier is 1044.
Jul 06 13:08:39 openhab systemd[1]: Stopping Mosquitto MQTT v3.1/v3.1.1 Broker...
-- Subject: A stop job for unit mosquitto.service has begun execution
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A stop job for unit mosquitto.service has begun execution.
lines 1-23...skipping...
-- Logs begin at Thu 2019-02-14 03:11:59 MST, end at Wed 2020-07-29 15:25:02 MST. --
Jul 06 13:08:26 openhab systemd[1]: Starting Mosquitto MQTT v3.1/v3.1.1 Broker...
-- Subject: A start job for unit mosquitto.service has begun execution
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit mosquitto.service has begun execution.
--
-- The job identifier is 1044.
Jul 06 13:08:26 openhab systemd[1]: Started Mosquitto MQTT v3.1/v3.1.1 Broker.
-- Subject: A start job for unit mosquitto.service has finished successfully
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit mosquitto.service has finished successfully.
--
-- The job identifier is 1044.
Jul 06 13:08:39 openhab systemd[1]: Stopping Mosquitto MQTT v3.1/v3.1.1 Broker...
-- Subject: A stop job for unit mosquitto.service has begun execution
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A stop job for unit mosquitto.service has begun execution.
--
-- The job identifier is 1109.
Jul 06 13:08:39 openhab systemd[1]: mosquitto.service: Succeeded.
-- Subject: Unit succeeded
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- The unit mosquitto.service has successfully entered the 'dead' state.
Jul 06 13:08:39 openhab systemd[1]: Stopped Mosquitto MQTT v3.1/v3.1.1 Broker.
-- Subject: A stop job for unit mosquitto.service has finished
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A stop job for unit mosquitto.service has finished.
--
-- The job identifier is 1109 and the job result is done.

Try UNINSTALL MQTT binding, reinstall mosquitto from openhab-config, reinstall MQTT binding?

Yes. Uninstall/install worked for me. Just write in the console:
" sudo apt-get purge --remove mosquitto* "

If in the folder /etc/mosquitto will remain some files (passwd and still something).
Delete them by:

" rm /etc/mosquitto/* "

Go to config:

" sudo openhabian-config "

and reinstall mosquitto

  • 20 Optional components
    -23 Mosquitto

Try to reboot raspberry:

" sudo reboot "

Check again the status of mosquito:

" sudo systemctl status mosquito"

If it is active you are winner:-)

1 Like