cncjs / cncjs-pendant-keyboard

A simple pendant (using wireless keyboard or usb) to CNCJS
MIT License
23 stars 24 forks source link

Doesn't install due to old/unmanaged dependencies #10

Open karoria opened 4 years ago

karoria commented 4 years ago

@nsfilho I have no luck installing this pendant keyboard due to old versions referenced. Any workaround? I am running cncjs with raspberry pi4. The main interface and shopfloor tablet runs well on it. Waiting eagerly for help.

nsfilho commented 4 years ago

@karoria can you send me the steps you used to install? Are you have any logs or errors?

I'm asking that because recently I maid some updates on this project and apparently is functional.

karoria commented 4 years ago

@nsfilho Thanks for quick response. I will try to send the installation log tomorrow. Now I can safely hope that the issue will be resolved soon. Btw, I have tried to install the same way mentioned in readme/wiki.

karoria commented 4 years ago

Hey @nsfilho. Sorry for delay. Find here attached log file generated by failed "npm install" procedure as per wiki. 2020-02-28T12_30_25_302Z-debug.log

mbilsky commented 4 years ago

I managed to get it to work, but it took a lot of trial and error (raspberry pi 3B running raspberry pi OS buster).

Needed to install g++-4.8 using these instructions to be able to build hid directly: https://www.raspberrypi.org/forums/viewtopic.php?t=107558

Then had issues with finding a binding file.

Manually installed serialport: sudo npm install serialport --unsafe-perm --build-from-source

Then got to modifying the code. my attached file is the version of index.js and cncjs-pendant-keyboard.

index.zip

They include modifying how the serial port is accessed: https://github.com/serialport/node-serialport/issues/1977

and changes in index.js so it can be run as sudo (changed the path of where the .cncrc file is found).

Note: I changed the default port to 8080 since that's what my server is running.

I can then run the script sucessfully as sudo: pi@3018cnc:~/cncjs-pendant-keyboard $ bin/cncjs-pendant-keyboard -p /dev/ttyUSB0

I also had to modify the product and vendor id's to match the keyboard I'm using from the default ones. I found these out by uncommenting the console.log for the HID info and copying the details over.

I did a lot of steps, going through the various errors, but these are the major ones that should help.

getting the HID library built and installed along with serial port can be tricky but there are lots of different methods (I think I ended up with the -g flag on some for global).

TL:DR... Got it working today on a PI 3!

a-oneil commented 3 years ago

@mbilsky Is there anyway you share your build? I attempted to follow along with the above steps but still getting build errors. :/

mbilsky commented 3 years ago

@mbilsky Is there anyway you share your build? I attempted to follow along with the above steps but still getting build errors. :/

I'm not sure of an easy way to do that?? If you send me specific directions I'm happy to try it out

a-oneil commented 3 years ago

@mbilsky Is there anyway you share your build? I attempted to follow along with the above steps but still getting build errors. :/

I'm not sure of an easy way to do that?? If you send me specific directions I'm happy to try it out

I actually got the program to build properly. Unfortunately, I couldn't get the machine to jog with the keyboard attached to the Pi. Need to play with it a bit more this weekend.