-
-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Max Litruv Boonzaayer edited this page Feb 15, 2026
·
3 revisions
A comprehensive C# library for communicating with MeshCore companion radios via serial port.
MeshCS provides a high-level, async-friendly API for interacting with MeshCore LoRa mesh networking devices. It handles all the low-level details including COBS framing, packet building/parsing, and event dispatching.
-
High-level async API - Simple
MeshRadioclass for most use cases - Event-driven messaging - Subscribe to events for incoming messages, adverts, and errors
- Auto-discovery - Scan serial ports to find connected devices
- Full protocol support - All MeshCore companion commands implemented
- Low-level access - Direct packet building/parsing for advanced use
- Getting Started - Installation and first steps
- API Reference - Complete API documentation
- MeshRadio Class - Main radio interface
- Events - Event system documentation
- Examples - Code samples
- .NET 8.0 or later
- MeshCore companion radio (T-Beam, T-Echo, etc.)
- Serial/USB connection to the device
dotnet add package MeshCSusing MeshCS;
// Auto-discover and connect to the first available device
var radio = await MeshRadio.ConnectFirstAsync(verbose: true);
if (radio == null)
{
Console.WriteLine("No MeshCore device found");
return;
}
// Subscribe to incoming messages
radio.DirectMessageReceived += (msg) =>
{
Console.WriteLine($"[{msg.SenderPrefixHex}]: {msg.Text}");
};
// Send a message
var contacts = await radio.GetContactsAsync();
if (contacts.Count > 0)
{
await radio.SendMessageAsync(contacts[0].PublicKey[..6], "Hello!");
}
// Keep running to receive messages
await Task.Delay(Timeout.Infinite);┌─────────────────────────────────────────────────┐
│ Your Application │
├─────────────────────────────────────────────────┤
│ MeshRadio │
│ (High-level async API, events, auto-discovery) │
├─────────────────────────────────────────────────┤
│ PacketBuilder PacketParser │
│ (Build command packets) (Parse responses) │
├─────────────────────────────────────────────────┤
│ COBS Framing Layer │
├─────────────────────────────────────────────────┤
│ Serial Port (USB) │
├─────────────────────────────────────────────────┤
│ MeshCore Companion Radio │
└─────────────────────────────────────────────────┘
MIT License - see LICENSE
MeshCS © 2026 Litruv | MIT License
MeshCS Documentation
Classes
Models
Enums
Links