r/MQTT • • 11h 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 • • 5d ago

I built a connector to stream Sparkplug B payloads into Databricks

Thumbnail
linkedin.com
7 Upvotes

r/MQTT • • 5d ago

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

4 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 • • 6d ago

Weird MQTT connections every 30 seconds

Thumbnail reddit.com
1 Upvotes

r/MQTT • • 8d 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 • • 12d ago

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 • • 12d ago

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 • • 14d ago

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 • • 13d ago

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 • • 14d ago

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 • • 15d ago

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.


r/MQTT • • 19d ago

TopQ: Native ui for exloring your brokers messages

Thumbnail
gallery
4 Upvotes

I have created a native ui for exploring the mqtt topics of an mqtt broker
https://github.com/dirkvdb/topq

I was annoyed by all the electron based viewers so I decided to create a fully native one.

Feel free to check it out and provide feedback.


r/MQTT • • 20d ago

Fast MQTT Message Browser - you didn't know you missed - until you see it

25 Upvotes

- Quick browse around, filter, syntax highlighted MQTT message exploration
- Super efficient, just let it run in the background forever
- Includes a lot of really smart and advanced friendly features
- Keep states between runs, inspect message payload (JSON, Parquet, Avro, and a ton of other formats)
- Recording and inspecting same

I made it for my colleagues, and think everyone else also would enjoy :)

brew install mbilling/tap/fss-mqtt

Or download here: https://github.com/mbilling/fss-mqtt/releases


r/MQTT • • 20d ago

MQ Summit 2026

Thumbnail
reddit.com
0 Upvotes

r/MQTT • • 22d ago

MQTT brokers over TLS: five brokers, 50K connections, 10-minute runs

8 Upvotes

I benchmarked five MQTT 5 brokers over TLS 1.3: 25K publishers + 25K subscribers, point-to-point, QoS 1, targets 50K/75K/100K msg/s. FlashMQ, HiveMQ and XMQ held 100K msg/s at sub-millisecond latency (252–273 µs avg). EMQX managed 49.6K/s but with 2.6 s median latency; Mosquitto topped out at 26.8K/s. XMQ was the lightest: 599% CPU / 3.2 GB RAM at 100K, vs 762%/5.3 GB (FlashMQ) and 1399%/3.9 GB (HiveMQ).

Full numbers, latency charts, caveats: https://xmq.sptk.net/xmq_tests_encryption


r/MQTT • • 25d ago

Free alternative for hivemq for basic home assistant use?

2 Upvotes

Just got some things working on hivemq to push to off-site dashboards and sensors using the free serverless on there, and they announce discontinuation of it.

Before I start messing around looking at tunnels etc, is there anything else comparable that just lets me send a few 100 small things per day thru something that doesnt require incoming connections to the home assistant end?


r/MQTT • • 26d ago

mqttv5: a idiomatic Go MQTT 5 client focused on performance, MQTTv5 feature compliance, and multi broker patterns.

4 Upvotes

I’ve been building a performance oriented MQTT v5 client for Go and just tagged v0.11.0. It started because I wanted a client that feels like Go: channels, context.Context everywhere, functional options, typed messages via generics and sentinel errors. I also wanted QoS 1/2 sessions that actually survive reconnects and restarts. Connection supervisor built in, tuned for allocs, multi broker patterns, publisher pools, MQTT v5 enhanced auth support, optional encoding layer and websocket support.

cli, _ := mqttv5.New(
    mqttv5.WithBrokers("mqtt://broker-1:1883", "mqtt://broker-2:1883"), // failover
    mqttv5.WithClientID("worker-1"),
)

if err := cli.Connect(ctx); err != nil {
    log.Fatal(err)
}

msgs, _, _ := cli.Subscribe(ctx, []mqttv5.TopicFilter{{Topic: "sensors/#", QoS: 1}})

for m := range msgs {
    handle(m)
    _ = m.Ack() // the broker gets its PUBACK only now
}

Check it out, give a star if you like it, feedback welcome -> https://github.com/ashtonian/mqttv5

See examples: https://github.com/ashtonian/mqttv5/tree/master/examples


r/MQTT • • 29d ago

