Simple Snapmaker plugin for octoprint


I’m starting a new plugin project for octoprint released under the ISC license. Any who would like to participate are welcome. I have never built an octoprint plugin, so I’m learning about it as I go.

I will be working towards getting at least the functionality of turning the laser on and off, turning the CNC tool on and off, and ultimately running boundaries and setting work origins via the octoprint UI.

Here is my starting code (does not much yet – kind of a “hello world” at this point), which I will be adding to often. If you’d like to contribute, feel free to add wishlist issues to the repo or reply here.


I would try to help but I’ve never done programming with moving parts before.

I’ll try to learn about all the motors and stuff before I mess up the project haha!!!

This is going to be awesome!


FYI, you can add custom controls to the Control tab by editing the config.yaml file. I’ve added “go to x,y origin” (for tool changes), “spindle on”, and “spindle off” buttons.


Right. There is a programmatic way to do this from the plugin, which I intend to do also.


@Rainie / @parachvte.

May I have permission to use the snapmaker svg logo from your website in the plugin? You can PM or email me if you like.


If anyone who has octoprint is interested in beta testing, I have a functional (but NOT WELL TESTED) plugin with the following features:

Upon connection to the snapmaker, it detects the type of module and displays controls in the controls tab if it is a laser or CNC.

  • On and Off turn the tool on and off
  • A power slider can set the laser power (only changes when “on” is clicked right now)


Ultimately, I’d like to be able to run a boundary for the loaded file, but I’m not there yet.

All comments welcome. I intend to fix the laser slider to send gcode as its being adjusted next, and will push an update when that is done.


FYI, this plugin will now detect and turn the laser / cnc on and off.

However, beyond that there are issues.

I have started on boundary processing, and started a discussion thread here based on OctoPrint not really supporting CNC files yet. It currently won’t even allow uploads of “nc” files, and when I change this locally to test, there are other issues also. Here is the discussion.

I intend to continue working this, but it is looking like it will be a lot more work than I initially thought, so It may move a little slower from here. I have limited time to dedicate to this, but would welcome any help.


Aren’t nc files just gcode files, too? Does it work when you rename it .gcode?


It will upload, yes, and you could even send it to the snapmaker, and it should work (in theory).

However, the tools in octoprint don’t know that a laser or cnc bit exists (M3 and M5 commands in gcode). The gcode analysis, which determines the size of the “print” does not work on these files since there is no “extruder” to tell it when to track the movement or not.

A CNC file seems to have a “tool on” command, a bunch of movements, and a “tool off”.

A laser file seems to have a “tool off” command, then a move, then a “tool on at %” command, then repeat… (laser pulse when the head is still, move with laser off)

I can probably make octoprint analysis figure out bounds for these things, or I can make my plugin do it, but it is a bunch more work than I thought it was going to be to just run a boundary


Is this still working? I would love the features mentioned in Octopi, its a bit annoying to switch between USB and Octopi.