Hi @Ambro,
@neilferreri knows me too well, I couldn’t resist looking into it since I did not know about a CNCjs extension for autoleveling like bCNC has.
The only one I found is this one, is this what you are trying to install ?
I had a go at installing it, it’s in fact a CNCjs extension that works like a CNCjs pendant: it’s a separate piece of software that you have to run once CNCjs is already executing, it will connect to the CNCjs application and react to the a specific “autolevel” keyword.
The installation depends on which OS you are using, I tried on Windows10. I’m afraid it’s a little involved (but doable):
- install “git”
- install “node.js” (which should also install “npm”)
- open a console window (search box, type “cmd”, a black text mode window appears)
- download the code for the autolevel extension by typing “git clone GitHub - kreso-t/cncjs-kt-ext: Auto-leveling extension for CNCjs”
- it will have created a directory “cncjs-kt-ext”, enter it (cd cncjs-kt-ext) and install the extension by typing “npm install”
- now you need to figure out which network port CNCjs runs on. If you are using a CNCjs “server” install, it is most likely 8000. If you are running the CNCjs standalone application, you will need to go to “View” menu, “View in browser”, this will open another CNCjs interface in your browser, and the port number will be displayed at the end of the URL (in my case it showed “127.0.0.1:61678/#/workspace”, so the port is 61678. It changes everytime you relaunch the CNCjs app unfortunately.
- launch the Autolevel extension, still from the command line, by typing “node .” from inside the cncjs-kt-ext directory. It should print something like
Connected to ws://localhost:61678?token=[a very long string of characters]
Connected to port “COM16” (Baud rate: 115200)
Almost there, now you need to create a macro in CNCjs (clicking the “+” in the Macro widget), name it “autolevel”, and paste exactly this piece of text:
(#autolevel)
And then your are done with the install. To use the feature,
- you will need to have a probing device attached to the Shapeoko controller’s PROBE input
- if the probing device is mechanical (e.g. a push switch), you can proceed.
- if the probing device works by detecting electrical contact, you need make sure the surface of the piece you want to probe conductive, for e.g. a PCB it is already, for other material the usual trick is to wrap aluminium foil on the top surface
- You then set your job zero on the piece as usual (the autolevel macro expects that it is the lower left corner of the job though), leave the cutter at 0,0,0, and run the autolevel macro from CNCjs
I have not actually run the macro on a real example, I tested all of this on a simulated Shapeoko to make sure the extension is sending the G-code commands when prompted, but if anyone is interested, I can certainly try it “for real”.