Home

Awesome

CNC server

<img src="https://github.com/techninja/cncserver/blob/v3/src/interface/icon.png?raw=true" style="float: right">

A Node.js based RESTful API to serial interface control for plotters, originally created for the WaterColorBot, currently aimed at EBB controller based plotters from Evil Mad Scientist Laboratories like Axidraw, Eggbot, and other DIY implementations.

The purpose of the project is to abstract the nitty-gritty details for controlling a drawing robot, and utilizing proven web technologies, to simplify the interface and make drawing bots easier and more useful, either at your desk with a GUI, or via your own script running remotely.

Features

CNC Server is an application that sits on a computer connected to your serial based CNC peripheral and provides a simple RESTful API to access common CNC/plotter functions. These controls manifest as an abstracted method of controlling the bot to do what you ask while sanity checking and keeping crashes down to a minimum.

Installation

Install Node.js

Unless you already have it installed, either download the installer for your operating system, or use node version manager. We recommend using at least version 18+, although lower versions may work.

CNC server files

Installing NPM Dependencies

With your system setup and everything else installed, open a terminal and make your way to the cncserver folder, and enter npm install (you may need to preface that with a sudo command on Mac/Linux). For Mac, building node-serialport requires make, which comes with Xcode, a free download.

Running

CNC Server currently only supports the late model EBB and its command set. Of the devices that use it, the WaterColorBot, the EggBot, and AxiDraw have reliable support. More devices to come soon!

Plug in your device, and from the terminal in the cncserver repository root folder, start the server with the command npm start, and you've got it!

Once the server is up and running, the API should now be available at http://localhost:4242. The 4242 is the port on the local computer, which you can easily change in the configuration shown below.

Configuration

By default, CNC Server hosts the API on the localhost port 4242 and attempts to autodetect the correct serial port to connect to for the given bot configuration. If you want to tweak these settings or any other global configuration permanently, just edit the config.ini file that is generated on first run and stored in the same folder as cncserver.js. If you want to make temporary config adjustments, just pass the same config names and values when executing. Common examples might include:

# Change the hosting port to HTTP default, and force the serial port (no equals)
node cncserver --httpPort 80 --serialPath /dev/ttyUSB1243

# Change bot type to EggBot, and invert the X motor axis (with equals)
node cncserver --botType=eggbot --invertAxis:x=true

Problems?

Stuck on something? Submit an issue! Click the issues tab and see if someone is covering your question or problem, if not, ask away! Someone will be around to help soon.

Know how to fix a problem? Or want to add a new feature?? Submit a pull request! Just fork the repo using the button on the cncserver github homepage, and this will give you your own version of cncserver. Make your change in a few commits to your branch, then click the pull request button at the top! Talk about what changes you made and submit. A maintainer of the project will check your work, possibly ask you to fix a few more things, and then if all is well, your work will be merged into the project!

ETC.

All code MIT licensed. Created by TechNinja, with support and collaboration from Evil Mad Scientist.