Code Monkey home page Code Monkey logo

cncjs-pendant-numpad's Introduction

cncjs-pendant-numpad

A simple pendant for using cncjs with a num pad (as Wireless/USB Input). The code is based on cncjs-pendant-keyboard

LogiLink Wireless Numpad

LogiLink Wireless Numpad

--

NOTICE: Tested with LogiLink num pad on Linux/Raspbian (Raspberry Pi). (default options are set to LogiLink vendor- and productID, see description below for running with other vendors/products)

--

Installation

Make sure you have installed the following packages

libusb-1.0-0-dev
libudev-dev

These can be installed with apt-get.

After cloning the repository to your work directory, change into this directory and run

npm install

Add device Rules for non-root users

Some additional configurations are needed for making the device working for non-root users.

First create a new file called

/etc/udev/rules.d/50-hid.rules

add the following line as content, which grants access to the hid device for non-root users.

KERNEL=="hidraw*", GROUP="input", MODE="0660"`

Then run the following command for making the changes work ( a reboot will also do this job).

sudo udevadm trigger

Usage

Run bin/cncjs-pendant-numpad to start. Pass --help to cncjs-pendant-numpad for more options.

bin/cncjs-pendant-numpad --help

Hotkeys:

Key Function
NUM LOCK zero out work offset x and y
/ step in 0.1 units
* step in 1.0 units
Back Space step in 10.0 units
7 (HOME) move -X and +Y
8 (UP) move +Y
9 (PG UP) move +X and +Y
4 (LEFT) move -X
5 repeat last action
6 (RIGHT) move +X
1 (END) move -X and -Y
2 (DOWN) move -Y
3 (PG DN) move +X and -Y
0 (INS) unlock ($X GRBL)
. (DEL) probe tool offset
- z axis up
+ z axis down
ENTER home X and Y

Numpad Labels

You can download a SVG file for labels here.

Probe Offset

The probe offset default is set to 1.56 mm ( i am using a piece of PCB with a thickness of 1.56 mm). You can override this by giving the pendant an extra start parameter for probe offset.

--probeoffset <value>

Using with other Num Pad's than LogiLink

Because the keycodes for HID devices are the same for all keyboards, this should also work with other Numpad's than LogiLink. Just find out the vendorID and productID of your device and start the pendant with --vendorid and --productid parameter.

Just run the following command to find out the vendor- and productId of your device

lsusb

The output might look like

Bus 001 Device 004: ID 062a:4101 MosArt Semiconductor Corp. Wireless Keyboard/Mouse

In this example the vendorID is 0x062a and the productID 0x4101. So you you need to start the pendant with the following additional parameters

--vendorid 0x062a --productid 0x4101

cncjs-pendant-numpad's People

Contributors

jekhor avatar mariolukas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cncjs-pendant-numpad's Issues

MSG_INVALID_SECRET

hey i try to run the pendant-numpad but i get the error message: MSG_INVALID_SECRET everytime i start the pendant. what am i doing wrong? fyi. my config file is not on the default place: ".cncrc" i have it at a different place. maybe someone can help me?
thanks in advnaced
kind regards
matthias

Error: ENOENT

Hello, I get the following error message at startup:

pi@mpcncpi:~/cncjs-pendant-numpad $ bin/cncjs-pendant-numpad
? Specify which port you want to use? /dev/ttyACM0
{ Error: ENOENT: no such file or directory, open '/home/pi/.cncjs/cncrc.cfg'
    at Object.openSync (fs.js:443:3)
    at Object.readFileSync (fs.js:343:35)
    at module.exports (/home/pi/cncjs-pendant-numpad/index.js:47:42)
    at createServer (/home/pi/cncjs-pendant-numpad/bin/cncjs-pendant-numpad:91:5)
    at /home/pi/cncjs-pendant-numpad/bin/cncjs-pendant-numpad:334:13
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/home/pi/.cncjs/cncrc.cfg' }

Any idea?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.