FAQ
Is it safe on a network?
Not on its own. The server has no authentication and no TLS, so anyone who can reach the port
can jog the machine, run a program, and upload or delete files. Bind it to 127.0.0.1 and
connect through an SSH tunnel, or use it only on a trusted, isolated LAN. Without --host the
server listens on all interfaces, so pass --host every time. See
Security considerations.
Does LinuxCNC have to be running?
No. The server starts without LinuxCNC and connects within a few seconds of LinuxCNC coming up.
While it waits, the RPCs that need LinuxCNC fail with UNAVAILABLE and the reason
not-connected, and health is NOT_SERVING for the LinuxCNC service. Uploading, listing,
reading and deleting files, GetServerInfo and the HAL service work. Pass --require-linuxcnc
to make the server exit instead. See
Starting before LinuxCNC.
Is it real-time?
No. It is not a motion controller. A status stream is sampled at an interval, 100 ms by default, and a command goes into LinuxCNC’s one command queue, behind every message already written there. A stop sent through the server is no substitute for the machine’s physical E-stop. See StreamStatus and What the server cannot do.
Can two clients send commands at once?
Yes. The API has no call that reserves the machine for one client. The server sends one command
at a time, and a stop from any client goes ahead of the commands still waiting, which are then
refused with RCS_ERROR (see Stops go first). Two things follow for each client:
- A
WaitCompleteanswersRCS_DONEas soon as LinuxCNC has taken a later command, also another client’s. Confirm the result from a fresh status (see WaitComplete). - The machine’s GUI and any pendant write to the same LinuxCNC queue, and the server does not order their commands.
Can my client show LinuxCNC’s error messages?
Only where no GUI shows them. LinuxCNC hands each message to one reader, so on a machine whose
GUI shows errors, a client that reads them takes them away from the operator. Between the
server’s own clients the messages are shared: every StreamErrors subscriber receives every
message the server reads. See Error messages and the GUI.
Which languages and platforms do clients run on?
Client packages exist for Python, Go, Node.js/TypeScript and Rust (see Install a client). Any other gRPC language can generate a client from the proto files. The clients are plain gRPC and are not tied to Linux, but they are not tested on Windows or macOS. The server runs only on Linux, on the LinuxCNC machine.
Does it change modes for me?
No. The server never switches the task mode or teleop. It passes every command to LinuxCNC as it is, and LinuxCNC refuses a command sent in the wrong mode. Send the mode command yourself and wait until the status shows it. See Modes and teleop: what to send first.
What happens if LinuxCNC restarts?
Usually the server stops, and something has to start it again.
- A normal LinuxCNC shutdown stops the server with exit status 0. Start it from a HAL file, so
that it starts with LinuxCNC, or under systemd with
Restart=always(see Auto-start). - A server that finds its LinuxCNC gone does not reconnect. Clients get
UNAVAILABLEwith the reasonlinuxcnc-gone, and the server exits with status 1. - A crashed LinuxCNC is often not detected: the server keeps returning the last status until LinuxCNC starts again, which normally stops it.
- A status RPC can reconnect to a restarted LinuxCNC before the server notices the restart.
Its statuses then carry a new
connection_id(see Reconnection).
After a restart, LinuxCNC’s serials and the error sequence numbers start again from 1, so
compare them only within one connection_id. See
When LinuxCNC stops and
Telling servers and connections apart.
Which LinuxCNC versions are supported?
LinuxCNC 2.9 or newer is required. On 2.8 and older the server exits at start with status 1 and
a log message that says so. GetServerInfo reports the version of the LinuxCNC it runs with.
See Requirements.