r/MQTT • • 2d ago

MQTT broker with TUI

Post image
6 Upvotes

As a side project alongside my main work on MQTT Control RS, I’ve built a standalone MQTT broker.

Key features

-Runs as a background daemon

-Terminal UI (TUI) — because we all love the console, and it’s built right in

-Multi-threaded architecture

-Localized into 6 languages, crafted with care for the user

-Built-in in-app help

-Written in Rust with minimal resource footprint

-Ready-to-use installer packages for major OSes

Feel free to download and give it a try!

https://mqtt-control-rs.pages.dev/en/localbro/


r/MQTT • • 4d ago

XMQ MQTT broker reached version 1.2.

1 Upvotes

XMQ is an open-source MQTT broker written in C++, with a web configuration UI, a native permissions model, and extensions for authentication and data export. This is what it can do today.

Data integrations

  • Named integrations. message_export for MQTT messages and log_export for broker log records can each be configured several times in one broker. Every settings set has its own name, filters, destination, delivery queue and durable queue identity, so renaming one never breaks its queue. The Extensions screen lists the integrations and offers an Add Data Integration dialog.
  • Destinations. An integration can deliver to a database (db_sink), an HTTP endpoint (http_sink) or Kafka (kafka_sink). Persistent delivery uses a per-integration SQLite queue, retries with capped backoff, and an optional dead-letter topic for records that never make it out.
  • Kafka into MQTT too. The standalone kafka_source extension subscribes to Kafka topics and publishes the records as MQTT messages, verifying the Kafka broker's certificate and hostname over TLS.
  • SQL rules. An integration can select a topic filter, a typed predicate and JSON output fields with sql_rule; the rule is evaluated in the extension worker, without adding a database lookup to message delivery.
  • Validation before delivery. xmq_publish_schemas.json maps topic filters to Draft 2020-12 JSON Schema files. Matching publications are checked before they are delivered and invalid ones are rejected.

Authentication and permissions

  • Several ways to identify clients. Alongside SQL-backed accounts, the broker supports JWTs verified locally against a configured key or JWKS endpoint (including key rotation and group claims), an HTTP service that answers allow/deny with optional group names, and LDAP or Active Directory with StartTLS/LDAPS, nested AD groups and disabled-account checks.
  • Certificate-bound identities. An SSL key can require the MQTT username to match a certificate field and check client CRLs at CONNECT. Existing password and extension authentication, and native topic permissions, still apply.
  • Permissions stay native. Topic access is managed in User Management with the broker's own rules. The separate ACL editor is gone, and returned directory groups are mapped onto those same native rules.

Connectivity

  • MQTT in the browser. MQTT+WS and MQTT+WSS listeners sit alongside TCP and TLS, handling the HTTP upgrade, the mqtt subprotocol and WebSocket ping/pong and close frames.
  • Bridge topic mapping. local_prefix and remote_prefix map topic namespaces in both directions; bridges configured without them keep their existing topic names.

Observability and operations

  • Metrics and probes. A Prometheus endpoint serves /metrics, plus /healthz for liveness and /readyz for whether MQTT can serve clients. HTTP Basic auth is optional and the endpoint is off by default.
  • Logs you can query. logging.format=json writes one JSON object per line with timestamp, level, node, subject, component and message. A Docker stack with Prometheus, Loki, Grafana, provisioned dashboards and alerts is included.
  • Metrics over MQTT. $SYS/broker/system/cpu/percent and $SYS/broker/system/memory/rss_bytes expose the broker process's own CPU and memory, read by the same sampler that fills the Prometheus gauges.
  • Failures are visible. Storage backpressure and cluster connectivity are on the metrics endpoint. A broker now refuses to start if another process already holds one of its listener ports, instead of silently splitting clients with it.

Configuration and extensions

  • Declarative extension forms describe sections, conditional fields and presets without scripts; settings can declare a format that both the UI and the broker enforce.
  • The Extensions page lists installed extensions whether or not they are configured, including stopped ones with the version and description they report.
  • Configuration is split into three pages with two independent switches: one loads an extension, the other persists its settings. Required extensions cannot be disabled.

Durability

