Snapmaker job fails after one cut on M8, M9 unknown command errors

Hi all -

First time poster - really impressed with LightBurn so far! I played around with it yesterday and ran into an issue cutting more than one layer in a single job.

I followed @Voidoids’ excellent setup guide, got it communicating just fine, and was able to send cuts to the machine.

I was doing a laser power test on a new material and after it did the fill cut one one layer and started the line, it stopped moving, and the laser remained on. I looked in the console, and saw “M8 unknown command”.

I looked that up and learned that M7, M8, M9 are about cooling, so I thought maybe if I turned off Air Assist, it wouldn’t insert those, but then I started getting M9 unknown command errors.

Is there any way to keep it from inserting M7, M8, M9 commands for the SM2 machine?

Heck, while we’re at it, any fellow Snapmaker owners want to take up a collection to get @LightBurn Oz a SM to test on? :wink:

Source File: LaserPctTest.lbrn (33.4 KB)

Edit: After looking at the code, in SnapMaker profile mode it should not be using the M8 / M9 commands already, and instead using M106 P0 255 to turn it on, and M107 to turn it off. Do you have the SnapMaker profile chosen, or did you just configure a Marlin device?

Hi Oz -

No, I used the Snapmaker profile, but I did choose Create Manually in the Devices dialog:

I tried “Find My Laser” but it didn’t work. (I assume that’s because you have to change the baud rate, which you can’t do until there’s a device profile to adjust.) I followed Voidoids’ setup guide as per original post.

Here are the settings:

GCode is empty, Additional Setting are at defaults.

I did a quick test, and sure enough, M9 is in the output:

; LightBurn 0.9.16
; SnapMaker device profile, user origin
; Bounds: X142.5 Y177 to X182.5 Y183
G0 X0 Y0 F0
; Scan+Cut @ 5 mm/sec, 1% power

Thanks - let me know if there’s anything else I can provide to help clarify.

1 Like

I’ll revisit - I may have changed that after the last release.

Hi @GameMaker, at the end were you able to overcome the problem? I still have the same issue with my SM 2.
I was already aware about the M7/M8 code topic so I usually make the positioning of the laser, save the gcode, post-process the file in notepad++ and then run the gcode.

Unfortunately it seems this is not this piece of code that makes the job fails. Even in my case, mostly all the times, machine stops without errors but before the end of the job.

@LightBurn, sorry for cross posting, I already opened a post because I can’t recognize the root cause of this behaviour.
Do you have any advice?

Moreover I confirm in SnapMaker profile mode it is still using the M8 / M9 commands.

I really like Lightburn but in this way I’s hard to use it.
Thanks for support! Of course I’m at your disposal for further tests.


Yeah, @LightBurn reached out to me and gave me a test build that fixed it. I think it will be in an upcoming release - I used the build quite a bit yesterday, and it works like a charm.

So, good news - it’s a known issue, it’s an easy fix, and it should be fixed in a version real soon. Maybe Oz can send you a copy of the build as well - it really makes a difference not to have to print one layer at a time. :slight_smile:

Thanks @GameMaker, this is really a good news! I was struggling for days on this issue.
@LightBurn, is it possible to have a copy for testing?

You made my day :slight_smile:

@LightBurn it seems a lot of Snapmaker users would be happy to use Lightburn and are making experiments.
What do you think to create a Snapmaker specific category under the “Hardware” section?

This would help to avoid the spreading of similar topics across different categories.
Anyway this is just an idea for a possible improvement…

This seems to be the solution, it’s from brent113 from the Snapmaker Forum. I can confirm it’s working!

I figured it out. Someone (maybe you) mentioned they suspected M9 was an issue, and that’s it.
Test 1:
Save gcode to file. Run file in Lightburn using ‘Run File’ button. Identical behavior to just using the Play button
Test 2:
Edit gcode file by changing M9 to ; M9 (comment it out). Run using “Run File” -> works perfectly.
Theory -> Lightburn sends the serial buffer data to the controller and expects an ok at the end. Instead, it received an “echo: error: M9 unrecognized command”. This causes lightburn to hang and not send additional gcode as it never received the OK.
When the file with the M9 is run from the touchscreen, it works as intended because the controller must send an OK to it, and it continues without regard to the unrecognized command error.
This is a bug in Snapmaker, not Lightburn, equivalent to a comment being typed into Luban causing it to hang.

Thanks @FlyByWire I’ll check it!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.