zediot white nolink

What is OpenMQTTGateway: Bridging Multi-Protocol Devices to MQTT

OpenMQTTGateway is an open-source project that bridges multiple wireless protocols like BLE, RF, IR, and LoRa to MQTT. Learn its architecture, features, and IoT use cases.

The Challenge of Multi-Protocol IoT

In today’s IoT and smart home landscape, devices speak a wide variety of languages—Bluetooth Low Energy (BLE), 433 MHz RF, Infrared (IR), Zigbee, LoRa, serial communication, and more. Integrating these devices into a central automation platform like Home Assistant or Node-RED often requires multiple proprietary hubs and bridges, resulting in fragmentation, cost, and complexity.

OpenMQTTGateway (OMG) was created to solve this problem. It is an open-source firmware that runs on affordable hardware (ESP8266, ESP32, STM32, etc.) and acts as a universal translator: it decodes signals from various protocols and publishes them to MQTT topics. Conversely, it can also receive MQTT commands and send them back as IR codes, RF signals, or BLE commands to control devices.

This simple yet powerful approach has made OMG one of the most widely adopted community-driven solutions for multi-protocol IoT bridging.


What is OpenMQTTGateway?

OpenMQTTGateway (often abbreviated as OMG) is a firmware project built with Arduino and PlatformIO, designed to bridge wireless and wired signals into MQTT, enabling seamless integration with almost any MQTT-compatible IoT platform.

  • Open-source: Community-driven, transparent, and extensible.
  • Lightweight: Runs on low-cost boards like ESP32 or ESP8266.
  • Flexible: Supports a wide range of protocols and modules.
  • Interoperable: Works with Home Assistant, Domoticz, OpenHAB, Node-RED, or any MQTT broker.

With OMG, a single ESP32-based gateway can:

  • Receive data from BLE temperature sensors.
  • Decode RF 433 MHz door sensor signals.
  • Act as a universal IR remote for TVs or air conditioners.
  • Publish all of this into MQTT topics that your smart home platform can act on.

Architecture Overview

OMG’s design can be broken down into layers of functionality:

--- title: "OpenMQTTGateway Architecture" --- graph TD %% ===== Styles ===== classDef hardware fill:#bbdefb,stroke:#0d47a1,stroke-width:2px,color:#000,rx:12,ry:12; classDef protocol fill:#d1c4e9,stroke:#4a148c,stroke-width:2px,color:#000,rx:12,ry:12; classDef codec fill:#fff59d,stroke:#f57f17,stroke-width:2px,color:#000,rx:12,ry:12; classDef mqtt fill:#c8e6c9,stroke:#1b5e20,stroke-width:2px,color:#000,rx:12,ry:12; classDef platform fill:#ffe0b2,stroke:#e65100,stroke-width:2px,color:#000,rx:12,ry:12; classDef manage fill:#f3e5f5,stroke:#6a1b9a,stroke-width:2px,color:#000,rx:12,ry:12; %% ===== Nodes ===== A["🔌 Hardware LayerESP32 / ESP8266 / STM32"]:::hardware B["📡 Protocol ModulesBLE · RF · IR · LoRa · GSM · Serial"]:::protocol C["🔄 Decoders & EncodersTranslate raw signals"]:::codec D["📶 MQTT Communication LayerPublish / Subscribe"]:::mqtt E["🏠 IoT PlatformsHome Assistant · Node-RED · OpenHAB"]:::platform F["⚙️ WebUI & Configuration Tools"]:::manage %% ===== Flows ===== A --> B B --> C C --> D D --> E D --> F
  • Hardware Layer ESP32, ESP8266, STM32, or other supported MCUs form the base.
  • Protocol Modules Plug-and-play support for BLE, RF (433/868 MHz), IR, LoRa, GSM, RS232, and more.
  • Decoders & Encoders Translate raw wireless signals into structured JSON payloads (and vice versa).
  • MQTT Communication Layer Publishes sensor data, device states, and events into MQTT topics. Subscribes to commands for device control.
  • IoT Platform Integration Works seamlessly with MQTT-based platforms (Home Assistant auto-discovery included).
  • WebUI & Configuration Modern WebUI for Wi-Fi setup, MQTT broker configuration, OTA updates, and logging.

Core Features of OpenMQTTGateway

While newer versions introduced additional refinements (like an embedded broker and better device tracking), it’s important to understand the full set of capabilities that OMG offers across its modules:

  1. Multi-Protocol Bridging
    • BLE, RF 433/868 MHz, Infrared, LoRa, GSM, Serial/RS232, RFM69, and more.
    • Acts as a bridge from these protocols → MQTT and back.
  2. Bi-Directional Communication
    • Receives sensor signals and publishes them.
    • Subscribes to MQTT topics and re-emits signals (IR, RF, BLE commands).
  1. Home Assistant Auto-Discovery
    • Automatically exposes sensors and devices to Home Assistant via MQTT discovery protocol.
  2. WebUI for Management
    • Configure Wi-Fi and MQTT.
    • View logs and live messages.
    • Manage OTA updates and restart devices remotely.
  1. OTA Firmware Updates
    • Upgrade directly via WebUI or remote URL.
  2. Edge Flexibility
    • Can run with an external broker (e.g., Mosquitto) or with its embedded MQTT broker (PicoMQTT).
  3. Device Tracking & Presence
    • BLE presence detection (track phones, tags, or wearables).
    • Synchronization across multiple gateways for redundancy.
  4. Security & Reliability
    • Supports authentication, topic filtering, and configuration rollback in case of errors.

