How do I use the Pi header pins within CNC.js

Hey guys, I have a relay board that I am currently using to turn my shop vac off and on with the generated g-code and I was thinking it would be cool to have a macro within CNC.js that I could use to control a separate relay on my relay board that will turn the CNC control board off when not in use. I’ve done some searching to see if that functionality is already built into the CNC.js but haven’t found it if it is. I don’t really know how best to search for the information I’m wanting either. Pic of my CNC for attention :crazy_face:

3 Likes

You can run system commands, I think. If you can then you can run a script to change some gpio pins. Someone very smart and good looking wrote a guide a while ago on thingiverse:

I looked through your document and that all seems really state forward but you added the scripts to octoprint, I’m hoping to add some controls to cncjs I think I’m I should be looking more at the “Commands” section of CNCjs but figured I’d ask if anyone else has done anything with the commands.

Start by making the scripts and making them work. Then just try putting the scripts in the commands. I am 90% sure they are either system or gcodes.