Touch screen-like gcodes

Hi,

I’m new to whole gcode thing.

Could anyone tell what codes can replace touchscreen functions during printing?
I already found get/set temperature for head and bed and stop and pause gcodes. Now I wonder how can I:

  1. Get current progress percentage
  2. Get estimated finish time
  3. Get/set Z-offset
  4. Get/set working speed

Thanks

On the Original, the percentage is just the bytes processed in the file divided by the total bytes. I assume the v2 is the same, but I haven’t been able to establish how related the Original and V2 firmware is.

I’ve been using G-code Reference for Snapmaker - Google Sheets as a GCode reference. Failing that, I’ll look at the firmware source code on github. I don’t see anything for the progress or finish time, but I believe the rest of your questions can be answered from the sheet without consulting the source.

If you’re using the touchscreen or luban to print, I think the more correct way would be to go through the API from the touch screen, perhaps @EddieHartman would be willing to share exactly what API calls he’s making for his app (although, with the API, I think figuring out the auth tokens is a bigger hurdle)

If you’re looking for GCode exclusively, there is no gcode to get the progress percentage, estimated finish time, etc. for getting the current values. Gcode is used to tell the machine what to do and not read values afaik. There is a reference here: https://snapmaker.github.io/Documentation/gcode/G000-G001

If you ARE looking for API endpoints to send to the machine instead, look at the Luban software and the requests that it sends.

The ones to get started are api/v1/connect which prompts a connection to the machine and will send back a token to use once you verify the connection on the machine.

Once that is established, you can send other requests such as api/v1/status with the token to get the status of the machine and a bunch of other info.

Unfortunately, if you use the machine like I do and start prints from the touchscreen and then want to monitor them remotely, the current firmware breaks the ability to make any adjustments to the print from the touchscreen once you’ve ever connected remotely while a job is running.

According to a support person from snapmaker on facebook, this should be getting fixed in November, but I wouldn’t hold my breathe since that would basically be a full year at that point of it being broken.

Thanks, @EddieHartman, @nivekmai

That’s exactly what I also found in last couple days. Actually there are several g-codes that return current state.
But my guess is (correct me if i’m wrong) when printing from machine itself it’s touchscreen who feeds controller with g-codes from uploaded file line by line. From the other side when connecting through serial port you talk with controller but it just doesn’t know how many g-codes left to print.
Same with work speed (which is obviously simple multiplier to g-codes movements from file) and z-offset (increment to z-position g-codes)

As for touchscreen FW it’s very is buggy and it’s so called “API” is ridiculous.
Apart from dumb offer to stop printing when disconnecting from API there is no “getters” of above parameters - you can set workspeed percentage but you can’t get the current value. Same with Z-offset :man_facepalming:

Anyway thanks for giving hope about November :slight_smile:

So nothing happend even half year later.
All promises from SM developers are just bluff

Could you please point out where such promises were given?