mudRPC, gRPC for unstable networks

gRPC for drones

gRPC for drones is a .proto of the vehicle’s services, Arm, Telemetry, Upload, with calls, streams, deadlines and status codes, running between the drone and the ground and between drones, over the radio they have, with no connection to keep.

A drone’s link is the hard case for RPC: it goes out of range and comes back, a relay drone carries messages across a gap, a command sent during the gap must either arrive when the link returns or be known dead, and a reply must never be mistaken for another call’s. gRPC’s connection model answers none of that; mudRPC’s message model answers all of it. A call carries a ttl, the longest it is worth delivering: a Land with a ttl of ten seconds that misses its window is reported expired at the ground station, a Telemetry request with a ttl of an hour is answered after the gap heals, and every reply is matched to its call by a nonce no two calls share. The standard scenario partition-heal is exactly this, two peers cut apart and healed at thirty seconds, and the six harnesses play it to the same log.

Security is per device, not per link. Every wire is sealed under the fleet key, AES-256-GCM by default, and a signed fleet proves each sender with its own Ed25519 key, so a ground station knows which drone spoke and a drone takes commands only from the roster it holds; a cloned or re-flashed unit announces itself as a rollback, a replay is dropped however late, and a flood from one sender is named and rate-limited without starving the others. Each is a test in SPEC.md’s first layer, run on every push.

The ground station is a product in any language, Python for a notebook, .NET for a Windows console, Java or Kotlin on Android, JavaScript for a dashboard; the drone is C on a flight controller, C++, Rust or Swift. The same .proto and the generated code serve both; the channel line is the only change, in From gRPC. Between vehicles the transport is gRPC over LoRa and mesh radio; on a Wi-Fi link it is gRPC over UDP. The simulator is where the mission is rehearsed before a motor turns, and demos/drones is this page’s program in every language: a ground station and a mock drone over UDP, armed, streaming telemetry and landing.

This page belongs to gRPC without HTTP/2; the home page has the five-minute start.