
How to install an MQTT Broker for Home Assistant on the EG5120
|
|
Time to read 6 min
|
|
Time to read 6 min
This article provides a comprehensive, step-by-step guide on how to install and configure a Mosquitto MQTT broker on the Robustel EG5120 Industrial Edge Computing Gateway for use with Home Assistant.
We'll cover everything from the initial setup and command-line installation to the final integration and verification within the Home Assistant interface.
Following these steps will empower you to build a faster, more reliable, and cloud-independent smart home network.
Picture this: your internet connection drops, but your smart home doesn't even flinch. Your lights, sensors, and automations continue to operate flawlessly. This isn't a fantasy; it's the reality of a locally controlled smart home, and the absolute heart of that system is the MQTT broker. While many Home Assistant users run the broker as a simple add-on, I've found that for ultimate reliability, you need rock-solid hardware. Let's be clear: running your smart home's core messaging system on an industrial-grade device is a game-changer.
In my experience, the real 'aha!' moment for smart home enthusiasts is when they realize their cloud-dependent setup is a single, fragile point of failure. That's why today, we're going to elevate your Home Assistant setup. We will walk through how to install an MQTT broker for Home Assistant on a piece of hardware designed for mission-critical applications: the Robustel EG5120. It's easier than you think, and the payoff in speed and reliability is massive.
So, what's the big deal about using a device like the EG5120 for your Home Assistant broker, anyway? Isn't the add-on running on a Raspberry Pi good enough? For many, it is. But if you're serious about performance and uptime, the benefits are undeniable.
The Robustel EG5120 is an industrial edge computing gateway. That means it's built from the ground up for stability in harsh environments, running 24/7 without fail.
Here’s what that means for your smart home:
Before we dive in, let's gather the necessary tools. You've probably got most of this already.
First, we need to get into the EG5120's command center.
http://192.168.0.1:8123
. Create your initial user account here; we'll need it for the next step.Now, we'll use the command line to install Mosquitto, a very popular and lightweight open-source MQTT broker.
ssh your_username@192.168.0.1
sudo apt update sudo apt install mosquitto mosquitto-clients -y
The -y
flag automatically answers "yes" to the installation prompt. Easy, right?
By default, Mosquitto is locked down. We need to create a simple configuration file to allow devices on your network to connect to it.
sudo vi /etc/mosquitto/conf.d/default.conf
i
key, add the following two lines to the file:listener 1883 0.0.0.0 allow_anonymous true
Esc
key, then enter :wq
, and finally press Enter
to confirm.For our changes to take effect, we need to restart the broker service. Then, we'll tell Home Assistant where to find it.
sudo systemctl restart mosquitto
http://192.168.0.1:8123
).MQTT
, click on the result, and a configuration window will pop up.127.0.0.1
. Leave the port as 1883
and submit. Home Assistant will connect to the broker running on the same machine.Let's do a quick test to make sure everything is communicating correctly. This is the satisfying part where you see it all come together.
test
into the topic box and click START LISTENING.test
.hello
.You should instantly see the message appear under "Listen to a topic." If you see "Message 0 received on test at..." with the payload "hello," congratulations! You have successfully managed to install an MQTT Broker for Home Assistant.
A1: 127.0.0.1
is the "localhost" or "loopback" address. It's a standard IP address that always refers to the local machine itself. Since both Home Assistant and your Mosquitto broker are running on the same EG5120 device, using 127.0.0.1
is the most direct and efficient way for them to communicate, without needing to send traffic out onto your physical network.
A2: For a strictly local home network that is secured by a firewall, this configuration is generally considered acceptable for simplicity. However, if your network is not secure, or if you plan to expose the broker to the internet (which is NOT recommended), you absolutely must set up username and password authentication. You can find detailed instructions on the official Mosquitto documentation. The configuration we used today is for ease of setup in a trusted environment.
A3: Absolutely. That's the power of an edge computing gateway. The EG5120 runs a full Debian 11-based OS and supports Docker containerization . This means you have the flexibility to deploy a wide range of other applications, such as databases (InfluxDB), visualization tools (Grafana), or your own custom Python scripts, right alongside your smart home services. It's a truly versatile platform for any serious IoT project.