Unknown Command: "M140 S0"

I am up and cutting! Now comes the questions. Here is the first one.

I have flashed my SKR Pro v1.2 board with the V1CNC_SkrPro_2209-2.0.7.2-src.zip firmware. Now, after the lowrider finishes cutting a project, I get a M140 S0 error. I am not sure why this is. (I have only tried 2 items, though, but it happens with all.) From what I have seen, this has to do with a 3D printer and not the lowrider.
Is there something I need to adjust in the firmware and reflash the controller to remove this error?
Thanks!

The problem is almost certainly in your software pipeline, not your firmware, and this error has zero impact on your ability to use your machine. It is likely that whatever you are using to send the g-code to the machine is inserting this g-code. Look for any “end” script (scripts that get inserted after the main g-code file is executed) in the g-code sender and edit it to remove the M140.

M140 S0 is attempting to set the print bed temperature to zero. If you don’t have a bed heater I expect it is safe to ignore. I’m guessing this is in an “end gcode” section somewhere and getting added to each job either in your gcode generating tool or your gcode sender, so if you can find where it is being added you should be able to get rid of it once and for all.

For future reference - Marlin GCode Index

1 Like

I’ll try to see what I can find. I’m cutting from a SD Card. The last file I tried to do ended with the following in the g-code:

…
G00 Z0.0000
G01 X33.8129 Y155.0018
G00 Z6.0000
G00 X0.0000 Y0.0000

M05


I’ll try to figure out where else might be adding it. I don’t think its in the g-code. What is the sender that you both mention? I am using a SD card, so I am not sure. For the crown, I did not edit it at all (IIRC). For my last file, I edited the file in ESTLCAM and exported the g-code.

Do a search on the whole g-code file for the M140. If not there, then my best guess is that is that the TFT display firmware is inserting the M140. As a test, you can put your display in Marlin mode and re-run your file (in air if you don’t want to waste stock), and see what happens.

I ran a search and found nothing.

I also tested by putting the display in Marlin mode and ran my file. That worked! I didn’t get the error after the crown test finished (up in the air). I guess I’ll run it in Marlin mode for now on.

On to the next issue…

The “sender” is the program used to stream the gcode commands to the control board. Some examples are Repetier Host, Universal Gcode Sender (UGS), and cnc.js.

Most people who run a MPCNC send their g-code to the control board over either a USB cable or wirelessly (using additional hardware) to the control board. As Tom mentions, there are a variety of programs that do the sending, and we sometimes refer to them as “senders” When you run from an SD card as you do, there is no sender. FYI, running from an SD card is often referred to as “running headless,” just in case you read “headless” somewhere.

If you comfortable running from Marlin mode, then problem solved. If you want to run form the TFT firmware, then the M140 error should not cause you problems, and it is likely that with a bit of poking around you can figure out how to turn off the M140 either with a setting on the TFT or with an edit to the TFT firmware.

For the moment, I’ll just stick with Marlin mode. Tom’s explanation definitely makes sense. For the moment, I’m only using the SD Card. Later on, I may switch over to using OctoPi or a laptop, but that’s farther down the line. I’m still trying to figure out how to set the home and get the correct depths for cutting.

Thanks for your help guys!

The BTT TFT software has a bunch of stuff that it sends to Marlin at the end of job. If you do not want to deal (reprogram) this yourself, you can look for custom TFT firmware on the V1 site.