MQTT Plugin Constant Connect/Disconnect

I've recently noticed that my OctoPrint log has been flooded with MQTT messages of constant disconnect/connect messages every second, as shown below. I don't know if this started when upgrading to python 3 or OctoPrint 1.4.1+, but was curious if anyone else is also seeing this? Trying to figure out why it's happening.

2020-08-29 07:25:21,094 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:25:22,357 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:25:23,325 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:25:24,431 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:25:25,482 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:25:26,534 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:25:27,562 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:25:28,666 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:25:29,696 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:25:30,805 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:25:31,836 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:25:32,941 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:25:33,968 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:25:35,065 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:25:36,307 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:25:37,437 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:25:38,497 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:25:39,593 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:25:40,652 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:25:41,768 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:25:42,829 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:25:43,892 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:25:44,951 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:25:46,043 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:25:47,097 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:25:48,239 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:25:49,300 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:25:50,432 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:25:51,460 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:25:52,586 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:25:53,616 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:25:54,727 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:25:55,754 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:25:56,896 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:25:57,926 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:25:59,042 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:26:00,073 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:26:01,229 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:26:02,285 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:26:03,433 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:26:04,493 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:26:05,638 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:26:06,698 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:26:07,814 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:26:08,873 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:26:10,009 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:26:11,068 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:26:12,219 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:26:13,279 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:26:14,433 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:26:15,496 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:26:16,645 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:26:17,677 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:26:18,835 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:26:19,866 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:26:20,993 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:26:22,034 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:26:23,190 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:26:24,243 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:26:25,410 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:26:26,486 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:26:27,642 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:26:28,698 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:26:29,854 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:26:30,915 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:26:32,054 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:26:33,111 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:26:34,270 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:26:35,334 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:26:36,487 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:26:37,516 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:26:38,633 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:26:39,667 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:26:40,823 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:26:41,851 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:26:42,968 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:26:43,999 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:26:45,148 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:26:46,204 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:26:47,368 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:26:48,451 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:26:49,591 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:26:50,649 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:26:51,803 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:26:52,859 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:26:54,021 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:26:55,081 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:26:56,227 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:26:57,287 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:26:58,445 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:26:59,511 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:27:00,675 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:27:01,711 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:27:02,872 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:27:03,902 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:27:05,024 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:27:06,051 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:27:07,202 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:27:08,262 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:27:09,436 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:27:10,496 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:27:11,645 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:27:12,701 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:27:13,845 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:27:14,905 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:27:16,053 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:27:17,114 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:27:18,263 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:27:19,333 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:27:20,506 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:27:21,535 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:27:22,689 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:27:23,723 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:27:24,847 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:27:25,876 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:27:27,036 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:27:28,065 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:27:29,241 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:27:30,303 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:27:31,470 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:27:32,524 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:27:33,681 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:27:34,738 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:27:35,891 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:27:36,950 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:27:38,115 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:27:39,177 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:27:40,323 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:27:41,404 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:27:42,561 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:27:43,591 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:27:44,742 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:27:45,768 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:27:46,883 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:27:47,916 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:27:49,082 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:27:50,119 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:27:51,276 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:27:52,333 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:27:53,503 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:27:54,562 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:27:55,723 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:27:56,784 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:27:57,951 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:27:59,017 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:28:00,171 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:28:01,230 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:28:02,366 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:28:03,440 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:28:04,617 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:28:05,643 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:28:06,797 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:28:07,828 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:28:09,010 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:28:10,036 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:28:11,150 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:28:12,183 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:28:13,341 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:28:14,426 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:28:15,568 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker
2020-08-29 07:28:16,626 - octoprint.plugins.mqtt - ERROR - Disconnected from mqtt broker for unknown reasons (network error?), rc = 1
2020-08-29 07:28:17,768 - octoprint.plugins.mqtt - INFO - Connected to mqtt broker

I'm running OctoPrint v1.4.2, against the python2.7-slim-buster docker container, and don't have any octoprint.plugins.mqtt - ERROR disconnects, for what that's worth. Having said that, I am using a now unsupported docker image (pre 1.0 release), so need to bump that to the current one, which uses 3.8-slim-buster, so I'll let you know how that goes! :wink:

Love your plugins btw... I just just reminded of the Tasmota-MQTT one as I just got the auto power off notification.

1 Like

So I broke and then fixed my OctoPrint v1.42 install :slight_smile: It's now running the python 3.8-slim-buster docker base, and no MQTT disconnections there either. Instead I'm getting

octoprint_1  | MJPG Streamer Version.: 2.0
octoprint_1  |  i: Using V4L2 device.: (null)
octoprint_1  |  i: Desired Resolution: 640 x 480
octoprint_1  |  i: Frames Per Second.: -1
octoprint_1  |  i: Format............: YUYV
octoprint_1  |  i: JPEG Quality......: 80
octoprint_1  |  i: TV-Norm...........: DEFAULT
octoprint_1  |  i: init_VideoIn failed

every second, but I'm assuming I've managed to misconfigure something, as this shouldn't be happening as MJPG Streamer is supposed to be disabled if you don't enable webcam support, which I haven't.

Mjpg streamer is not part of OctoPrint, it is a separate service. OctoPrint doesn't stop it from running if you disable webcam support, all it can do is not embed the stream into the interface. You would have to disable the service (on OctoPi, this looks like sudo systemctl disable webcamd)

1 Like

Except I'm using the docker image, which is supposed to be configured by default to have MJPG streamer disabled, and a flag set to enable it... But something doesn't seem to be working - perhaps I need to start with a clean slate - maybe there is a configuration setting leftover or something?

https://github.com/OctoPrint/octoprint-docker/releases/tag/2.0.0