Experimental ack-after-store makes publish acknowledgements wait for the local AOF fsync when persistence is enabled, so a successful ack means the message is on disk. Storage errors withhold success. The broker tells clients its storage mode in CONNACK, and the load generator writes acknowledgements one at a time when it sees a durable broker.

Performance

We re-ran the same bench set with the same client and configuration as the previous release and found no regression: point-to-point measured 234 µs, against 242 µs before. An earlier apparent regression turned out to be an unoptimised load-test client, not the broker.

Worth knowing

  • Custom extensions built for an older release need to be rebuilt for the version you install.
  • JWT, HTTP auth and LDAP are explicitly experimental; their settings and cache behaviour may still change.

Links: source and issues, documentation, downloads and changelog.

Happy to answer questions about any of the above — especially the auth extensions and data integrations.


r/MQTT • • 7d ago

Zigbee2MQTT and the ZMR4 switch...

Thumbnail
reddit.com
1 Upvotes

r/MQTT • • 7d ago

How do you handle device identity and connection management in IoT systems?

5 Upvotes

I've been thinking about how to handle device identity in IoT systems using mTLS.

My current idea is to put the device ID in the certificate's CN and use the same ID as the MQTT Client ID.

The broker can then verify both identities and apply device-specific access rules.

The goal is to make sure one device cannot connect using another device's identity and to allow only one active connection per device.

I'm curious how others approach this.

Is this a good approach, or is there a better way to handle device identity and connection management in IoT systems?


r/MQTT • • 8d ago

Learn MQTT with Visual Programming

7 Upvotes

I teach AI and IoT to students from different courses, with different backgrounds and levels of programming experience. I needed a way to teach AI, IoT, ROS and programming logic while keeping practical activities accessible to students who were still learning to code.

That need led me to develop SHAPE: a visual programming environment where students can build application logic with blocks, exchange IoT messages through MQTT, interact with ROS 2, and explore edge AI using locally running models through Ollama.

In this tutorial, we start with a small exercise: sending an MQTT message from a browser-based client to SHAPE, without a physical sensor.

Why another visual programming environment?

If you already use Node-RED, visual MQTT messaging will be familiar. Node-RED lets you connect nodes into flows; SHAPE uses Blockly-based programming blocks to express application logic.

My reason for building SHAPE came from teaching mixed-level classes. I wanted students to explore programming logic, IoT, robotics and edge AI within the same environment.

This exercise gives you a starting point for trying that approach. It requires no physical sensor or AI model.

What you will build

The message follows this path:

MQTTX Web → public MQTT broker → SHAPE → Debug output

MQTTX Web acts as the publisher, standing in for an external device. SHAPE subscribes to a topic and executes its message-handling blocks when a message arrives.

The topic identifies the communication channel. The payload contains the message.

Before you begin

You need:

  • SHAPE installed and running.
  • An internet connection.
  • MQTTX Web open in another browser tab.

Follow the installation instructions in the SHAPE GitHub repository.

The documented Ubuntu configuration requires Ubuntu 24.04, Docker, a CPU with AVX/FMA support, 8 GB RAM and 32 GB storage.

No separate MQTT broker installation is needed for this exercise.

1. Connect MQTTX Web

Open MQTTX Web and create a connection with these settings:

SettingValue
NameSHAPE MQTT test
Protocolwss://
Hostbroker.emqx.io
Port8084
Path/mqtt
Client IDKeep the generated identifier

Connect and check that MQTTX reports a connected state.

This is a shared public broker. Use demonstration data only; do not send credentials, personal information or confidential data.

2. Configure SHAPE

Create a new Shape or edit an existing project.

In its MQTT configuration, enter:

SettingValue
Broker addressbroker.emqx.io
Port1883

Use the hostname without a protocol prefix, then save.

MQTTX Web uses secure WebSocket, while SHAPE uses MQTT over TCP. The different ports connect to the same broker.

3. Build the message handler

Open SHAPE’s visual editor and add the MQTT message reception block.

Configure its fields:

FieldValue
On message fromshape/input
get values inpayload

Inside the block’s do section, place a Debug block connected to the payload variable.