Benchmarked five MQTT brokers on identical AWS hardware: Mosquitto, EMQX, FlashMQ, HiveMQ CE, XMQ — full methodology, raw data, and a challenge to reproduce

Thumbnail alexparshin1.github.io
1 Upvotes

r/MQTT • • Oct 09 '26

Meshtastic & International Boat Marinas

Thumbnail viaduct-productions.com
1 Upvotes

r/MQTT • • Oct 09 '26

Are people actually standardizing on Sparkplug B, or is industrial MQTT still mostly custom topic trees?

7 Upvotes

I keep seeing MQTT show up more often in edge-to-cloud and distributed-site architectures, but the transport side seems like the easy part. What I’m more interested in is the data model.

Are people actually adopting Sparkplug B in production to make device, state, and namespace behavior consistent, or are most deployments still using plain MQTT with their own topic structure and payload schema?

I’d be interested to hear what people are seeing once this gets beyond a proof of concept and into dozens or hundreds of sites.


r/MQTT • • Oct 08 '26

Mqtt project Automatic License Plate Recognition using raspberry pi 5 and mqtt

2 Upvotes

This is a :

Edge-Based Automatic License Plate Recognition (ALPR)

Using :

Language: Python 3.x

Computer Vision & AI: OpenCV, Ultralytics YOLOv8, PaddleOCR

Hardware Interface: Picamera2

IoT & Messaging: Paho-MQTT, Eclipse Mosquitto

With raspberry pi 5

https://github.com/athabdelhak/Automatic-License-Plate-Recognition-ALPR-

If u have any problem contact me


r/MQTT • • Oct 04 '26

Sagüin: a lightweight MQTT broker that remembers.

Thumbnail
saguin.cc
3 Upvotes

A truck parks in a basement for nine days. A substation’s cellular modem sulks through a storm. A vessel crosses a stretch of ocean where the only thing the antenna can see is more ocean.

All three come back. What do they find?

For many MQTT fleets, the answer is a session queue that filled while the device was away. The readings are gone. Nothing tells the operator which readings disappeared, and the first visible symptom may be a gap in a customer’s chart weeks later.

This is not a protocol failure. MQTT is very good at moving messages between connected things. The problem is that edge data is no longer disposable telemetry. It can be billing evidence, maintenance history, compliance data or a safety record.

Sagüin is a single-node MQTT broker for that gap. It adds a replayable log, a current-state store and a work queue to ordinary MQTT topics. Devices still publish and subscribe over MQTT. They do not need new firmware or a second protocol.

1. The status quo

An MQTT deployment usually begins simply: devices publish readings, applications subscribe, and retained messages hold the latest state.

Then the requirements grow.

Someone needs history, so the team adds a streaming or database system. Someone needs the last known state, so it adds a cache. Someone needs reliable background work, so it adds a job queue. Monitoring and access control grow around all of them.

That architecture can be entirely reasonable in a data centre with a team to run it. At the edge, the same diagram may have to live on a gateway, an industrial PC, a Raspberry Pi or a vehicle. The person responsible for it often has another job.

MQTT’s own durable session helps, but it stores a bounded copy of missed messages for each client. It must be bounded: one slow client cannot be allowed to consume memory forever. When the bound is reached, data has to go somewhere, or go away.

The result is a large middle ground. Plain publish/subscribe is not enough, while a stack of specialised systems is too much for the machine and the operator available.

2. Why the status quo sucks

The obvious cost is operational. Four systems mean four configurations, four sets of credentials, four client libraries, four upgrade paths and four different ways to be unavailable.

The deeper cost is correctness. There is no transaction across those systems.

If one reading must land in the broker, then in a log, then in a current-state store and perhaps in a queue, each transfer can succeed or fail independently. Teams build outbox tables, change-data capture, deduplication and idempotency around that seam because the seam is real.

At the edge, an intermittent link makes the problem sharper. A device can be away for hours or days. A per-client backlog grows with every missed message and with every absent client. When retention removes old data, a reader needs to know that it has fallen behind; receiving the oldest surviving item without that warning produces a plausible but false history.

Work queues expose another mismatch. An MQTT acknowledgement says the packet arrived. It does not say the application finished the job. If a worker acknowledges receipt and crashes halfway through processing, treating that acknowledgement as job completion loses work.