Detailed Feature Modules of OpenMQTTGateway

To fully understand the power of OpenMQTTGateway (OMG), let’s break down its supported modules and how each can be used in practical IoT scenarios.

Table: Feature Overview

ModuleCapabilityExample Use Case
BLEScan and decode sensor data, presence trackingBLE temperature sensor, phone detection
RF 433/868 MHzDecode & send RF signalsDoor sensor, RF outlets
IRDecode & transmit infrared signalsUniversal TV/AC remote
LoRaLong-range communicationAgriculture sensors, warehouses
Serial/RS232Read & write serial dataHVAC controllers, GPS modules
GSMMQTT over cellularRemote/rural monitoring
WebUIConfiguration & diagnosticsWi-Fi, MQTT setup, logs
OTAFirmware upgradesRemote update management
Embedded BrokerLocal MQTT (PicoMQTT)Offline/local deployments
HA Auto-DiscoveryAuto device integrationSeamless Home Assistant setup

1. Bluetooth Low Energy (BLE)

BLE is one of the most widely used features of OMG, especially for environmental sensors and presence detection.

  • BLE Sensor Integration OMG can scan nearby BLE advertisements and decode data from devices like Xiaomi Mijia, RuuviTag, Govee, ShellyBLU, and more.
    • Typical data: temperature, humidity, battery level, motion events.
    • Published as structured JSON payloads to MQTT topics.
  • Presence & Asset Tracking OMG detects nearby BLE beacons or smartphones to determine if a person (or asset) is within range. This is widely used for presence-based automation (lights on when you arrive home, HVAC adjustments, etc.).
  • Configurable Parameters
    • Scan interval, RSSI thresholds, device whitelisting/blacklisting.
    • Balances accuracy with power and performance.

👉 BLE support makes OMG a low-cost indoor positioning and environmental monitoring gateway.

2. RF 433/868 MHz

The RF module supports popular sub-GHz wireless devices such as door sensors, motion detectors, weather stations, and RF-controlled outlets.

  • Decoding Incoming Signals With libraries like rtl_433 or RCSwitch, OMG can interpret the signals from low-cost wireless sensors.
  • Re-Transmitting RF Commands From MQTT, you can send commands back (e.g., to turn on/off outlets or trigger alarms).
  • Wide Ecosystem Compatibility Many legacy devices use 433 MHz, making OMG a cost-effective way to integrate them into modern automation platforms.

👉 RF support ensures backward compatibility with affordable, widely deployed devices.

3. Infrared (IR)

IR is still dominant in remote controls for TVs, air conditioners, fans, and audio systems. OMG can bridge IR signals into MQTT.

  • IR Receiver Decodes IR remote codes and publishes them into MQTT topics.
  • IR Transmitter Receives MQTT commands and blasts IR signals to control devices.
  • Protocol Coverage Supports common IR protocols like NEC, Sony, Panasonic, Samsung, LG, etc.

👉 OMG turns an ESP32 into a universal smart remote, replacing traditional IR blasters.

4. LoRa

For long-range, low-power applications (e.g., agriculture, warehouse monitoring), OMG can interface with LoRa transceivers.

  • Receive & Publish LoRa Data Collect sensor data from LoRa nodes and push them to MQTT.
  • Transmit Commands Control LoRa devices remotely by sending MQTT messages back.

👉 LoRa integration extends OMG’s usefulness beyond homes—ideal for industrial IoT and rural deployments.

5. Serial / RS232

Some legacy devices (HVAC controllers, industrial sensors, GPS modules) still use serial protocols.

  • Serial-to-MQTT Bridge OMG can read data over UART/RS232 and publish it into MQTT.
  • Bidirectional Support Commands from MQTT can be written back over serial to control devices.

👉 This feature makes OMG an integration bridge for industrial or legacy systems.

6. GSM / Cellular

OMG supports GSM modules for scenarios without Wi-Fi.

  • MQTT Over GSM Devices can connect directly to an MQTT broker via GSM/4G modules.
  • Remote Monitoring Enables deployment in rural or mobile setups (e.g., vehicles, field equipment).

7. WebUI Management

One of OMG’s most practical features is its built-in Web User Interface.

  • Configuration
    • Wi-Fi settings
    • MQTT broker configuration
    • Logging levels
  • Device Management
    • Restart, firmware update, diagnostics
  • Console Access View real-time logs and MQTT messages directly in the browser.

⚠️ Note: By default, WebUI uses basic authentication without TLS. For security, it should run in a trusted LAN or behind a VPN/HTTPS proxy.

8. OTA Updates

