Detecting the laser / cnc modules


#1

I am writing a simple plugin for octoprint that will provide some snapmaker tools to turn on and off the laser / cnc tool / set the focus, etc. Maybe run a boundary for the loaded gcode.

I’m trying to determine how I can tell from the printer what module is installed in order to only provide this control only when the laser is plugged in or the cnc is plugged in.

Can you tell me what to send to get that information? it does not seem to be in the response to M503, M1005, or any others I’ve tried. Alternatilvely if you can send me the source for the firmware, I can figure it out myself.


#2

I just found out by sniffing the USB traffic when running snapmakerjs that the information actually appears to be in the M105 response as the “T” value, although I would like to make sure I know what T value corresponds to the different modules. From my snapmaker, the 3dp module returns the temp of the extruder and bed, the laser returns T:300.0, B:0.0 and the cnc returns T:500.0, B:0.0. I guess you figured the extruder temp would never get to 300?

If someone with the 1.6w laser could go to snapmakerjs and send a M105 command and paste the result, then I will be able to detect that also. Failing that I’ll just make any temp coming back between 300 and 499.99 be a “laser” and anything 500 or over a “cnc”.


#3

This plugin would be great! I’m not within reach of my Snapmaker, but would like to help when I get home this evening. I do have the 1.6W laser. What is the exact command and where do I enter it?


#4

In snapmakerjs when you connect to the port, there is a little terminal window that pops up. you can enter it there at the > prompt (M105). If you have it hooked up to octopi already, then you can use the terminal tab there. (note that with either of these, the laser module should be plugged in and the unit turned on)

Thanks!


#5

I have the 1.6W laser module attached to the Snapmaker running the latest firmware.

I can see in the terminal that the Snapmaker was already sending M105 commands. Here’s the screenshot of it. Hope this helps.


#6

@ronlawrence3
The command M1006 is what you need (with firmware version >= 2.4)


#7

Thanks, that is interesting. Interesting in that it reports different numbers (over 300) for temp, but it looks like the bed is reporting the real temperature, where mine is reporting 0 when the laser or cnc is plugged in. When you get a chance, can you send a “M1005” to see what the firmware string is? Mine is:

> M1005
Firmware Version: Snapmaker-Base-2.2
Release Date: Mar 27 2018

I see that @parachvte has mentioned a better way, so I’ll go with that if the firmware is >2.3. Looks like my firmware is out of date, so I’ll flash that too.


#8

I’m on SnapMaker-base-2.2, when I do a M1006 I get “Tool Head: 3DP” for a response so it doesn’t appear you need 2.3. Perhaps it’s only needed for the 1.6 laser to respond properly.


#9

Exactly! To distinguish 200mW and 1600mW laser, the M1006 responses for 1600mW laser and 200mW laser are slightly different, but you can easily programmatically deal with them with regular expression.


#10

I thought I was on the latest firmware. Should I upgrade to the latest 2.4 beta; is it stable enough?

Send: N4 M1005*19
Recv: Fimrware:Snapmaker-Base-2.2
Recv:
Recv:
Recv: Feb 26 2018
Recv: ok

Here’s what happens when I do a “M1006” command

Send: N23 M1006*37
Recv: LASER
Recv: ok


#11

The result from 2.4 is something like:

Send: M1006
Recv: LASER1600 (for 1.6W laser)
Recv: ok

Thought we forgot to remove the “beta” from the version string. Only a few changes were made from 2.2 to 2.4 so it’s recommended to upgrade to 2.4.


#12

Thanks for the notice on firmware 2.4. I’ll update this evening.


#13

Could someone from the SnapMaker team post the GCODE commands that their version of Marlin responds to? @parachvte?


#14

Hi! I’m a noob, just got mine today and I can get the 200 to engrave, but can’t get ANYTHING to work on the 1600. It is just stuck on “Detecting…” I THINK you (@parachvte) are trying to address my exact issue, but I’m an idiot when it comes to programming. Is that exactly what your reply is talking about? If so, can you dumb it down for, so I can try to make some cool stuff, too? Many thanks!


#15

Sorry for the late response. Try upgrade the firmware to the latest, and restart the machine, you might need the newer firmware to detect the 1600mW laser head.