MQTT and Mosquitto disconnecting intermittantly

I have looked through the forum and although this has been touched on I haven't seen either a resolution or a proposed fix. Both of my "production" node red's run Mosquitto and Mqtt and they both disconnect once a day at roughly the same time each day. One at about 1am and the other about 1pm - or so. While it is not a fatal problem it is quite disconcerting. I am running the latest versions of Node red, mosquitto , and using node mcu's. Is this an issue within node red or mosquitto-node red interface? I'm not really up to a long trouble shooting routine about the problem as everything reconnects fairly quickly but it is annoying. Been living with it for a long time now and if it's only me then I will quietly return to my cave.

What does the mosquito log show at that time?

What does the node red log show at that time?

sorry @Colin for the delay
2023_04.txt (4.2 KB)
mosquitto.log (78.5 KB)

looked through them and didn't see anything stand out, I wonder if it might be a WiFi thing?

I don't see the node-red log there. I want to see the log that starts with the Welcome to node-red message.

Also, from the mosquitto log I can see that that all the devices are continually reconnecting every few seconds. The timestamps in the mosquitto log are in seconds. You need to understand why that is going on. You said that both your devices are showing problems, but the mosquitto log is showing four devices.

If you create a file /etc/mosquitto/conf.d/mossy.conf containing

# human readable timestamps in log
log_timestamp true
log_timestamp_format %Y-%m-%d %H:%M:%S

then mosquitto will provide readable timestamps.

So, here's the short answer. Started comparing the log files in both systems and noticed that there were big differences in what the log files looked like. Went to the system I sent to @Colin logs and removed mosquitto from the device and completely reinstalled. The log files now print out the times and I'm not getting the disconnects I was before. Granted the system has only been running a short time but it does seem a lot more stable and in the day or so it's been changed over there are no disconnects at all in the log. I'm going to call this one fixed, thanks for the pointers.

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