MPCNC and cnc.js

I have read some interesting threads on here about integrating the mpcnc with a raspberry pi to give a better ‘headless’ environment.

Im just setting up my MPCNC

Its a home put together thing - rather than a kit from here, all the parts printed from here, and not using the dual end-stops (when I printed the parts over last summer this wasnt available).

Im using an Arduino Mega 2650 and Ramps 1.4 with the latest non dual end stop marlin firmware from here.

I can move the spindle using the LCD screen, and moves as expected. I can also move it with a direct connection from my laptop to the ramps via usb with repetier host.


Where I am running into trouble is getting the mpcnc actually moving using the axes controls on cnc.js

I’ve installed mpcnc as per the guide on here and followed the cnc.js instructions also, it runs at boot on my raspberry pi ,and I can connect to the web interface without issues.

I select Marlin, and the baud rate of 250000 (this is what my RAMPS is set to) and it seems to connect ok in terms of the output from the console. If I insert an SD card then I get an appropriate response in the console, and if I ‘reset’ then the mpcnc display states that it has been halted and needs to be reset, so I seem to have 2 way communication.


Where I am struggling, is that if I try and move using the axes, I click on the direction of movement and get absolutely no response. I want to check this side of things first before I load a gcode file and am getting no-where…


Im pretty sure it will be something stupid and simple, but any pointers would be very welcome, I cant see anything obvious in the documentation.


Thanks in advance


Hey James. I was having issues before and I completely forgot how I first got it to move but if I remember correctly mine went like this:

I purchased a RAMBO from Ryan and I believe it came with the latest firmware a few months ago which was the dual endstop version. I then swapped it out for the normal version but realized that I had the 5/16" threaded rod so I had to change it again. Then I got the 8mm rod and ran it without the dual endstops.

But what i noticed is that it will load (I don’t use a SD card) so it would go all the all way and say SD card failed. Once I saw it was initialized I went into the terminal and gave it a command like G92 and once that was done I was able to job and use the CNC like normal.


Let me know how that goes and if that helps.

1 Like

Yea, there’s an issue with cnc.js. If you issue a move in the terminal, it will work from then until you reboot something. I just throw it a G0 X100 F2000 , let it move, then re-home, if you have limit switches, otherwise then move it to your work zero and re-zero.

1 Like

Looks like the next step is to learn some CNC commands then!

As both of you found, if you give it an instruction in the console, then the GUI ‘jog’ buttons subsequently work. I wonder if the software locks the machine or something and the unlock doesnt work.

I ‘accidentally’ typed ls into the console (I typed it thinking I was in a terminal window, saw it, and thought what the hell, and hit enter). Oddly ls as a command made it do some interesting series of movements - but it did move, confirming that I have 2 way communication and that the marlin is accepting commands from cnc.js when they are actually sent :slight_smile:

I wonder if there is a way to send a command that doesnt actually do anything at the end of the handshake between the two devices, that way automatically initialising it?..

Thanks for your help - I think im going to go the way of printing out the dual endstops, as not having my nice shiny new mpcnc try and destroy itself would be useful, presumably once this is done I will be able to auto home.

1 Like

I would hope that they resolve that sometime soon as I really like the CNC.js interface.


One thing you could give it is a M119 which checks for the status of the end-stops. Its just a generic code and doesn’t tell the machine to move at all. That will allow you to establish comms with your machine and then you can operate as normal.


The movements were probably stored in the buffer. Mine did that before I figured out how to unlock it.

I also noticed the same issue. You don’t even have to move anything in the console. I issued a M119 and the buttons started working.

I know this is a turbo Noob question but how do I Zero the machine where I have placed it?

I just installed the new image and its works great Thanks " jeffeb3 " I made macros for the G92 to address the issue with ignoring commands and an M18 command to disable the steppers so the machine can be moved around.


Thanks again =)

G92 X0 Y0 Z0 should work, but the motors need to be on (AFAIK) and there are several version of Marlin that had this broken. If that doesn’t work, resetting Marlin will.

I am using the RAMBo v1.4 Board from the V1 store will that version of Marlin work?

Yes, as far as I know. I tried it on a few boards and don’t remember needing anything special.

ok so I created Buttons for sending the G92 command to enable movement, Zeroing the machine and Disabling the steppers so it can me moved by hand. I included them below so others can do the same.




Oh nice, I really have to use this some more. That looks pretty dang easy to do custom buttons.

1 Like