MQTT hardware

I’m new to openhabian and IOT and started with the following equipment:
RPi with OH, arduino serial gateway and some Mysensors nodes.
Everyting has worked fine but since I olso want to connect to the system from outside of my home I been thinking about using MQTT. I have tried to find out what equipment is needed and how to connect it together.
I have made a picture of what I think it should look like, see picture. I wondering now if I have understand it right?

The MQTT broker is pretty light weight. You can probably host it on your Controller too rather than buying a separate RPi to run it. This assumes you are using a RPi 2 or later

1 Like

Yeah, I do that on an RPi 3 and it works well.

If I reboot openhab will the mqtt broker start automatically?

Your question doesn’t make much sense to me.

The two are separate programs. Both are configured as services when installed through the default apt-get method. So if you reboot the machine they are hosted on then yes, both openHAB and the broker will automatically restart.

If you are talking about restarting the openHAB service, there is no need for the broker to restart automatically. openHAB is a client to the MQTT broker and does not require the broker to restart when it starts or to restart the broker in order for openHAB to connect.

In short, they are completely independent of each other. If you restart openHAB it will connect to the broker when it comes back online. If you restart the broker, openHAB will keep trying to reconnect to the broker until the broker comes back online.