Xstatic
Networks by the people for the people, software for mankind
A native Meshtastic client for X11.
Written in C. Runs on FreeBSD, Linux and macOS.
What is it?
Meshtastic is an open-source LoRa mesh networking platform: small radios that talk to each other without any infrastructure. Xstatic is a desktop client for it: plug a node into your computer over USB serial and talk to the mesh from your own machine. A native X11 interface is on the way.
Why?
- Native. No browser, no Electron, no runtime. Just C and Xlib.
- Small. A handful of source files you can read in an afternoon.
- Portable. Developed on FreeBSD first, with Linux and macOS as first-class targets.
- Layered. Serial access, protocol, mesh state and UI are separate modules with strict one-way dependencies.
Why C?
Because C is where it all comes from. Unix was written in it, the BSD kernel is written in it, and X11 speaks it natively. It is my favourite language: no runtime, no garbage collector, no hidden magic between you and the machine. Every byte that comes off the serial port is a byte you can point at.
Parsing a binary protocol with a hand-rolled state machine, one
0x94 at a time, is exactly the kind of job C was made
for. It compiles in a blink with plain cc, runs on a
Raspberry Pi 3, and will still build in twenty years. No dependency
hell, no toolchain of the month. Just you, the compiler and the radio.
Supported OS
- FreeBSD: primary development platform (serial via
/dev/cuaU0). - Linux: supported target (serial via
/dev/ttyACM0). - macOS: supported via XQuartz (serial via
/dev/cu.usbmodem*).
Any Unix-like system with X11 and a POSIX serial port should be within
reach: only the small platform/ layer is OS-specific.
Features
Messaging
- Send text messages to any node, by long name or by node number
- Live display of incoming text messages, with the channel they arrived on
- Message history with a numeric ID per message
- Reply to a specific past message by ID: the answer goes to the original sender as a direct message, even when the original was a broadcast
- Encrypted packets you cannot read are flagged as such
- Empty messages are caught and cancelled before they hit the air
Mesh and channels
- Live list of every known node: name, node number, hardware model in plain English, GPS position
- Position data is never clobbered by a less complete view of the mesh
- Environment telemetry display: temperature, pressure and humidity
- Channel list: index, name, role (primary, secondary) and encryption state (none, default key, custom key)
- Correct per-message channel resolution, so replies stay on the right channel
- Encryption keys are read in memory only, never displayed or logged
Device configuration
- Read the configuration of the connected device: role, LoRa region, modem preset, TX power, hop limit
- Extended view of the position, power, network, display, Bluetooth, security and session key settings
- Firmware version, hardware model and role reported at startup
- Device events surfaced as they happen: reboots and send queue status
Under the hood
- Streaming frame parser, robust against split and interleaved reads, even with debug logs mixed into the binary stream
- Full protobuf encode and decode via nanopb, generated from the official Meshtastic definitions
- One
select()event loop merging the serial port and your keyboard - Serial device auto-detection
- Strict compiler flags (
-Wall -Wextra -Wpedantic), plainmake, no autotools - Two binaries: the interactive client and a low-level debug dump tool
Commands
list known nodes, with position and hardware send send a message (asks for node name or number, then text) history received messages, numbered reply <id> answer a specific message channels list configured channels and their encryption show config role, region, modem preset, power, hops show all config full configuration summary and firmware info help command list quit disconnect and exit
Roadmap
- Native Xlib graphical interface, on top of the same core
- Live GPS position of your own node
- Module configuration (MQTT, serial, store and forward, canned messages)
- Changing device configuration from the client
- Sent messages in the history
Status
Current release: v0.2, an interactive terminal client. The graphical X11 interface is the next big milestone. Xstatic is young and moving fast. Issues, ideas and pull requests are welcome on GitHub.
src/platform/ serial access, per-OS src/protocol/ framing + protobuf decoding src/core/ mesh state, channels, message history, device config src/ui/ terminal display (Xlib interface planned)
Get it
git clone https://github.com/Creep29257/Xstatic.git
Contributions, bug reports and ideas are welcome on GitHub.
