Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. MQTT
  3. serial2mqtt

serial2mqtt

MITC++

A Linux gateway that bridges serial communication (USB, serial, Bluetooth) to MQTT, enabling MQTT for microcontrollers without Ethernet or WiFi.

GitHubGitHub
155 stars31 forks0 contributors

What is serial2mqtt?

serial2mqtt is a Linux gateway that enables MQTT communication for microcontrollers lacking Ethernet or WiFi connectivity. It reads JSON-formatted commands from serial ports (USB, UART, Bluetooth) and translates them into MQTT publish/subscribe operations, bridging low-cost embedded devices to MQTT brokers. It solves the problem of integrating simple, serial-only microcontrollers into modern IoT ecosystems without requiring network hardware on the device itself.

Target Audience

Embedded developers and IoT hobbyists working with low-cost microcontrollers (e.g., STM32, ESP32 in serial mode) who need to integrate these devices into MQTT-based smart home or industrial automation systems without adding network hardware.

Value Proposition

Developers choose serial2mqtt because it provides a lightweight, self-hosted gateway that eliminates the need for Ethernet/WiFi modules on microcontrollers, significantly reducing device cost and complexity. Its event-driven design, support for dynamic serial port management, and optional over-the-air firmware flashing offer a flexible and robust solution for serial-based IoT projects.

Overview

Implement a Linux gateway that reads serial port ( USB, serial , bluetooth) commands and transfers to MQTT host. MQTT without ethernet or Wifi on a low cost micocontroller. Don't develop a serial command interface , just use MQTT UI's and features.

Use Cases

Best For

  • Adding MQTT connectivity to cheap STM32 boards (e.g., Blue Pill) with only UART
  • Integrating metal-enclosed ESP32 devices (using PWM) into MQTT networks without WiFi
  • Building IoT sensor networks with low-cost microcontrollers as peripheral nodes
  • Centralizing logic on a Raspberry Pi while using simple microcontrollers for I/O
  • Prototyping IoT devices with serial communication before adding network hardware
  • Managing and flashing microcontroller firmware remotely via MQTT commands

Not Ideal For

  • Projects requiring Windows or macOS compatibility, as it's Linux-only
  • Real-time applications where serial-to-MQTT latency is critical
  • Systems needing microcontrollers to operate independently without a host computer
  • Applications relying on binary data or non-JSON serial protocols

Pros & Cons

Pros

Broad Microcontroller Support

Enables MQTT for cheap boards like STM32 Blue Pill and ESP32 in serial mode, reducing hardware costs and complexity, as highlighted in the README with examples.

Dynamic Serial Management

Automatically handles USB device hot-plugging and reconnects on timeouts, ensuring reliability without manual intervention, per the event-driven architecture.

Integrated Debugging Logs

Forwards all serial input, including logs, to MQTT topics without disrupting data flow, simplifying debugging with color-coded outputs as shown.

Remote Firmware Updates

Supports triggering external tools via MQTT commands to flash firmware, enabling over-the-air-like updates for connected microcontrollers.

Cons

Linux-Only Deployment

Limited to Linux systems, excluding Windows or macOS, which restricts platform choice and adds barriers for mixed-environment teams.

Complex Build Process

Requires manual compilation with dependencies like paho-mqtt-c and OpenSSL, increasing setup time and potential for errors, as noted in build instructions.

JSON Protocol Constraint

Only supports JSON-formatted messages, making it unsuitable for binary data or legacy serial protocols, with binary support listed as a 'still to do' item.

Frequently Asked Questions

Quick Stats

Stars155
Forks31
Contributors0
Open Issues3
Last commit1 year ago
CreatedSince 2016

Tags

#paho-mqtt#embedded-systems#microcontroller#bluetooth#mqtt-client#c#serial-communication#iot-gateway#linux#usb

Built With

O
OpenSSL
C
CMake
C
Conan
C
C++

Included in

MQTT2.3k
Auto-fetched 1 day ago

Related Projects

ValetudoValetudo

Cloud replacement for vacuum robots enabling local-only operation

Stars9,826
Forks518
Last commit3 days ago
Mi Flora via MQTT daemonMi Flora via MQTT daemon

Linux service to collect and transfer Xiaomi Mi Flora plant sensor data via MQTT to your smart home system, with cluster support 🌱🌼🥀🏡🌳

Stars622
Forks139
Last commit2 years ago
bt-mqtt-gatewaybt-mqtt-gateway

A simple Python script which provides a Bluetooth to MQTT gateway, easily extensible via custom workers. See https://github.com/zewelor/bt-mqtt-gateway/wiki for more information.

Stars550
Forks117
Last commit3 years ago
mqtt-camera-streamermqtt-camera-streamer

Stream images from a connected camera over MQTT, view using Streamlit, record to file and sqlite

Stars249
Forks56
Last commit2 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub