Tiny self-contained library for talking to MeshCore companion devices via USB-C.
cmeshcore is a small C99 library implementing the radio usb companion firmware protocol.
Scope
- Useful minimal features such as sending and receiving messages
- Linux only e.g. platform specifics for serial communication
- Serial communication via USB only; no Bluetooth support
- No support guarantees; this is my personal side project
Note: This library requires the "radio usb" companion firmware flashed on the device; the "radio ble" firmware does not support serial communication.
See the example and the library header.
// create a new serial mesh device
cmeshcore_s mesh = cmeshcore_new(port);
// interact with the device via serial
cmeshcore_send_msg_txt(mesh, pk, msg);
// clean up the mesh device
cmeshcore_free(mesh);To compile the library
makeTo install the library
make installThen
- compile your own program against
cmeshcore.h - link your own program against
libcmeshcore.so
The example sends a short text message to a node identified by public key prefix. You can build and run the example
make
./cmeshcore/cmeshcore-cli /dev/serial/by-id/usb-Heltec..To debug the serial communication
strace -e open,read,write,close ./cmeshcore-cli /dev/serial/by-id/usb-Heltec..and keep in mind the frame structure
[0x3c/0x3e] [len_lo] [len_hi] [packet_type] [packet_data ..]Copyright © 2025 Daniel J. Hofmann
Distributed under the MIT License (MIT).