Cheton Wu edited this page Dec 26, 2017 · 5 revisions


CNCjs is a full-featured web-based interface for CNC controllers running Grbl, Marlin, Smoothieware, or TinyG. Such CNC controllers are often implemented with a tiny embedded computer such as an Arduino with added hardware for controlling stepper motors, spindles, lasers, 3D printing extruders, and the like. The GCode commands that tell the CNC controller what to do are fed to it from a serial port.

CNCjs consists of a server component and a user interface component. The server talks to the CNC controller over a serial connection using a USB serial port, a Bluetooth serial module, or a Serial-to-WiFi module like XBee or USR-WIFI232-T. The server component behaves like a web server, so it can be controlled from a web browser such as Chrome. The server component can run on a small computer like a Raspberry Pi or on a desktop or laptop computer like a PC or Mac. The computer that runs the server may have a graphics display, but does not require one. The server is written in the JavaScript programming language, using the Node.js framework.

The CNCjs user interface consists of a collection of JavaScript code that runs inside a web browser. It lets the user set up and control the CNC machine, doing things like jogging, setting machine positions, and controlling the execution of GCode programs. That web browser can run on the same computer that is running the server component, or it can run on any computer - or portable device like a smartphone or tablet - that can reach the server computer over a network. Multiple instances of the user interface can run at the same time, perhaps on different computers, all talking to the same server.

The JavaScript code that implements the user interface is usually stored on the server computer, "served up" to a browser or browsers running on the same or different computers. This lets CNCjs work on an isolated network that is not connected to the Internet. Optionally, portions of the user interface code can be stored out on the Internet, but that is not required.

The user interface is organized as a collection of "widgets", each of which manages a specific aspect of machine control. For example, there are widgets for things like toolpath display, jogging, position reporting, spindle control, and many other functions. Users can control which widgets appear on the screen, omitting ones that do not apply to their machine. There is a way to add custom widgets to support new features.

There is a CNCjs "desktop app" which appears to be a single "all in one" program. The desktop app is based on the same server + web-browser design, but the server and a browser are bundled together into a single executable image to make it easy to run both of those components on the same computer. There are versions of the desktop app for Windows, Mac, and (x86) Linux.

Finally, there is a collection of "pendants" - specialized user interfaces optimized for simplified control panels such as small LCD screens, wireless keyboards, button panels, and the like. Pendants interact with the cncjs server using subsets of the full set of functions that the main user interface uses.

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.