OMG supports Over-the-Air (OTA) updates, reducing maintenance complexity.

  • Web Upload: Upload new firmware via WebUI.
  • Remote URL: Point to a hosted firmware image for updates.
  • PlatformIO: Flash firmware during development and testing.

👉 This allows large-scale deployments to remain up-to-date without manual re-flashing.

9. Embedded MQTT Broker (PicoMQTT)

Since version 1.8, OMG can run its own lightweight MQTT broker, thanks to PicoMQTT.

  • Local Messaging Devices can publish/subscribe without needing an external broker.
  • Reduced Dependency Useful for small deployments or in environments with unreliable connectivity.
  • Hybrid Mode Can still bridge to external brokers for centralized control.

10. Home Assistant Auto-Discovery

OMG natively supports Home Assistant MQTT Discovery:

  • Automatically exposes sensors, switches, and binary sensors.
  • Reduces manual configuration—devices appear instantly in Home Assistant once OMG detects them.

Real-World Applications of OpenMQTTGateway

OpenMQTTGateway is more than a lab project—it’s already powering diverse use cases in smart homes, retail, and industrial IoT.

1. Smart Homes & DIY Automation

  • Environmental Monitoring: Collect BLE sensor data (temperature, humidity, CO₂) and publish to MQTT → Home Assistant adjusts HVAC automatically.
  • Universal Remote: Replace multiple IR remotes with a single ESP32 running OMG to control TVs, ACs, and fans via voice assistants or automation rules.
  • Presence Detection: Track smartphones or BLE tags to trigger “arrive home / leave home” automations.

👉 OMG acts as a multi-protocol hub, cutting down on proprietary gateways and unifying devices under one MQTT-based ecosystem.

2. Retail & Commercial Spaces

  • Energy Management: Monitor RF/LoRa-based smart plugs or meters; use MQTT dashboards to optimize store energy usage.
  • Customer Flow Tracking: BLE beacons + OMG can help track visitor presence patterns without heavy Wi-Fi analytics infrastructure.
  • Asset Protection: Integrate RF sensors for doors/windows and publish intrusion alerts to a centralized MQTT broker.

👉 Retailers benefit from low-cost IoT deployment with rapid scaling across multiple stores.

3. Industrial IoT & Warehousing

  • Cold Chain Monitoring: LoRa sensors in refrigerated warehouses send temperature data via OMG → MQTT → ERP systems.
  • Legacy Integration: RS232/Serial support allows older HVAC controllers or industrial machines to connect to modern IoT platforms.
  • Remote Sites: GSM support means OMG can operate even where Wi-Fi is unreliable.

👉 Industrial teams use OMG to bridge legacy devices with modern cloud analytics, extending system lifespans.


Deployment Considerations & Challenges

Despite its flexibility, deploying OpenMQTTGateway in production environments requires careful planning.

1. Hardware Selection

  • Best results come from ESP32 boards with external antennas for BLE and RF reliability.
  • Boards like Theengs Bridge or M5Stack ESP32 variants offer higher performance and easier enclosure options.

2. Security Concerns

  • WebUI defaults to basic authentication without TLS → must run inside a secure LAN or behind HTTPS/VPN.
  • MQTT should be configured with username/password and, ideally, TLS encryption.
  • Network segmentation (separating IoT from business-critical networks) is highly recommended.

3. Protocol Complexity

  • Not all RF or IR protocols are supported equally—custom codes may require manual mapping.
  • BLE scanning consumes resources; tuning scan intervals and thresholds is necessary to balance performance.

4. Maintenance & OTA

  • While OTA updates make firmware upgrades easy, version changes can sometimes break compatibility with certain hardware.
  • Best practice: test firmware on a staging device before rolling out to all gateways.

Future Outlook

The evolution of OMG points toward a more autonomous, edge-first IoT future:

  1. Edge Computing Expansion
    • With embedded brokers and local processing, OMG reduces dependency on external servers. Expect more edge-side analytics and event filtering.
  2. Wider Device Support
    • Ongoing community contributions will extend protocol coverage (new BLE devices, RF standards, IR databases).
  3. Enhanced Security
    • Future releases are likely to add stronger WebUI security (TLS, advanced authentication) to meet enterprise deployment standards.
  4. Integration with AI and Cloud Platforms
    • MQTT payloads from OMG can feed directly into AI-driven anomaly detection (e.g., predictive maintenance in industry, occupancy analytics in retail).
  5. Commercialization
    • While still open-source, hardware vendors like Theengs are already offering pre-built devices running OMG, suggesting a growing ecosystem of commercial-grade solutions built on this project.

Why OpenMQTTGateway Matters

At its core, OMG lowers the barrier for IoT adoption by:

  • Unifying multiple wireless protocols into one MQTT pipeline.
  • Reducing reliance on proprietary hubs and vendor lock-in.
  • Empowering DIYers, startups, and enterprises alike to scale IoT at low cost.

Whether it’s a smart home enthusiast replacing a shelf full of remotes, a retailer optimizing energy and security across multiple stores, or an industrial operator connecting legacy machines to modern dashboards—OpenMQTTGateway stands out as the Swiss Army knife of IoT bridging.


Start Free!

Get Free Trail Before You Commit.