Oh wait, that bug is apparently still there. The snapmaker controller can’t parse comments correctly, whereas Lightburn can. That’s why it works in Lightburn, but not sent to the machine. Simply remove all the ; from your header gcode (or copy below).
I tested and verified that was the problem by using your file (modifying in my own focus height and material) running it and noticed the wonk, then noticed the semicolons and removed them and it ran fine afterwards.
Found this bug way back in March on firmware 1.15.x
I love the work you’re doing! The instructions were super simple, and BOOM I’m already able to send commands to the snapmaker wirelessly. It’s great!
I’ve got two questions:
Do you know how I can send files to the snapmaker without starting the job so that I can start it on the machine?
I tried simply deleting the “start job” command line, but the file will not appear in the local storage of the Snapmaker. (I could always use sm2uploader, but it would be cool to do it this way)
Where are you finding the API codes in order to figure out all this stuff?
If you’ve got a spare moment, a list of all the API codes for Snapmaker you’ve gathered over the years would be really handy if you have such a thing kicking around.
Where do I find the token stored on a Mac? Or is there another way to find the token? I have looked for machine.json on the Mac, but I don’t find it. I did also look inside of the Contents of the SnapMaker Luban Application. I don’t find it in there either. Or if it was in there, I didn’t see it. Any guidance would be appreciated.
Sadly, I don’t know where a mac stores the settings files for Luban. However, quickly looking up the equivalent seems to be ~/Library/Application Support/ and the snapmaker luban folder should be in there.
Any chance chance @Skreelink or anybody else knows how to send a folder containing G-code to the snapmaker via drag and drop method? Not to run immediately, but to put on the device storage for me to start manually.
This would be handy for organization when I’ve got a bunch of projects on the queue!
Do not include any special characters in your file name. I was stumped with a file that I couldn’t send wirelessly to my Snapmaker, until I realized it’s because I had a comma in the file name. Even though your computer’s file management system can handle it, apparently curl doesn’t appreciate it.
So if you’re getting the error: “curl: (26) Failed to open/read local data from file/application”
Check your file name.
This is likely an obvious issue for those with more experience, but I wanted to share for those just fooling around - such as myself.
First, thank you so much for all your guides, I have found them VERY helpful! I wanted to add just a couple of notes:
I ran into the same issue with the comments, but when I removed the space before the semi-colon, it worked. So this would fail/skip:
G28 ; Safety home, incase you forgot after power on.
But this would run:
G28; Safety home, incase you forgot after power on.
Also, I am on a Mac, so the machine.json path was ‘/Users/Parker/Library/Application Support/snapmaker-luban/machine.json’ for me. Since Macs can’t run bash, I made a shell script that does the same thing, but will also pull in the token and IP address directly from machine.json if it is there. I called it “laser_print.sh” and I have it saved on my desktop. Make sure to make it executable (chmod +x laser_print.sh) and optionally can add it to your bin to call from anywhere (sudo cp -pv laser_print.sh /usr/local/bin/laser_print). Make sure to change the [TOKEN] and [IP] in the shell script to your default ones. It will use the ones you set if it can’t get it from machine.json. You can call this via the terminal and pass in the filename to run, drag and drop a file on it, or make a Quick Action to right click on a file and send it over.