OpenMQTTGateway - General Question

I stumbled across this project. I’m wondering under what conditions might I need to consider using it. If I have a broker running on a server (e.g., mosquitto on a Raspberry Pi), why would I use an MQTT gateway? What problems/issues does this address?

Sorry for the totally uninformed question. Just trying to understand if I’m missing a key piece in my home automation architecture.

Thanks.

Mike

No problem :slight_smile:
If I understand well your question is more on why not using the pi to directly handle the gateway functionnalities, here is my point of view.

  • First consideration is range
    With frequencies of 2.4ghz and above you will rapidly see range issues on your home automation and you will think on multiplying your raspberry pi across your home which lead us to the second and third point

  • Reliability
    With micro controllers based systems like arduino or esp8266 you are more on a logic of “fire and forget” compared to a raspberry. Which request maintenance and is more subject to failure (especialy regarding SD cards)

  • Cost, even if we compare to a pi zero we are still lower in cost with a basic nodemcu or esp32

  • Segregation of responsabilities (architecture)
    “each to its own job” why giving to a pi simple tasks like decoding signals and translating codes, an esp or arduino better suits this needs in term of capacity sizing. Moreover the decoupling offered by MQTT enable to easily change your home automation controller (OpenHAB, Home Assistant, Domoticz…) without having to multiply higher level of plugins or binding into these home controllers themselves.

  • Time to setup, the maintenance is lower with an uc and the setup time needed is also lower compared to a raspbian setup + tweakings + software installation…

  • Not maybe the most obvious but power consumption is lower of course with micro controllers.

Don’t hesitate if you have other questions

Florian,

Thank you for your explanation. I think I understand it at a basic level.

The gateway serves as the Wi-Fi connected intermediary between the IoT device and the MQTT broker. Rather than have a device connected directly to the network (typically via Wi-Fi), the IoT device connects to the MQTT gateway via whatever the interface is (RF, IR, BLE, GPIO, etc.). The gateway then interchanges data with the IoT device directly.

The MQTT gateway is connected to the MQTT broker via Wi-Fi. It subscribes to MQTT topics associated with its connected devices and “acts” on those topics to send the information to the associated device (e.g., transmit an RF or IR sequence to the device) or to respond to requests for information about a particular device (e.g., an MQTT request for the current temperature reading from a connected sensor). It also takes data or actions from its connected devices and publishes that information via MQTT.

So, If I have a device which does not have Wi-Fi or I don’t want to continue to load down my Wi-Fi with individual Wi-Fi connected IoT devices, I can deploy a gateway with several connected devices and have it be the “intermediary”. This means that I can place the gateway within good range of a strong Wi-Fi signal yet still reach end-point devices which may be further away or in areas where the Wi-Fi signal may not be “stable”.

Yes? Sort of?

One additional question - your architecture diagram shows the home automation hub interfacing with the gateway. In my experience, the hub is subscribed to MQTT topics. Thus the broker is the orchestrator. Granted, the broker might be embedded in the automation hub. But it might be a standalone broker (e.g., mosquitto). So, in the diagram, there is an implicit MQTT broker; yes?

Thanks.

Mike

Yes or even by ethernet

Yes exactly, it can be either embedded or separated.

Hadn’t considered that. So, the gateway could be a Wi-Fi “extender”? It could provide a Wi-Fi AP to the IoT devices and have it’s own connection to the home network via wired Ethernet.

Lots of possibilities. Such as any device (even if they have Wi-Fi) but does not support MQTT can connect to the gateway as it’s MQTT “translator”.

Does OpenMQTTGateway support putting the gateway in AP mode?

Has anybody used OpenMQTTGateway as a ZigBee/ZWave bridge? I may soon be looking to deploy a Device and I don’t have a “Z-hub”. I am trying to decide what hardware to deploy. I don’t know if there is a Arduino “connectable” “Z-module” or not. Anyway, first question first… I didn’t find anything about ZigBee/Z-Wave here. Is there an OpenMQTTGateway driver? I think that if the answer is yes, then someone will have a hardware recommendation. If no such driver exists, then I may be out of luck.

Thanks.

Mike