G & M code list?

Does the “g” & “m” commands in the console in Luban only list “some” of the commands recognized?

If so, could we get a list of ALL of the G & M codes that can be used?

Thought I’ve posted the sheet before…

I wrote down frequently used G-code commands in Marlin, and some M1XXX commands we added on top of it.
(Commands for debugging are not included)


This list isn’t complete anymore. For example the M500,M502 and M2001 is missing.

1 Like

Snapmaker uses a Marlin Firmware branch. Most of the Marlin supported Gcodes should work. This should give you a starting point at least.

There was actually an official documentation for the Snapmaker 2.0 Gcodes on their github repository.


Thank you for sharing this link.


Unfortunately that one isn’t up to date either :confused:

But it is a central place on github where you can write an issue or even create a pull request. This creates a common base for everyone.

What kind of G code you are looking for?

Tell me what you want and I can help you to search for it.


None in particular. But the M2001 isn’t included for example, and I’m not sure support for M600 (filament change) has already been added/enabled. Just wanted to warn that this list isn’t perfect either.

@dstarke : I know I could create a pull request (already have made one tiny one for the controller project). And I would if I was doing something with it, but as most, usually won’t do it just for the fun of it.

For the command M2001, please read this post.

And the code is in Snapmaker Firmware repository as well.


As for the command M600, Snapmaker Firmware does not support it now. You can refer to the comment records here.


@Edwin: don’t get me wrong. I highly appreciate that you’re very active in the forum helping everyone out. However, you’ve shown exactly what I wanted to point out :slight_smile:

The documentation isn’t perfect. Some info is missing, some info is incorrect (the M600 is documented, but doesn’t work), is “documented” in the code or on the forum etc. I can live with the documentation not being perfect and as @dstarke mentions, everyone can submit changes to improve.

My post was just to indicate that even though there is documentation, don’t assume it’s perfect.

The docs are also missing SM’s magical G1029 codes, which are essential to understand for getting a perfect level.

 [P<number of  points>] set the abl to measure using a specified number of points on the x and y axis
 [A] start the auto leveling process
 [S] save z offset
 [D0] compute interpolation and enable leveling

To use them:

G1029P7 ; set to a 7x7 grid
G1029A ; start leveling

Wait for leveling to complete, use jog commands to adjust z axis

G1029S ; save offset
G1029D0 ; compute/enable
G28 ; go home

Definitely right. You guys can try this code (M1029). Please be cautious if the machine reports any bugs and you should shut down the machine when anything wrong occurs.


The previous Google Doc is no longer being maintained. Please access the G-code Commands info for the Snapmaker 2.0 in this page:

1 Like