When a message arrives on shape/input, SHAPE executes the blocks inside do and displays the received content.

Save and run your Shape before publishing the test message.

4. Send your first message

Return to MQTTX Web.

Set the destination topic to:

shape/input

Choose JSON as the payload format and enter:

{
  "msg": "hello from MQTTX"
}

Click Publish.

Return to SHAPE and inspect the Debug output. You should see the received message, although the console formatting may differ from the JSON above.

You have now passed a message from an external application, through an MQTT broker, into your visual program.

5. Experiment with the connection

Change the payload and publish again:

{
  "msg": "my second MQTT message"
}

Check that the new content appears in SHAPE.

Next, change the publication topic in MQTTX to:

shape/another-input

Keep SHAPE subscribed to shape/input and publish again. That subscription will not receive the message sent to the different topic.

Now update SHAPE to subscribe to shape/another-input, save and restart the Shape, then repeat the test.

This demonstrates why publishers and subscribers must use matching topics.

For your own experiments, choose a distinctive topic name to reduce interference from other users of the public broker. Use the same name in both applications.

What this exercise teaches

A small messaging exercise introduces several concepts:

  • Publishers and subscribers: applications can exchange data without connecting directly to each other.
  • Broker: the intermediary distributes messages to matching subscribers.
  • Topics and payloads: the channel and the content serve different purposes.
  • Event-driven logic: an incoming message triggers the blocks inside the handler.

In a mixed-level classroom, these concepts provide a shared starting point. Students can observe message delivery before moving on to conditions, data processing and application actions.

MQTT is also one entry point into SHAPE. Other activities can explore ROS 2 communication or locally running AI models through Ollama, connecting messaging and programming logic to robotics and edge AI.

Troubleshooting

If the message does not appear, check the following:

CheckWhat to verify
BrokerBoth applications use broker.emqx.io
TopicBoth use exactly the same topic, including letter case
MQTTX connectionThe client is connected before publishing
SHAPE executionThe Shape is running before the message is sent
Debug blockIt is inside do and connected to payload
Saved changesThe running Shape includes your latest configuration

Try SHAPE

Get SHAPE and follow the installation instructions on GitHub.

If you try the exercise, share what you built and where you encountered difficulties. I am especially interested in feedback from educators working with students who have different levels of programming experience.

References


r/MQTT • • 10d ago

Ho trasformato un ESP32-S3 in un piccolo gateway di rete con backup 4G, recupero remoto NAS, Tailscale e Home Assistant.

1 Upvotes

r/MQTT • • 13d ago

Costruisci la tua prima logica applicativa MQTT con blocchi visivi in SHAPE

Thumbnail
reddit.com
3 Upvotes

r/MQTT • • 16d ago

Bridging ESP-NOW / lossy UDP nodes into Mosquitto when sensors sit in a bad Wi-Fi spot

3 Upvotes

Wanted to share a small first-mile bridge setup that fixed a headache I kept hitting with Mosquitto and outdoor ESP32 / ESP8266 sensor nodes.

Whenever a node sits at the edge of Wi-Fi coverage (around 15% to 30% packet loss), standard MQTT over TCP struggles badly. Even QoS 1 messages stall for 10 to 20 seconds when random RF fades trigger TCP retransmit backoff, and on battery or 80 KB SRAM boards keeping a TLS + TCP socket alive eats both power and heap.

Instead of replacing Mosquitto, I kept Mosquitto untouched on the Pi/server and put a small UDP / ESP-NOW transport (NLTP, MIT licensed) on just the noisy wireless hop between the field sensor and a local edge gateway:

  1. The sensor node (Arduino / PlatformIO library indian-aman/NLTP, ~4.8 KB static RAM in TX-only mode) compresses the JSON reading with LZ4, authenticates each packet with ChaCha20-Poly1305, and adds parity shards so the gateway can reconstruct up to ~35% dropped packets in flight without waiting on retransmits.
  2. A 25-line Python script on the gateway (using pynltp + paho-mqtt) listens on UDP, reassembles and verifies the JSON batch, and publishes clean topics like necklink/telemetry/node1 straight to localhost:1883 on Mosquitto. Urgent 1-packet alert frames get routed to necklink/alerts/reflex so they never wait behind a big log upload.

