Meshtassy is a mesh network that aims to be compatible with the Meshtastic network.
This project is a proof-of-concept implementation of a mesh network firmware using Embassy and lora-rs. It aims to be compatible with the Meshtastic network.
Currently supports:
- Seeed Studio XIAO nRF52840 with accompanying SX1262 LoRa module
The modular design of embassy-rs makes it relatively easy to port to other boards or Embassy-compatible platforms (ESP32, RP2040, etc.).
- Decode most packets on primary channel
- Send packets on primary channel
- AES encryption/decryption for Meshtastic packets
- USB Serial implementation
- Protobuf message parsing for various Meshtastic message types:
- Text messages
- Telemetry data
- Node info
- Position data
- Neighbor info
- Traceroute
- Node database
- RAM Node database
- Persistence to Flash
- Ability to specify nodedb size
- Channel database (support encrypting/decrypting other channels)
- Private messages (PKI encryption)
- Support for other Embassy-supported hardware (RP2040, ESP32 primarily, possibly others)
- Support official Meshtastic clients
- Initial connection, partial support
- TODO: add more tasks here
- Serial support
- Bluetooth support
- WiFi support
- Support configuration (preferably without reboots, preferably support Meshtastic client managed config)
- Support multiple concurrent client connections
- Support public connection mode (only access public channels/read-only)
- Built-in Web Client
The project is organized into several crates:
Main embedded application targeting the nRF52840. Contains the Embassy-based async runtime and LoRa radio management.
Mesh network capabilities/integration.
Features:
- AES-CTR encryption compatible with Meshtastic network
- Header parsing and IV generation
- Support for variable key lengths (128/256bit, supporting meshtastic's default key and 1-byte keys, and 128/256bit keys)
no_stdcompatible with optionaldefmtlogging
Protobuf definitions and generated Rust code for Meshtastic messages.
Features:
- Generated from Meshtastic .proto files via git submodule
- Uses
femtopbforno_stdprotobuf support and supportsdefmt
Standalone test utility for validating packet creation and encryption without embedded hardware.
Experimental code and tests (C implementations for comparison/validation).
-
Install Rust with the ARM Cortex-M target:
rustup target add thumbv7em-none-eabi
-
Install probe tools for flashing:
-
Hardware setup:
- Seeed Studio XIAO rp2040 as picoprobe (can use any other probe-rs supported SWD tool)
- connected to SWD pads on nRF52840
- Seeed Studio XIAO nRF52840
- Seeed Studio SX1262 LoRa module
- Seeed Studio XIAO rp2040 as picoprobe (can use any other probe-rs supported SWD tool)
cd nrf
cargo runThis will build the firmware and flash it to your connected nRF52840 device.
Current LoRa configuration (in nrf/src/main.rs):
- Frequency: 906.875 MHz (US Meshtastic default)
- Spreading Factor: 11 (LongFast preset)
- Bandwidth: 250 kHz
- Coding Rate: 4/5
- Sync Word: 0x2B (Meshtastic standard)
Run the standalone packet tests:
cd packet_creation_test
cargo testRun crypto library tests:
cd meshtastic-crypto
cargo testThe repo will likely get restructured to better support multiple hardware devices, though some work has started on this.
For now, you'd probably want to copy the nrf directory and create an equivalent for a different board.
The goal of the project is to be completely compatible with meshtastic firmware. This firmware may, however, add additional features on top of that using meshtastic's extra packet types and/or frequency switching.
This project is licensed under the GPL V3 - see LICENSE for details.
- Meshtastic - The original protocol and ecosystem
- Embassy - Async runtime for embedded Rust
- lora-rs - LoRa PHY implementation
- femtopb - No-std protobuf implementation
- gatlinnewhouse's rust firmware work - for the idea to use femptopb and random other ideas
Note: Meshtastic is a registered trademark of Meshtastic LLC. Meshtassy is not endorsed by or affiliated with Meshtastic/Meshtastic LLC.