WireGuard: status, a viable library path, and a 'community support' proposal #10716
Replies: 1 comment
-
|
On the common question: "what's the use case? Doesn't this defeat the purpose of the mesh?" It doesn't replace or interfere with the mesh. WireGuard doesn't touch the LoRa RF mesh between your nodes — pure LoRa/nRF52 nodes are completely unaffected. What it adds, for a node that already has an internet uplink (a WiFi/Ethernet ESP32), is a secure IP tunnel for remote management and connectivity to that node: connect a client directly to the Meshtastic CLI/TCP API, reach the web client, check health, and push OTA updates on hardware that supports it. The goal is making this easy on low-cost hardware: e.g. a ~$15 Seeed XIAO ESP32 mesh kit. It's especially valuable for headless or hard-to-reach gateway nodes (rooftop, solar repeater, remote site) you'd otherwise have to physically visit. Rather than a mesh transport, think of it as out-of-band access to an individual internet-connected node. How this differs from MQTT, since they're easy to conflate: MQTT bridges mesh messages through an internet broker. WireGuard operates at a different layer - it gives you full IP access to the node itself for management, with no third-party broker in the middle. They solve different problems and are complementary. Why WireGuard specifically:
A real-world example from our own deployment: We help support a regional mesh, donating nodes to restaurants, businesses, and individuals to expand coverage in our area. Most of these hosts have no interest in managing a node themselves (they just host the hardware). To make that work, we run WireGuard on each node and associate it with a centralized multi-node monitoring platform (shoutout to MeshMonitor). Using ESP-based builds, we've gotten each deployed node down to roughly $20-$30 in parts. The payoff has been real. During our region's shift to MediumFast, we coordinated the swap across our coverage zones remotely and rapidly. No site visits for our managed nodes who could not be reached after the swap. When new firmware drops, we push updates remotely without taking hardware down or sending anyone out. Until now, that kind of remote management has essentially required Linux/Raspberry Pi-based nodes costing hundreds of dollars each; WireGuard brings the same capability to $30 ESP32 based-nodes. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
WireGuard integration — status and path forward
TL;DR: Native WireGuard isn't ready for core yet, but the picture has improved: there's now an actively-maintained, PSK-capable WireGuard implementation for current ESP-IDF (the one behind ESPHome). The remaining work is re-basing Meshtastic's integration onto it and validating it in our Arduino build — more than a trivial swap, so I'm keeping it on a community track for now while proposing a recognized "community support" option.
After a fair bit of evaluation and testing, I've concluded that native WireGuard integration shouldn't be merged into core just yet — but I want to share where it actually stands, because the blocker has shifted.
What I built on, and why it's a dead end. Meshtastic 2.8 builds on the Arduino framework (pioarduino's
platform-espressif32, i.e. Arduino-ESP32 3.x on ESP-IDF 5.x). The library the current integration uses —ciniml/WireGuard-ESP32— predates that core and is effectively dormant. Keeping it building requires hand-maintained compatibility shims (reimplementing the removedtcpip_adapterAPI overesp_netif, and working around how the Arduino 3.x network stack inspects interface state during registration). On top of that, itsbegin()doesn't accept a preshared key, so a configured PSK is silently ignored — a real, if modest, downgrade versus standard WireGuard. I've added a startup warning for that, but it can't be fixed without replacing the library.The better path I found. There is an actively-maintained alternative: the
droscy/esp_wireguardcomponent that powers the ESPHome WireGuard integration (latest release March 2026, kept current against ESP-IDF 5.x, and — importantly — it supports preshared keys). The catch is that it's structured as an ESP-IDF component rather than a drop-in Arduino library, so adopting it means re-basing the Meshtastic integration onto that component and validating it inside our Arduino build, not a one-line dependency swap. That's real work, but it's a concrete forward path that eliminates both the shim maintenance and the PSK limitation — rather than an open-ended wait for the ecosystem to catch up.Given that effort, I think the right move is to keep this on a community track for now rather than rush a re-platforming into a core release.
In the meantime, I'm actively maintaining community builds on both 2.7.x and 2.8, plus a fairly complete client for managing the firmware customizations. The protobuf definitions are drafted and field-tagged; I'd like to get them reviewed and the tags reserved upstream so clients can rely on a fixed contract.
If there's interest in making this available sooner, I'd suggest a publicized "community support" option, similar to how some on-market hardware is supported today:
That last point is the crux: maintaining these modifications inside the official release cycle would most likely interfere with release stability. A clearly-labeled community track seems like the cleanest way to get WireGuard into people's hands without putting that at risk.
Two things I'd value input on: (a) is there appetite for an official community-support listing for this, and (b) has anyone worked with droscy/esp_wireguard in an Arduino-framework build?
Beta Was this translation helpful? Give feedback.
All reactions