Mosquitto Broker Configuration and Connectivity Issues

Hello everyone, I’m currently working on setting up a Mosquitto broker on my Raspberry Pi 3B+ for my Home Assistant installation. While I’ve managed to get the broker running, I’m facing some connectivity issues that I can’t seem to resolve. Let me walk you through my setup and the problems I’m encountering.

I’ve installed the latest versions of Home Assistant, Mosquitto, and Node-RED. Everything seems to be running smoothly on the surface, but when I try to connect external devices like my ESP8266 modules or Tasmota-enabled Sonoff devices, I don’t see any activity in the broker. I’ve double-checked the MQTT settings in Home Assistant and ensured that the correct username and password are being used. Connections are being established, but there’s no data flow either in or out of the broker.

One of the things I’ve noticed is a warning in the Mosquitto logs: ‘Warning: Mosquitto should not be run as root/administrator.’ I’ve tried adjusting the configuration to run Mosquitto under a non-root user, but this hasn’t resolved the issue. I’ve also reviewed the configuration file multiple times, ensuring that all settings are correctly applied. Despite these efforts, the broker remains unresponsive to incoming messages.

I’ve also explored the possibility of network configuration issues. After switching from a wireless connection to a wired Ethernet setup, I encountered a separate problem where the Raspberry Pi’s network settings weren’t correctly configured for the new connection type. This led me to reinstall the operating system and start fresh, but the Mosquitto connectivity issues persist.

To troubleshoot further, I’ve subscribed to various $SYS topics in Mosquitto, but I’m not seeing any activity. Node-RED flows designed to monitor and log MQTT traffic aren’t producing any output either. I’ve tried connecting to the broker using external MQTT clients on both Linux and Windows machines, but these connections don’t result in any data being transmitted or received within the broker.

I’m beginning to suspect that there might be a misconfiguration in the Mosquitto setup or perhaps an issue with the way Home Assistant is integrating with the broker. I’ve reviewed the documentation and followed several troubleshooting guides from this community, but none of the suggested solutions have worked for me. At this point, I’m feeling a bit stuck and would greatly appreciate any insights or suggestions that the community might have to help resolve this issue.