Learn/rusty_esp_irohmqttirohesp32rust

rusty_esp_iroh Is a Pure Rust Alternative to MQTT

rusty_esp_iroh is a pure Rust alternative to MQTT for ESP32 devices: an iroh node dialed by public key, on your LAN, with no broker in the path.

Signed by M·
Night over a brick neighborhood where every rooftop ESP brick holds an orb and golden threads link the houses with no tower in the middle
Is rusty_esp_iroh a pure Rust alternative to MQTT?

For the home mesh, yes. rusty_esp_iroh is a pure Rust alternative to MQTT: devices dial each other by public key over iroh, with no broker account. It runs on ESP-IDF with at least 8 MB of flash. A bare-metal chip joins through a bridge instead of pretending to be a node.

Related reading

Builder field note

iroh on ESP32: How rusty_esp_iroh Meshes Your Home Devices

APIs, composition, and home deployment for iroh on ESP32: How rusty_esp_iroh Meshes Your Home Devices live on the field note.

rusty_esp_iroh is a pure Rust alternative to MQTT for ESP32 devices that should find each other without a broker. MQTT, usually Mosquitto on a box you or a vendor run, is the market standard: publish a topic, subscribe a topic, and trust the broker to be there. iroh dials a public key. This page is the comparison. The builder field note on rusty_esp_iroh is the protocol record. It belongs to the Connect vision.

What a broker is doing in the house

A broker is a rendezvous you operate. Every camera publishes. Every screen subscribes. The convenience is real, and so is the extra machine, the account on it, and the topic strings that drift.

Why Janus lists MQTT under replace

Espressif's own cloud path, RainMaker, and a broker are named non-goals in a smart home without the cloud. The mesh is the cloud: an iroh endpoint dialed by public key. A pure Rust alternative to MQTT is that choice, written as a crate, not as a slogan.

What the node will not pretend

iroh needs an async runtime and TLS, so it only runs on the std track, Rust on ESP-IDF. The crate uses single-threaded tokio and rustls with n0's RustCrypto provider. It refuses ring and aws-lc, which carry platform assembly that will not build for Xtensa. On the bare-metal no_std track, asking for the node is a compile error, with a message that points at the bridge. A chip without an operating system reaches the mesh through a neighbour.

What has run, and on which tier

On a Seeed XIAO ESP32-S3 Sense the node was up 3.2 seconds after boot and streamed a camera: 721 packets in 60 seconds, none lost, none reordered. That is the silicon row. The ESP32-C6 firmware compiles and has not been the measured node.

Flash, PSRAM, and the bridge

8 MB of flash is the practical floor. Boards with PSRAM can sit in a relay tier. Boards without it, such as a C6, are LAN-direct with the relay disabled. A 4 MB board such as the ESP32-CAM never runs iroh and reaches the mesh through a bridge. Choosing an ESP32 board is the table behind those sentences. A pure Rust alternative to MQTT that ignored flash size would ship a node that does not fit.

The same std code runs on a laptop, which is why most behaviour was proven on the host first. The host is not the chip. The chip row is the XIAO.

Identity on the session

The node is adopted with rusty_esp_mid. The device signs with its own key. One open defect is written down: after adoption the device answers "paired" when asked, but keeps advertising itself as open on the local network, because that record is composed once at boot.

Where MQTT still wins

Stay on MQTT when the rest of the house already speaks topics, including software you will not rewrite. A pure Rust alternative to MQTT is a different API. It is not a broker with the banners removed.

Honest limits

  • Remote access through a relay is written for the PSRAM tier and not measured on a board.
  • Only the XIAO ESP32-S3 Sense has run the node on silicon. Other boards are compile rows until they are timed.
  • There is no C in this crate's protocol code. ESP-IDF underneath is C, and the Wi-Fi blob is Espressif's. The esp-rs book covers that toolchain.

MQTT's topic string is a name you invent. iroh's name is a key the device already has. A pure Rust alternative to MQTT asks you to give up the dashboard that lists those strings, and it gives you a dial that does not depend on a process staying up in the cupboard. If the broker machine is also your only copy of "which camera is which," moving is a real migration, not a flag. Do it when the field note's silicon row is the shape you want: one XIAO, one camera, packets counted. A pure Rust alternative to MQTT is not a claim that every MQTT client library has a twin. A pure Rust alternative to MQTT is a claim about the rendezvous. A pure Rust alternative to MQTT still needs the identity crate, because a key with no owner is just a number. A pure Rust alternative to MQTT that skipped adoption would be a mesh anyone could join.

Where to start

Flash with espino, read the field note, and use the Learn index for the camera and microphone that ride the mesh. The pure Rust alternative to a vendor account is the identity half of the same decision.

The crate is part of Remade With Rust from MATA. When a protocol note needs to become a retrieval corpus, the same house runs RAG Converter.

FAQ

Quick answers for builders evaluating this technology.

Does this pure Rust alternative to MQTT need a broker?

No. An iroh endpoint is dialed by public key. There is no Mosquitto process and no cloud topic to subscribe to. The household mesh is the path.

Which boards have actually run the node?

A Seeed XIAO ESP32-S3 Sense: up 3.2 seconds after boot, streaming a camera with 721 packets in 60 seconds and none lost. The ESP32-C6 build compiles. Only the XIAO has run the node on silicon so far.

Why is 8 MB of flash the floor?

The mesh firmware's app image needs the room. Boards with 4 MB, such as the ESP32-CAM, never get an iroh build and reach the mesh through a bridge. PSRAM decides a second split: with it, a relay tier is possible; without it, the node is LAN-direct.

Can I reach the device from outside the house?

The PSRAM tier is written to use a relay and a short ticket. That path is not yet measured on a board, so no remote-access figure is claimed. The no-PSRAM tier is LAN-direct by design.

When should I stay on MQTT?

Stay when you already have a broker, a fleet of clients that speak topics, and an operator who wants that dashboard. Switch when the device should be dialed as a key, not subscribed as a string.