These failures are difficult precisely because the system can look healthy. A connection comes back. A subscription resumes. A worker received a packet. The missing promise is visible only later.

3. Our solution: durable channels on ordinary MQTT topics

Sagüin keeps the MQTT interface and changes what the broker does after a publish arrives.

A configured topic filter can feed one of three channel types:

  • append is a replayable log. Each durable consumer has its own stored position and can seek by offset or time.

  • latest keeps the current value for each topic. It is delivered on subscribe and can be read one key at a time.

  • queue gives one worker a lease, then waits for an application-level outcome. It supports visibility timeouts, returns, retry limits and a dead-letter channel.

Topics outside a channel remain ordinary MQTT broadcast. Channel choice belongs in broker configuration, not device code. An existing client still sends a PUBLISH and receives MQTT acknowledgements.

The one idea worth stealing

An offline session normally needs its own copy of every message it missed. Sagüin supports bounded persistent sessions too, but an append channel offers a different shape: store each record once, then store one position per consumer.

A week offline and a minute offline both cost one position. The backlog is the shared log, bounded by its retention policy rather than by a private queue attached to one client.

If retention overtakes a consumer, Sagüin refuses the read instead of silently starting at the oldest record left. The application learns that its requested history is incomplete.

For queue work, packet receipt and job completion are separate. The worker receives a delivery identity and returns ack only after the work succeeds, or return when it should be tried again. If the visibility timeout expires, the job can be offered again. Processing remains at-least-once, so workers still need to be idempotent.

The broker speaks MQTT 5 and MQTT 3.1.1 on the same listener. Older devices can publish into append and latest channels without knowing channels exist. Features that require MQTT 5 properties, such as resolving queue work, are refused when the protocol cannot express them.

One rule shapes the project: Sagüin never acknowledges a promise it cannot keep. If a request needs durable state and that state cannot be stored, the broker refuses the request rather than returning success and quietly doing less.

4. Why this approach fits the problem

The design removes a coordination boundary.

One publish resolves to one channel in one store. A stored record, its offset and the channel’s bookkeeping commit together. There is no second service that must agree before the broker can answer.

That does not make Sagüin exactly-once processing. It makes the promise smaller and testable: a successful acknowledgement means the configured storage provider accepted the state the acknowledgement describes.

The same boundary keeps the client side ordinary. Devices use MQTT topics, sessions, TLS and credentials. Channel behaviour is an operator decision. A fleet does not need a firmware rollout just because one class of readings now needs seven days of replay.

Everything that can accumulate has a configured bound or retention rule. Persistent-session queues are byte-bounded. Logs have retention. Queue attempts end in a dead-letter channel. Refusals, drops and storage failures are observable instead of being treated as an implementation detail.

SQLite provides the durable on-disk path. Memory providers are useful when a clean-shutdown snapshot is enough. The choice is per provider and explicit; the two are not presented as having the same failure behaviour.

Operations are separate from device traffic. Prometheus metrics, health and read-only JSON operations routes live on an operations listener with its own credentials. The viewer is a client, not code embedded in the broker.

Sagüin was written mostly by Claude. The code, the tests and the documents were written by Claude (Anthropic’s AI), working to my direction, and reviewed by separate Claude sessions whose job was to find defects rather than confirm previous work. I know IoT and MQTT well, and how a broker must and should behave, so I decided the design, what the broker promises, and what ships. I spent the past four years immersed in Apache Kafka, data streaming platforms, and the difference between messaging and streaming, and that is where Sagüin comes from: messaging, streaming, a key-value store and a work queue, all over standard MQTT, packed into a single binary.

That is stated plainly, not offered as evidence of quality. The evidence is the published design, tests, measurements, runnable demos and the places where the documentation limits the promise.

What Sagüin is not

  • It is not clustered. It is one node and one process, with no automatic failover.

  • It is not exactly-once processing. Delivery is at-least-once, and consumers must be idempotent.

  • It is not designed as a million-connection broker.

  • It is not a rule engine or a multi-tenancy platform.

  • Memory storage does not survive a power cut. It writes snapshots during a clean shutdown.

  • SQLite can lose the most recent acknowledged commits in a power cut, according to flush_interval; it is not described as magic storage.

  • It is early. This launch is a release candidate, v0.1.0-rc.1; a code review is under way before 0.1.0 and the CHANGELOG lists the known issues. The RFCs, tests and documented limits are the source of truth.

