linuxcnc-grpc
gRPC interface for LinuxCNC machine control and HAL (Hardware Abstraction Layer).
Why gRPC?
LinuxCNC's native Python API only works locally. This project exposes it over gRPC, enabling:
- Remote monitoring - Build web dashboards, mobile apps, or desktop GUIs
- Multi-machine management - Monitor a fleet of CNC machines from one place
- Any-language integration - Use Go, Node.js, Rust, or any gRPC-supported language
- Real-time streaming - Subscribe to status updates instead of polling
Installation
Add to Cargo.toml:
[]
= "1.0"
= { = "1", = ["full"] }
= "0.12"
use LinuxCncServiceClient;
use GetStatusRequest;
let mut client = connect.await?;
let status = client.get_status.await?.into_inner;
println!;
Examples
See the examples directory for complete Rust examples:
get_status— Poll machine statusstream_status— Real-time status streamingjog_axis— Jog axes with keyboardmdi_command— Execute G-code via MDIhal_query— Query HAL pins/signalsupload_file— Upload, list, delete G-code files
Services
- LinuxCNCService — Machine control: status, jogging, MDI, program execution, file management
- HalService — HAL introspection: query pins, signals, parameters (read-only)
Documentation
See the full documentation for server setup, API reference, and tutorials.
Safety Warning
This package communicates with a gRPC server that controls real CNC machinery. Ensure proper safety measures:
- Use only on trusted networks
- Implement authentication in production (gRPC supports TLS/mTLS)
- Never leave machines unattended during remote operation
- Verify E-stop and safety systems are functional