The magical language that runs most 3D Printers and other CNC machines are called g-code. G-Code is a language that describes positioning and actions to be taken by many types of CNC machinery. In lower-end machines and in earlier 3d printers, the machine was unable to hold and process these instructions on its own and needed a computer to complete that work. Thus we have the G-Code sender and a modern incarnation CNCjs.
The g-code sender speaks to the CNC machine over a USB/Serial connection. It communicates motion and actions while negotiating how much data to send and when to send it.
CNCjs is a web based G-Code sender. It can run on a variety of computers including the Raspberry-Pi. This article will be installing the CNCjs onto a Linux Mint machine. It will be focused on installing the software for use from a web page and with a degree of permanance.
Try it out First
If you want to try the software out before doing a full installation you can use the AppImage. This is a self-contained bundle of all the software and dependencies needed to run the title. You can download the AppImage, use it from the list below.
Pre-paring your machine
The only listed requirement is nodejs version 4 or higher, and npm if you are not installing from git
For nodejs, you can check which versions are available on your repository by typeing
apt-cache show nodejs | grep Version
If the versions shown are greater than 4 you are good to install by typing:
sudo apt install nodejs
If you think it is already installed just type:
nodejs --version
For npm you can do the sam process
apt-cache show npm | grep Version sudo apt install npm npm --version
Obtain the Software
If you would like to run the software on your desktop like a piece of regular software ( not web-based ) there is a version that treats the entire cncjs web service as a desktop App. It uses something called Electron, and is avaiable in Windows, Mac and Linux
https://github.com/cncjs/cncjs/wiki/Electron-App
Then pick the download in the “Asset” list. There are debs for Debian Linux, rpms for Redhat based, Windows exe, and Mac dmg
For the AppImage you can use the linux-x86_64.AppImage
For running on a server:
The easiest way to install this software is via npm
Use the following command
npm install -gcncjs@latest
The comand will retrieve the software and isntall it
To run the software use:
cnc
Then visit
http://127.0.0.1:8000/
It’s that simple!