Development
You can build cncjs in development mode to enable some node.js debugging tools, but there are some tricks you can use to do effective debugging with a production build. If you live and breathe javascript and node.js development, you probably know much better ways to debug, but for us "casual javascripters", the following tips may be helpful.
In the Chrome browser, you can enable Developer Tools to set breakpoints in the cncjs application code, view the console log, etc. Developer Tools is found via the "Customize and Control" button in the upper right corner, under More Tools > Developer tools. The shortcut under Windows is Ctrl-Shift-i.
Most of the many .js and .jsx files that comprise cncjs are bundled into one combined file in dist/cncjs/server/index.js . Instead of changing an individual source file and recompiling, you can edit that index.js directly to make simple test changes like adding "log.info()" printouts or adding/removing a few lines of code. Then just kill and restart the cncjs process to pick up the changes. This is especially useful when you are running the server on a Raspberry Pi, where rebuilding takes forever. You should make a backup copy of the unmodified index.js just in case, since that file is not under source control (or you could check it in to git). The combined code in index.js doesn't look exactly like the source but it is close enough that you can usually figure it out. CNCjs is written using very modern Ecmascript constructs, then "transpiled" (using Babel) into older Javascript so it will run on more systems. The combined index.js is in the older Javascript form. Fortunately, the comments are preserved, which is helpful for finding the right place in the giant file.
Join CNCjs Users Group on Facebook to share your experiences with other people.
Site: https://cnc.js.org
- Introduction
- Installation
- Using Pendants
-
Raspberry Pi Setup Guide
- System Setup & Preparation
- Install Node.js & CNCjs
- Install Node.js via Package Manager (Recommended)
- Install Node.js via Node Version Manager (NVM) (Alternative)
- Install Node.js Manually (Alternative)
- Use PM2 to auto-start CNCjs (Optional)
- Use Port 80 (Optional)
- Maintain
- Additional Setup Options:
- CNCjs UI on Pi - Adventures in PiLand
- Pi with Arduino Due
- Electron App
- User Guide
- Tool Change
- Troubleshooting
-
FAQ
- Forgot your password?
- How can I enable WebGL in my browser?
- Raspberry Pi: Error opening serial port "ttyAMA0"
- Webcam Streaming with Raspberry Pi
- Restream RTSP to M-JPEG
- Connect to an Arduino using WiFi
- Install Native Addons with Node.js v4
- Install Serialport on OS X El Capitan
- Kernel panic issue on macOS Sierra for devices using the CH340G, CH34G or CH34X chipset
- Testing without Arduino board
- Development
- API
- Wiki History
- Resources
- About