Skip to content

Billiam/cncjs-pendant-streamdeck

Repository files navigation

cncjs-pendant-streamdeck

A ridiculously configurable mobile web and Elgato Stream Deck pendant for CNCjs + Grbl

Sponsor

Web view with a 3 x 5 grid layout of buttons for jogging cnc

Stream Deck device with buttons configured for CNC usage

The web version acts as a prototype for the Stream Deck, and powerful and useful pendant as a side effect.

All configuration takes place in config.json. An example, mostly matching my own interface, is included to get started.

You can use your own images, or those included with the pendant, courtesy czottmann's system-uicons and fluent system icons and a handful from Font Awesome.

Features

  • Works with or without a Stream Deck, either as CLI process or web pendant
  • Linux-friendly, does not use default Stream Deck software
  • Unlimited pages
  • Arbitrary grid dimensions for web version
  • Excessively customizable
  • Execute one or more actions on press, release, and/or button hold
  • Support up to 6 axes
  • Multi axis smooth jogging
  • Templated text for
  • Lots of included icons, or add your own
  • Display and animate gcode
  • Run macros
  • Run cncjs custom commands (ex: to restart the system or update packages)
  • Manage alarms, hold, and pause events (like macro-triggered tool changes)
  • Custom configuration is well documented
  • Configuration validator
  • Full GUI config editor

Compatibility

This has been tested with Grbl 1.1h, CNCjs 1.9.26 and Node 14.20.0+

Documentation

Full documentation can be found at https://billiam.github.io/cncjs-pendant-streamdeck

Installation

Web

  1. Download the latest release and extract it, to ex: /home/my-name/cncjs-pendant-streamdeck
  2. Rename config.example.json to config.json
  3. Update the config.json file with your connection information in the cncjs section.
  4. Edit your ~/.cncrc file, adding a mount point for this pendant
    "mountPoints": [
      {
        "route": "grid",
        "target": "/home/pi/cncjs-pendant-streamdeck"
      }
    ]
    
  5. Restart CNCjs

Stream Deck

Follow Web steps above to generate create a configuration directory, config.json file, and button images. You can skip the cncrc step if you do not need the web interface.

Linux

Instructions borrowed from https://github.com/julusian/node-elgato-stream-deck

On linux, the udev subsystem blocks access to the StreamDeck without some special configuration. Save the following to /etc/udev/rules.d/50-elgato.rules and reload the rules with sudo udevadm control --reload-rules

SUBSYSTEM=="input", GROUP="input", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0060", MODE:="666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0063", MODE:="666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="006c", MODE:="666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="006d", MODE:="666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0080", MODE:="666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0086", MODE:="666", GROUP="plugdev"
KERNEL=="hidraw*", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0060", MODE:="666", GROUP="plugdev"
KERNEL=="hidraw*", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0063", MODE:="666", GROUP="plugdev"
KERNEL=="hidraw*", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="006c", MODE:="666", GROUP="plugdev"
KERNEL=="hidraw*", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="006d", MODE:="666", GROUP="plugdev"
KERNEL=="hidraw*", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0080", MODE:="666", GROUP="plugdev"
KERNEL=="hidraw*", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0086", MODE:="666", GROUP="plugdev"

Unplug, and replug the device after reloading rules if necessary.

Install Stream Deck and canvas dependencies:

apt-get install libusb-1.0-0-dev libudev-dev libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev

Install optional node dependencies:

npm install -g canvas @julusian/jpeg-turbo

Install the application:

npm install -g cncjs-pendant-streamdeck

Run the pendant

cncjs-pendant-streamdeck --directory /home/my-name/cncjs-pendant-streamdeck

Editor

Editor interface showing a "page" of buttons with a sidebar containing button configuration options

After installing the web version, visit /grid/editor.html in your browser to load the configuration editor.

Update your connection information first, which can be done from the settings gear in the upper right corner, since this will allow you to see the cncjs state as normal from the editor.

General interface settings, like the color palette used and CNC settings can be changed in the same settings popup.

Afterward, you can add or remove scenes in the scene list, edit or add new buttons, and change their behavior.

Limitations

  • The editor does not know about your own custom icons, so they will not appear in the icon selector
  • To save your changes, you must download the new configuration using the save icon in the upper right corner of the screen, and replace your existing configuration with this one on your cncjs device. You'll need to reload the pendant page or restart the pendant service (for Stream Deck) to see your changes.
  • The layout of the file list view, which uses cncjs's watch folders, cannot be edited. You can change the appearance of the buttons used in this view from the fileList scene in the scenes list.

Licenses and credits

Several icon sets have been added for convenience