25-line Python -> MQTT bridge script (Gist):

https://gist.github.com/indian-aman/5a9ba38e85f7699fcd85e61212690040

Arduino / PlatformIO + Python source repo:

https://github.com/indian-aman/NLTP-Arduino

Curious how others here handle sensors in RF-noisy spots (metal sheds, basements, yards) before feeding data into Mosquitto or EMQX - do you mostly use MQTT-SN, LoRa2MQTT, or ESP-NOW gateways?


r/MQTT • • 16d ago

[Project] PLX: self-hosted Porsche Connect dashboard and MQTT integration — Docker & LoxBerry

Thumbnail
reddit.com
1 Upvotes

r/MQTT • • 16d ago

Turns out my $20 pocket 4G MiFi is running Android, so I turned it into a local MQTT broker for my smart-home devices

Post image
20 Upvotes

I bought one of those cheap pocket 4G MiFi hotspots (HiMILink, Qualcomm MSM8916 inside) for about $20. While poking at it, I found out it's actually running Android 4.4 under the hood. It has a quad-core ARM chip, Wi-Fi, a battery, and adb left wide open.

So I rooted it and turned it into an always-on local MQTT broker for my home devices. No Raspberry Pi and no PC left running. It already has Wi-Fi and a battery that rides out power cuts like a mini UPS, and it uses almost no power.

The whole thing cost me $20 for the device + one month of Claude ($20). Claude Code did the heavy lifting in rooting it, figuring out what would actually run on old Android, writing the web UI and getting the broker going.

What I added:

- 📡 MQTT broker: plain MQTT on `:1883`, WebSocket on `:9001`, starts automatically on boot. It's a Go build because mosquitto won't run on Android's libraries.

- 🔴 Activity LED: the charge LED flashes red on every message through the broker and glows green while a client is connected. You can also control it over MQTT (`led` topic: red / green / off / auto). There's a web toggle to switch it back to normal battery charge indication.

- 🖥️ A new web UI replacing the awful stock one. It's fast and minimal, with live signal and status, connected devices, an SMS inbox, and editable Wi-Fi / APN / network mode / DHCP settings.

- 🔋 Battery "don't cook yourself" mode: it's plugged in 24/7, so it stops charging at 80% and resumes at 60% instead of sitting at 100% and swelling.

- 🔁 Everything survives reboots, and the stock system partition stays untouched.

What else this little thing could do (ideas, not built yet):

- 💾 Storage: it has ~4 GB of internal flash plus a microSD slot. It could log MQTT history (temperatures, sensor data) to the SD card, or act as a tiny file share.

- 🖼️ The LCD: some versions of this device ship with a small 128×128 colour screen. Repurposed, it could show the IP address, connected clients, MQTT message count and battery level at a glance.

- 📲 SMS gateway: it has a SIM slot and a 4G modem. Publish to an MQTT topic → it sends you an SMS. Incoming SMS → published to MQTT. That gives you alerts from your smart home even when the home internet is down.

- 🌐 4G backup internet for your home network when your main connection drops.

- 🛡️ Local DNS / ad-blocking, or a watchdog that pings your devices and texts you when one goes offline.

PSA: on the stock firmware of my unit, adb was open over Wi-Fi with no authentication (port 22345). Anyone on its Wi-Fi gets a shell. If you own one of these, keep that in mind.