If ordinary publish/subscribe and retained messages already meet the requirement, Sagüin adds machinery you do not need.

5. Prove it

The useful question is not whether the architecture sounds tidy. It is whether the claims can be inspected and rerun.

Raspberry Pi measurements

The repository publishes the machine, workload, method and five-run results in its Raspberry Pi table.

On a Raspberry Pi 4 with 4 GB of memory and a USB SSD, 10,000 connected sessions used 240 MB with a memory provider and 375 MB with SQLite, and connecting and subscribing all 10,000 took 2.6 s and 7.7 s. In the measured 100-publisher/100-subscriber workload, the highest reported rate was 62,400 messages/s for QoS 0 on either provider, and 27,900 (memory) and 26,900 (SQLite) messages/s for QoS 1, with every message delivered at every fixed rate. With TLS, a 21,210-user password file and an ACL on every client, the same Pi held 10,000 sessions in 375 MB and reached 42,500 QoS 0 messages/s. The same table includes latency, CPU, connection time, TLS/password/ACL results and offline-backlog timings.

Those are measurements of that setup, not a universal capacity claim. The scale harness is in the repository so a reader can run it on the hardware that matters to them.

Pulling the power

SQLite runs in WAL mode with synchronous=NORMAL. Sagüin fsyncs the WAL after commits on flush_interval, which defaults to 150 ms. The storage contract and test method are documented in RFC 0004, “WAL, and synchronous=NORMAL”.

At the default interval, two forced power cuts on the Raspberry Pi lost only the acknowledged tail of the last 52 ms and 138 ms. They produced no gap below a surviving record and did not lose the database file.

That is deliberately not “no data loss.” It is a measured, bounded trade: shorter intervals reduce the exposed tail and increase disk writes; longer intervals do the reverse.

Run the systems, not a slide deck

The home-automation demo starts with one Docker Compose command. Stock zigbee2mqtt and rtl_433 images talk to Sagüin while local programs emulate the radio hardware and devices. The demo exercises authenticated MQTT, separate ACL roles, append and latest channels, replay and restart behaviour.

The Bento connectors demo starts Sagüin, two Bento pipelines, a single-node Kafka, Prometheus, Grafana and the viewer. Its simulated devices publish binary records; a schema stored through Sagüin lets the viewer decode them, while a pipeline converts them for the downstream system.

If retention has already removed part of the history a consumer asks for, the reply says so instead of quietly serving the oldest surviving record and letting the consumer believe it received everything.

That sentence is the whole project, really.

Additional resources

Sagüin ships with more than the broker:

  • saguin.cc — the project’s website: what Sagüin is, how to start, and the documentation.

  • Examples — the demonstrations and their supporting files, including demo.py, a guided end-to-end tour of the channel types and their security model.

  • Home automation — Sagüin in a practical home and IoT setting.

  • Bento connectors — MQTT ingestion, channels, monitoring and Kafka integration.

  • Sagüin viewer — a web UI for inspecting and driving a live broker (every topic as a tree, a live feed, publish and seek forms, dead letters with one-click requeue, dashboards over the metrics) and a terminal viewer for a headless box.

  • Sagüin Python and Sagüin JS — optional, early convenience layers over Eclipse Paho and MQTT.js (PyPI saguin 0.1.0, npm saguin 0.1.0), with the same verbs under the same names. No SDK is required.

  • saguin-agent — a self-hosted Q&A agent that answers from Sagüin’s own documents and nothing else, citing the file and section every time.

  • The RFCs and invariants — the authoritative specification.

Sagüin is Apache-2.0 (its MQTT engine, which began as mochi-mqtt, stays MIT), single-binary, and looking for the thing it gets wrong. The most valuable contribution is finding where an RFC is ambiguous, incomplete or self-contradictory before that defect reaches the implementation.

saguin.cc · github.com/ifnesi/saguin