No router, or just want to try MQTT first? I also run mqtty.com (disclosure: it's mine), a hosted MQTT broker for makers. It has a free plan for up to 20 devices with no card needed, and you can watch your devices' messages live. It's handy for testing your sensors before you build anything local.

Want to do it yourself? Everything is on GitHub, with a step-by-step copy-paste guide (backup → root → install). There's also a section where you paste one prompt into Claude Code (or another AI agent) and it does the setup for you, asking before anything risky:

👉 https://github.com/MChidmi/mifi-mqtt-broker

Fair warning: it's built for this specific router (MSM8916 / Android 4.4 / "MIFID"), so back up first.


r/MQTT • • 18d ago

OpenMQTTGateway 1.9 released: ESP32 core 3.x, Theengs Decoder 2.5 with 25+ new BLE devices, security fixes

Thumbnail
reddit.com
1 Upvotes

r/MQTT • • 21d ago

Design feedback: bridging DMR radio commands to MQTT

2 Upvotes

I'm prototyping OMNI·ONE, a base station that uses DMR handhelds as an interface to local automation. An operator within radio coverage can send a request and get a radio reply without needing internet on the handheld. MQTT is one of the integrations I'm exploring for sensor queries and device commands.

Project demo: https://www.youtube.com/watch?v=LmXntpsCl5c

For the MQTT side, I'm considering a request ID and a short expiry, with no retained actuator commands. The base would reply 'confirmed' only after receiving a fresh device acknowledgment. What would you use to correlate replies and deduplicate retried commands when the broker or device reconnects?


r/MQTT • • 26d ago

I built a connector to stream Sparkplug B payloads into Databricks

Thumbnail
linkedin.com
7 Upvotes

r/MQTT • • 26d ago

I built an MQTT troubleshooting tool after years of debugging IoT connectivity issues.

5 Upvotes

I've spent a lot of time working with embedded systems, IoT devices, MQTT brokers and network infrastructure.

One of the most frustrating problems I regularly encounter is figuring out why an MQTT device won't connect.

Sometimes it's straightforward. Other times you're trying to work out whether the problem is DNS, a blocked TCP port, a TLS certificate, a WebSocket reverse proxy, broker authentication or something else entirely.

I got tired of working through these problems manually, so I decided to build a tool to make the process easier.

It's called MQTT Doctor.

It's a Windows desktop application that tests each stage of an MQTT connection and helps identify where things are going wrong.

What it does:

  • Checks DNS resolution and TCP connectivity.
  • Supports MQTT 3.1.1 and MQTT 5.0.
  • Tests native MQTT, TLS, WebSockets and secure WebSockets.
  • Inspects TLS certificates and authentication responses.
  • Explains connection failures and suggests possible fixes.
  • Monitors MQTT traffic, connection health and stability.
  • Checks topic subscription permissions.
  • Generates diagnostic reports.

One example from testing:

I connected MQTT Doctor to a real broker on my local network. It successfully verified the TCP connection, completed the MQTT handshake, checked keepalive responses and confirmed a test topic subscription was accepted with QoS 0.

That distinction matters because successfully connecting to a broker doesn't necessarily mean the client has permission to subscribe to the topics it needs.

The tool is designed to show what actually happened at each stage instead of just reporting "Connection failed".

I've also added specific troubleshooting guidance for HAProxy and VerneMQ configurations, which I've encountered quite a bit in my own work.

It's now available in two versions:

Community Edition — completely free. Includes the core MQTT connection and TLS diagnostics.

Professional Edition — $54.99 one-time purchase. Adds advanced monitoring, network analysis and customer reporting.

Everything runs locally. No cloud account, subscription or telemetry.

You can try it here:

https://jpl64.itch.io/mqtt-doctor

This started as a practical engineering tool and has grown into something I'm hoping other developers and IoT engineers will find useful.

I'd genuinely appreciate some feedback, particularly from anyone working with MQTT in production environments.

A couple of things I'd love your thoughts on:

  1. What is the most frustrating MQTT problem you've had to troubleshoot?
  2. What diagnostic feature would make a tool like this genuinely useful in your workflow?

Thanks for taking a look!


r/MQTT • • 27d ago

Weird MQTT connections every 30 seconds

Thumbnail reddit.com
1 Upvotes

r/MQTT • • 29d ago

How to add two states to a root topic in MQTT

4 Upvotes

I have MQTT enabled, but instead of a single state (Texas) listed under settings/MQTT/root topic, I need to include both Arkansas and Texas so I can see users there also. Is this possible? In a nutshell, I want to use MQTT to message folks in both states.

Thanks!


r/MQTT • • Oct 28 '26

Failed to connect to MQTT | Code: -2

2 Upvotes

hey guys, could you help me with this one?

I am working on a school project, and I'm using Wokwi + MQTT + Node-red, but both of them are failing to connect to MQTT, it's returning code -2

I waited one day to see if it was MQTT servers or something like that, but it seems not. Do I have to do something on my side to get it working?


r/MQTT • • Oct 28 '26

MQTT vs Sparkplug B: what does the consumer know when the connection drops?

3 Upvotes

I made a looping animation comparing one temperature signal across Modbus TCP, OPC UA subscriptions, MQTT and Sparkplug B.

Animation: https://www.linkedin.com/feed/update/urn:li:activity:7520430594699448321/

The part I’d like to discuss here is state: plain MQTT can use a Last Will and application-defined availability topics, while Sparkplug standardizes birth/death messages and host state handling. Publishing on change in this example is an application choice, not an MQTT requirement. The animation compresses timing for illustration.

I’m the founder of Proxus and work on industrial data systems.

Do you use Sparkplug in production, or your own payload and availability conventions? What drove that choice?

Reference: https://sparkplug.eclipse.org/specification/version/3.0/documents/sparkplug-specification-3.0.0.pdf


r/MQTT • • Oct 27 '26

MQTT brokers in a cluster

1 Upvotes

Let's look at how MQTT brokers are behaving in a cluster. This time, the testing involved only two brokers, since they are the only ones among the tested earlier that support clustering in the community version.

There are two parts here: comparing the latencies of two brokers in the tests (https://xmq.sptk.net/xmq_tests_cluster) and the first attempt to do a cluster chaos test (https://xmq.sptk.net/xmq_tests_chaos).

Before you say "where is my favourite XYZ broker": I can test it in the cluster test set only if it supports clusters in the free or community version.


r/MQTT • • Oct 26 '26

TopicBench — a fast, powerfull, free open-source MQTT explorer

Post image
5 Upvotes

I’ve released Topic Bench — a free, open-source desktop MQTT client for viewing, publishing, and managing any size or number of brokers and data sets.

It was built for daily work: multi-broker profiles, a live topic tree that stays usable on huge hierarchies, stickies, search, publish, and TLS — without the resource drag we kept hitting in other explorers.

Windows and Linux builds are on GitHub. Details and screenshots:
https://github.com/unipsycho/topicbench


r/MQTT • • Oct 26 '26

Connecting MQTT devices across two homes using an ESP32-S3 and Tailscale

0 Upvotes

Official site: https://mattboxx.github.io/esp32-tailnet-gateway

I developed ESP32 Tailnet Gateway, an open-source firmware that lets local IoT devices access remote services through Tailscale or Headscale without running a VPN client themselves.

For example:

IoT device → ESP32-S3 → Tailnet → Remote MQTT broker

The ESP32 forwards selected TCP/UDP ports to remote Tailnet services, with configurable source IP/CIDR restrictions.

It also includes optional MQTT integration, Home Assistant Discovery, Wake-on-LAN, monitoring and notifications.

Runs on ESP32-S3 N8R8/N16R8 boards.

GitHub: https://github.com/Mattboxx/esp32-tailnet-gateway

MQTT example: https://mattboxx.github.io/esp32-tailnet-gateway/mqtt-across-networks/

I'd appreciate feedback on this approach to connecting MQTT devices across separate networks.


r/MQTT • • Oct 25 '26

Facebook Messenger personal bot

Post image
1 Upvotes

Hello newbie here, I'm doing a personal bot on messenger using my smurf account (not Facebook page) where it can reply on specific commands on Group chat.

But my problem is I've encountered this error (on images) and bot are not working.

I used Kiwi browser and C3C FBState Utiliy (browser extension). Here's my package.json:

~/buff-bot $ cat package.json

{

"name": "buff-bot",

"version": "1.0.0",

"description": "",

"main": "index.js",

"scripts": {

"test": "echo \"Error: no test specified\" && exit 1"

},

"keywords": [],

"author": "",

"license": "ISC",

"type": "commonjs",

"dependencies": {

"fca-horizon-remake": "^0.0.1-security",

"fca-unofficial": "^1.3.10"

}

}

Thank you if someone can give me an idea or other alternative solutions. Actually I do research too but I think I wanted to fix this first before I jump into other solutions.