Can Octolapse take a snapshot of the print plate (layer0) before printer starts first layer (layer 1)?

What is the problem?

The problem I am having seems to be a simple fix, but my efforts to find a solution have been elusive. I would like to take a snapshot of a print before the first layer is laid down, to illustrate how the printer starts building the print from the blank, empty surface of a print plate. Octolapse works great when taking snapshots of all the other layers except for layer 0, before the printer starts printing layer 1. I have tried endlessly to find a solution to this problem, but I can't find a direct answer anywhere, so I decided to join the Octoprint community to see if I could get some insight. Maybe someone here has been able to solve this issue and can shed some light. Does anyone know how to get Octolapse to do this if possible? If anyone can provide some guidance/direction on how to approach this problem, I would be so grateful for your help. Thanks in advance.

What did you already try to solve it?

I have tried to decrease the priming height. I have tried different triggers from classic to legacy and smart. I have tried G4 P1 command for both classic G code, legacy and smart triggers, including adding @Octolapse...command before the G4 P1 command in the 'Before layer change' and the 'After layer change' G code fields.

Have you tried running in safe mode?

Yes

Did running in safe mode solve the problem?

No

Systeminfo Bundle

You can download this in OctoPrint's System Information dialog ... no bundle, no support!)

I am hesitant to include the Systeminfo bundle because I am concerned it may contain vital information of my system that can be used to hack into my computer. There is no information that the bundle can provide to answer the question I am asking. Can Octolapse take a snapshot of the print plate (layer0) before printer starts first layer (layer 1)? I can figure it out, I just would like to know if it is possible or am I beating a dead horse? I will repost if I find an answer before receiving a response, if anyone responds.

Additional information about your setup

OctoPrint version, OctoPi version, printer, firmware, browser, operating system, ... as much data as possible

Octoprint Version = 1.5.3, Printer = Prusa MK3/S, Firmware = 3.10.0, Browser = FoxFire, Operating System = Windows 8. Please let me know if you need additional information if anyone responds.

I have a similar issue. I've tried putting the octolapse trigger before the purge line (while my nozzle is still at my no-ooze temperature), after the purge line, adding a movement code to shift the nozzle to inside the print area after the purge line and then the octolapse trigger (thinking that the nozzle being at a negative y position when the trigger happens was causing a problem).

Every time, the print starts and I get a stabilization error from octolapse and then octolapse performs as expected after layer 1.

I'll be watching this thread carefully.

Oh, yeah... I'm also using a MK3S printer, and have both OctoPrint and OctoLapse updated according to octoprint's software updater.

What if you use @OCTOLAPSE TAKE-SNAPSHOT in the gcode script "Before Print Starts" section of OctoPrint ?

Great! so glad to get a response from the both of you (Sembazuru and Ewald) without having to include the Systeminfo bundle. Thanks for understanding my concern regarding unnecessary data that can potentially be used to lower the security for OctoPrint users. Seemed a bit militant to have that requirement in order to get any help from the Octolapse community. Maybe whoever thought of that should rewrite the requirments or make it optional for users that need to expose their technical data to get help form the community. After all, isn't OctoPrint supposed to be a free, open source 3D printer controller application? Free OctoPrint !!! :statue_of_liberty:

I look forward to troubleshooting this issue and trying both of your suggestions in hopes of finding a solution. I will get back to this post as soon as possible. I am so grateful to the both of you for trying to help me find an answer to this problem. :blush:

Please chime in if anybody else has experienced a similar issue or has any ideas on how to solve this problem.

That would be me. I've been maintaining this software ever since I created in late 2012. Nothing in the systeminfo bundle should expose you (and if it does, that's a severe issue that needs to be immediately addressed).

The requirement is there because over the course of the past almost 9 years it has become clear that is sadly absolutely impossible to help most people if they don't share a certain amount of information about the setup. The systeminfo bundle makes it trivial to get to this information. A TON of people come here, ask for help, then get unreasonably angry when we can't help them because we are lacking crucial information in order to be able to help them. This requirement is to prevent people from shooting themselves in the foot by not giving us the data we usually need to help them, and then screaming at us for not being able to help. If you find it unreasonable to ask for logs and system information to provide free support on a free and open source software, I frankly suggest you try to do this for a couple of years and then we'll see how you think about the intrusiveness of something like a systeminfo bundle requirement on a support forum :wink:

It is free. So is the support. No one forces you to share said data. But if you don't the chances of actually getting help are reduced, and that's on you, not on us. You wouldn't expect a car mechanic to remote repair your car without being able to see it, touch it, listen to the engine and analyse stuff via the OBD port, would you? Then why do you expect us to do something like that, on the regular, which we'd need to if there wasn't a requirement for the bundle? This simply doesn't scale or even work at all.

5 Likes

Ok Foosel, thanks for your response.

Sembazuru, I think I've figured it out. First, go to your printer profile in Octoprint and set your printer alternative snapshot command to G4 P1. Then go to your Custom G-code in your prusa slicer printer settings. At Start G-code, after the G80 ;mesh bed leveling line, hit return to open a new line and add:
G4 P0@OCTOLAPSE TAKE-SNAPSHOT (no space between P0 and @OCTOLAPSE TAKE-SNAPSHOT)
Then, go to After layer change G-code, at the very bottom, and add G4 P1 command. The trigger I am using is Classic - Gcode.
Try that and see if it works for you.

Works like a charm for me.

Hmm... I do have G4 ; wait on the line before @OCTOLAPSE TAKE-SNAPSHOT in my start gcode. I'll give your suggestion a try. What made you think to try that (i.e. no space between P0 and @)? I would have never tried that because it looks like bad syntax to me.

FWIW, I'm currently using @OCTOLAPSE TAKE-SNAPSHOT both in my start gcode and my after layer gcode. Only the first one doesn't work for me. I also have G4 ; wait on the line before the trigger in the after layer gcode. I don't know if the G4 without arguments (pause processing gcode until the buffer is empty) is necessary, but it hasn't hurt me yet. Though, I should probably change all my G4s to M400 so it doesn't look like I forgot a G4 argument.

Get rid of (G4 ; wait on the line before @ OCTOLAPSE TAKE-SNAPSHOT) in your start g-code. In this case, G4 has no purpose without a designation of P0 or P1. P0 is layer 0 and P1 is layer 1.

I thought of trying this combination based on Former Lurker's instructions on how to use @OCTOLAPSE without non-white space commands/characters. I agree, I would never have tried this either, unless I had done some "Lurking."

You don't need @OCTOLAPSE TAKE-SNAPSHOT in your After layer g-code. Just add the G4 P1 command at the very bottom of your After layer change G-code in your Prusa slicer printer settings.

Regarding the command you included (G4 ; wait on the line before the trigger in the After layer change G-code.) I would get rid of that. From my experience, G4 works with the designation of P0, or P1. Meaning P0, layer 0 and P1 meaning layer 1. Get rid of the G4 without a designation, with or without arguments. For example, I would include a "designation," like G4 P1 or G4 P0.

That solved, update to the current Prusa FW slicer (3.10) as well as Octroprint version (1.5.3) if the changes you make don't work.

Let me know if I can help.

P<value> is for the length of time to pause, not the layer. The higher the number, the longer the printer will pause for. This is used in OctoLapse to stabilise while taking a picture. Correct, it has no purpose without a number

Dwell | Marlin Firmware (marlinfw.org)
G-code - RepRap
Prusa Knowledge Base | Prusa-specific G-codes (prusa3d.com)

1 Like

Re: G4

Yet in the Marlin firmware page it states:

G4 with no arguments is effectively the same as M400 .

Where M400 is described as:

This command causes G-code processing to pause and wait in a loop until all moves in the planner are completed.

Which is how I'm using it. This is why I was mulling over converting all my G4 w/o arguments to M400 for clarity, and maybe Prusa's firmware ignores G4 without any arguments.

Granted, only the Marlin Firmware page mentions G4 without arguments. Neither the RepRap page nor the Prusa Knowledgebase mention anything about G4 without arguments.

Over the next few days I'll play around with a simple 25mm cube scaled in z to only be 5 layers (1mm).

1 Like

Charlie, thanks for clarifying what the P value stands for in G4 P0 or G4 P1. Makes sense that P stands for Pause. Since I was trying to affect layer 0 to take a snap shot before laying down layer 1 and it worked, I thought P was the layer height when I added G4 P0@OCTOLAPSE TAKE-SNAP SHOT to the start g-code, in the Prusa slicer, after the G80 ; mesh bed leveling command line. I tried other combinations, but I did not get the result I wanted.

Since Octolapse does take a snap shot of layer 0, before printing layer 1, I guess using G4 P0@OCTOLAPSE TAKE-SNAP SHOT is the correct command? Please correct me if I'm wrong. I am curious; however, to try G4 P1@OCTOLAPSE TAKE-SNAP SHOT just to see how it affects the printer. I will post the result as soon as I try it out.

The funny thing is that it still pauses before taking the snap shot at the extruders designation (back left of the print plate) even though the length of time is 0. It does perform the snap shot command before laying down the first layer, which is what I want it to do. Can you elaborate more about the difference between G4 P0 and G4 P1 to help me better understand why G4 P0@OCTOLAPSE TAKE-SNAP SHOT works? I would appreciate your insight. Thanks.

As I understood it, sending the @OCTOLAPSE TAKE-SNAPSHOT is what is called a 'trigger'. When OctoLapse sees the trigger, it will perform the stabilisation thing, take the picture then continue printing. So the delay that you see is all set from the 'Stabilisation' settings, and the @ command is just triggering these.

As for the difference between G4 P0 and G4 P1, the only differences here are 1ms of pause vs. no pause. I'm not entirely sure why it makes a difference, but if it works it works...

My brain is telling me that you might not need G4 at all, or as @Sembazuru pointed out a G4 with no parameters tells the printer to empty it's buffer, which would help OctoLapse as it then knows the printer has arrived at the stabilisation point?

Ok. I've done some testing. My apologies for this wall of text, but this is troubleshooting. :wink:

I think the root question is how to get OctoLapse to trigger before the print actually starts.

By enabling the serial log in Octoprint I was able to see what was sent and received between my octopi and MK3S. Of note, I saw that the line G4 P0@OCTOLAPSE TAKE-SNAPSHOT was sent in full to the MK3S. There wasn't an error code from the MK3S so it is good to see that it was silently ignored. But there was no indication in the serial log that any instructions were sent to the MK3S to move the extruder to the snapshot position. So I stopped that, just using the plane-jane trigger of @OCTOLAPSE TAKE-SNAPSHOT. I wrapped my trigger lines with M117 lines to make it easer to find in both the saved gcode and the serial log. To the Start G-code in PrusaSlicer I added 6 octolapse snapshots in different places, including at the very end, written as:

M117 Start G-code Octosnap 1 of 6
M400 ; Wait for buffer to empty
@OCTOLAPSE TAKE-SNAPSHOT
M117 End Octosnap

To the End G-code I added 2 octolapse snapshots written as:

M117 End G-code Octosnap 1 of 2
M400 ; Wait for buffer to empty
@OCTOLAPSE TAKE-SNAPSHOT
M117 End Octosnap

To the Before layer change G-code I added this:

M117 Before layer [layer_z] change G-code Octosnap
M400 ; Wait for buffer to empty
@OCTOLAPSE TAKE-SNAPSHOT
M117 End Octosnap

And to the After layer change G-code I added this:

M117 After layer [layer_z] change G-code Octosnap
M400 ; Wait for buffer to empty
@OCTOLAPSE TAKE-SNAPSHOT
M117 End Octosnap

Reviewing the serial log I found that not only were all the 6 snapshot commands in the start g-code ignored (no extra octolapse commands added) but the two layer change snapshot commands before the start of the print were also ignored.

Here is the full serial log for my last print (clipped from the serial log in the systeminfo bundle at the end of this post):
OctoSnap_Test_serial.log (296.3 KB)

Here are all the OctoLapse trigger sections followed by the section of the serial log inline. My OctoLapse stabilization configuration is the default back right which translated to X247.500 Y207.870. My OctoLapse trigger is the default smart-gcode trigger.

M117 Start G-code Octosnap 1 of 6
M400 ; Wait for buffer to empty
@OCTOLAPSE TAKE-SNAPSHOT
M117 End Octosnap

2021-07-23 17:27:13,122 - Send: N30 M117 Start G-code Octosnap 1 of 6*5
2021-07-23 17:27:13,136 - Recv: LCD status changed
2021-07-23 17:27:13,137 - Recv: ok
2021-07-23 17:27:13,139 - Send: N31 M400*21
2021-07-23 17:27:13,144 - Recv: ok
2021-07-23 17:27:13,147 - Send: N32 M117 End Octosnap*97

M117 Start G-code Octosnap 2 of 6
M400 ; Wait for buffer to empty
@OCTOLAPSE TAKE-SNAPSHOT
M117 End Octosnap

2021-07-23 17:27:44,436 - Send: N40 M117 Start G-code Octosnap 2 of 6*1
2021-07-23 17:27:44,456 - Recv: LCD status changed
2021-07-23 17:27:44,458 - Recv: ok
2021-07-23 17:27:44,463 - Send: N41 M400*18
2021-07-23 17:27:44,484 - Recv: ok
2021-07-23 17:27:44,495 - Send: N42 M117 End Octosnap*102

M117 Start G-code Octosnap 3 of 6
M400 ; Wait for buffer to empty
@OCTOLAPSE TAKE-SNAPSHOT
M117 End Octosnap

2021-07-23 17:29:52,931 - Send: N56 M117 Start G-code Octosnap 3 of 6*7
2021-07-23 17:29:52,953 - Recv: LCD status changed
2021-07-23 17:29:52,954 - Recv: ok
2021-07-23 17:29:52,978 - Send: N57 M400*21
2021-07-23 17:29:53,217 - Recv: T:159.9 /160.0 B:65.8 /65.0 T0:159.9 /160.0 @:27 B@:0 P:39.2 A:37.6
2021-07-23 17:29:53,773 - Recv: ok
2021-07-23 17:29:53,790 - Send: N58 M117 End Octosnap*109

M117 Start G-code Octosnap 4 of 6
M400 ; Wait for buffer to empty
@OCTOLAPSE TAKE-SNAPSHOT
M117 End Octosnap

2021-07-23 17:31:03,657 - Send: N65 M117 Start G-code Octosnap 4 of 6*0
2021-07-23 17:31:03,667 - Recv: LCD status changed
2021-07-23 17:31:03,668 - Recv: ok
2021-07-23 17:31:03,670 - Send: N66 M400*23
2021-07-23 17:31:03,675 - Recv: ok
2021-07-23 17:31:03,678 - Send: N67 M117 End Octosnap*97

M117 Start G-code Octosnap 5 of 6
M400 ; Wait for buffer to empty
@OCTOLAPSE TAKE-SNAPSHOT
M117 End Octosnap

2021-07-23 17:31:04,343 - Send: N93 M117 Start G-code Octosnap 5 of 6*8
2021-07-23 17:31:04,355 - Recv: LCD status changed
2021-07-23 17:31:04,356 - Recv: ok
2021-07-23 17:31:04,358 - Send: N94 M400*26
2021-07-23 17:31:04,708 - Recv: T:226.1 /225.0 B:65.0 /65.0 T0:226.1 /225.0 @:43 B@:4 P:41.2 A:37.3
2021-07-23 17:31:06,542 - Recv: echo:busy: processing
2021-07-23 17:31:06,805 - Recv: T:226.2 /225.0 B:65.1 /65.0 T0:226.2 /225.0 @:37 B@:0 P:41.3 A:37.5
2021-07-23 17:31:08,636 - Recv: echo:busy: processing
2021-07-23 17:31:08,902 - Recv: T:225.4 /225.0 B:65.2 /65.0 T0:225.4 /225.0 @:57 B@:0 P:41.5 A:37.3
2021-07-23 17:31:10,737 - Recv: echo:busy: processing
2021-07-23 17:31:10,938 - Recv: ok
2021-07-23 17:31:10,944 - Recv: T:225.2 /225.0 B:65.2 /65.0 T0:225.2 /225.0 @:60 B@:5 P:41.6 A:37.8
2021-07-23 17:31:10,971 - Send: N95 M117 End Octosnap*108

M117 Start G-code Octosnap 6 of 6
M400 ; Wait for buffer to empty
@OCTOLAPSE TAKE-SNAPSHOT
M117 End Octosnap

2021-07-23 17:31:11,036 - Send: N99 M117 Start G-code Octosnap 6 of 6*1
2021-07-23 17:31:11,045 - Recv: LCD status changed
2021-07-23 17:31:11,046 - Recv: ok
2021-07-23 17:31:11,048 - Send: N100 M400*38
2021-07-23 17:31:11,054 - Recv: ok
2021-07-23 17:31:11,077 - Send: N101 M117 End Octosnap*80

M117 Before layer 0.2 change G-code Octosnap
M400 ; Wait for buffer to empty
@OCTOLAPSE TAKE-SNAPSHOT
M117 End Octosnap

2021-07-23 17:31:11,174 - Send: N108 M117 Before layer 0.2 change G-code Octosnap*1
2021-07-23 17:31:11,184 - Recv: LCD status changed
2021-07-23 17:31:11,184 - Recv: ok
2021-07-23 17:31:11,187 - Send: N109 M400*47
2021-07-23 17:31:11,192 - Recv: ok
2021-07-23 17:31:11,222 - Send: N110 M117 End Octosnap*80

M117 After layer 0.2 change G-code Octosnap
M400 ; Wait for buffer to empty
@OCTOLAPSE TAKE-SNAPSHOT
M117 End Octosnap

2021-07-23 17:31:11,311 - Send: N114 M117 After layer 0.2 change G-code Octosnap*113
2021-07-23 17:31:11,319 - Recv: LCD status changed
2021-07-23 17:31:11,321 - Recv: ok
2021-07-23 17:31:11,325 - Send: N115 M400*34
2021-07-23 17:31:11,333 - Recv: ok
2021-07-23 17:31:11,372 - Send: N116 M117 End Octosnap*86

M117 Before layer 0.4 change G-code Octosnap
M400 ; Wait for buffer to empty
@OCTOLAPSE TAKE-SNAPSHOT
M117 End Octosnap

2021-07-23 17:32:45,338 - Send: N550 M117 Before layer 0.4 change G-code Octosnap*14
2021-07-23 17:32:45,346 - Recv: LCD status changed
2021-07-23 17:32:45,346 - Recv: ok
2021-07-23 17:32:45,349 - Send: N551 M400*38
2021-07-23 17:32:46,845 - Recv: ok
2021-07-23 17:32:46,864 - Send: N552 G1 E-0.40000 F3060.000*53
2021-07-23 17:32:46,882 - Recv: ok
2021-07-23 17:32:46,883 - Send: N553 G91*18
2021-07-23 17:32:46,886 - Recv: ok
2021-07-23 17:32:46,887 - Send: N554 G1 Z0.200 F12000.000*49
2021-07-23 17:32:46,898 - Recv: ok
2021-07-23 17:32:46,900 - Send: N555 G90*21
2021-07-23 17:32:46,902 - Recv: ok
2021-07-23 17:32:46,903 - Send: N556 G0 X247.500 Y207.870*32
2021-07-23 17:32:46,935 - Recv: ok
2021-07-23 17:32:46,936 - Send: N557 M400*32
2021-07-23 17:32:47,414 - Recv: T:225.1 /225.0 B:65.5 /65.0 T0:225.1 /225.0 @:41 B@:0 P:49.3 A:37.9
2021-07-23 17:32:47,943 - Recv: ok
2021-07-23 17:32:47,946 - Send: N558 M114*47
2021-07-23 17:32:47,964 - Recv: X:247.50 Y:207.87 Z:0.40 E:-0.40 Count X: 245.32 Y:208.34 Z:0.51 E:-0.40
2021-07-23 17:32:47,966 - Recv: ok
2021-07-23 17:32:48,363 - Send: N559 G0 X114.164 Y116.600*38
2021-07-23 17:32:48,407 - Recv: ok
2021-07-23 17:32:48,409 - Send: N560 G91*18
2021-07-23 17:32:48,427 - Recv: ok
2021-07-23 17:32:48,428 - Send: N561 G1 Z-0.200*81
2021-07-23 17:32:48,450 - Recv: ok
2021-07-23 17:32:48,452 - Send: N562 G1 E0.40000 F1440.000*31
2021-07-23 17:32:48,471 - Recv: ok
2021-07-23 17:32:48,475 - Send: N563 G90*16
2021-07-23 17:32:48,495 - Recv: ok
2021-07-23 17:32:48,496 - Send: N564 G1 F1200.000*84
2021-07-23 17:32:48,548 - Recv: ok
2021-07-23 17:32:48,552 - Send: N565 M117 End Octosnap*86

M117 After layer 0.4 change G-code Octosnap
M400 ; Wait for buffer to empty
@OCTOLAPSE TAKE-SNAPSHOT
M117 End Octosnap

2021-07-23 17:32:48,659 - Send: N569 M117 After layer 0.4 change G-code Octosnap*121
2021-07-23 17:32:48,668 - Recv: LCD status changed
2021-07-23 17:32:48,669 - Recv: ok
2021-07-23 17:32:48,671 - Send: N570 M400*37
2021-07-23 17:32:49,565 - Recv: T:224.9 /225.0 B:65.6 /65.0 T0:224.9 /225.0 @:46 B@:0 P:49.5 A:37.9
2021-07-23 17:32:49,676 - Recv: ok
2021-07-23 17:32:49,689 - Send: N571 G0 X247.500 Y207.870*37
2021-07-23 17:32:49,721 - Recv: ok
2021-07-23 17:32:49,722 - Send: N572 M400*39
2021-07-23 17:32:50,855 - Recv: ok
2021-07-23 17:32:50,857 - Send: N573 M114*38
2021-07-23 17:32:50,876 - Recv: X:247.50 Y:207.87 Z:0.40 E:-0.40 Count X: 245.32 Y:208.34 Z:0.51 E:-0.40
2021-07-23 17:32:50,877 - Recv: ok
2021-07-23 17:32:51,242 - Send: N574 G0 X114.164 Y116.600*41
2021-07-23 17:32:51,273 - Recv: ok
2021-07-23 17:32:51,275 - Send: N575 M117 End Octosnap*87

M117 Before layer 0.6 change G-code Octosnap
M400 ; Wait for buffer to empty
@OCTOLAPSE TAKE-SNAPSHOT
M117 End Octosnap

2021-07-23 17:33:21,816 - Send: N878 M117 Before layer 0.6 change G-code Octosnap*11
2021-07-23 17:33:21,826 - Recv: LCD status changed
2021-07-23 17:33:21,828 - Recv: ok
2021-07-23 17:33:21,832 - Send: N879 M400*33
2021-07-23 17:33:22,723 - Recv: ok
2021-07-23 17:33:22,740 - Send: N880 G1 E-0.40000 F3060.000*55
2021-07-23 17:33:22,757 - Recv: ok
2021-07-23 17:33:22,759 - Send: N881 G91*16
2021-07-23 17:33:22,767 - Recv: ok
2021-07-23 17:33:22,768 - Send: N882 G1 Z0.200 F12000.000*55
2021-07-23 17:33:22,777 - Recv: ok
2021-07-23 17:33:22,778 - Send: N883 G90*19
2021-07-23 17:33:22,787 - Recv: ok
2021-07-23 17:33:22,790 - Send: N884 G0 X247.500 Y207.870*34
2021-07-23 17:33:22,834 - Recv: ok
2021-07-23 17:33:22,835 - Send: N885 M400*34
2021-07-23 17:33:23,409 - Recv: T:214.5 /215.0 B:64.7 /65.0 T0:214.5 /215.0 @:62 B@:29 P:49.1 A:38.3
2021-07-23 17:33:23,887 - Recv: ok
2021-07-23 17:33:23,889 - Send: N886 M114*33
2021-07-23 17:33:23,899 - Recv: X:247.50 Y:207.87 Z:0.60 E:-0.40 Count X: 245.32 Y:208.34 Z:0.71 E:-0.40
2021-07-23 17:33:23,909 - Recv: ok
2021-07-23 17:33:24,235 - Send: N887 G0 X113.254 Y94.085*31
2021-07-23 17:33:24,280 - Recv: ok
2021-07-23 17:33:24,287 - Send: N888 G91*25
2021-07-23 17:33:24,311 - Recv: ok
2021-07-23 17:33:24,316 - Send: N889 G1 Z-0.200*90
2021-07-23 17:33:24,329 - Recv: ok
2021-07-23 17:33:24,331 - Send: N890 G1 E0.40000 F1440.000*31
2021-07-23 17:33:24,345 - Recv: ok
2021-07-23 17:33:24,347 - Send: N891 G90*16
2021-07-23 17:33:24,354 - Recv: ok
2021-07-23 17:33:24,355 - Send: N892 G1 F10952.635*108
2021-07-23 17:33:24,366 - Recv: ok
2021-07-23 17:33:24,369 - Send: N893 M117 End Octosnap*82

M117 After layer 0.6 change G-code Octosnap
M400 ; Wait for buffer to empty
@OCTOLAPSE TAKE-SNAPSHOT
M117 End Octosnap

2021-07-23 17:33:24,457 - Send: N896 M117 After layer 0.6 change G-code Octosnap*118
2021-07-23 17:33:24,472 - Recv: LCD status changed
2021-07-23 17:33:24,474 - Recv: ok
2021-07-23 17:33:24,477 - Send: N897 M400*33
2021-07-23 17:33:25,513 - Recv: T:214.4 /215.0 B:64.8 /65.0 T0:214.4 /215.0 @:65 B@:24 P:48.9 A:38.5
2021-07-23 17:33:25,616 - Recv: ok
2021-07-23 17:33:25,638 - Send: N898 G0 X247.500 Y207.870*47
2021-07-23 17:33:25,681 - Recv: ok
2021-07-23 17:33:25,682 - Send: N899 M400*47
2021-07-23 17:33:26,869 - Recv: ok
2021-07-23 17:33:26,871 - Send: N900 M114*46
2021-07-23 17:33:26,889 - Recv: X:247.50 Y:207.87 Z:0.60 E:-0.40 Count X: 245.32 Y:208.34 Z:0.71 E:-0.40
2021-07-23 17:33:26,891 - Recv: ok
2021-07-23 17:33:27,234 - Send: N901 G0 X113.254 Y94.085*16
2021-07-23 17:33:27,278 - Recv: ok
2021-07-23 17:33:27,280 - Send: N902 M117 End Octosnap*91

M117 Before layer 0.8 change G-code Octosnap
M400 ; Wait for buffer to empty
@OCTOLAPSE TAKE-SNAPSHOT
M117 End Octosnap

2021-07-23 17:34:09,177 - Send: N1217 M117 Before layer 0.8 change G-code Octosnap*55
2021-07-23 17:34:09,186 - Recv: LCD status changed
2021-07-23 17:34:09,188 - Recv: ok
2021-07-23 17:34:09,193 - Send: N1218 M400*29
2021-07-23 17:34:09,592 - Recv: T:214.7 /215.0 B:64.7 /65.0 T0:214.7 /215.0 @:82 B@:70 P:45.7 A:39.3
2021-07-23 17:34:10,098 - Recv: ok
2021-07-23 17:34:10,129 - Send: N1219 G1 E-0.40000 F3060.000*12
2021-07-23 17:34:10,154 - Recv: ok
2021-07-23 17:34:10,156 - Send: N1220 G91*32
2021-07-23 17:34:10,161 - Recv: ok
2021-07-23 17:34:10,163 - Send: N1221 G1 Z0.200 F12000.000*5
2021-07-23 17:34:10,174 - Recv: ok
2021-07-23 17:34:10,176 - Send: N1222 G90*35
2021-07-23 17:34:10,181 - Recv: ok
2021-07-23 17:34:10,183 - Send: N1223 G0 X247.500 Y207.870*20
2021-07-23 17:34:10,214 - Recv: ok
2021-07-23 17:34:10,216 - Send: N1224 M400*18
2021-07-23 17:34:11,210 - Recv: ok
2021-07-23 17:34:11,212 - Send: N1225 M114*19
2021-07-23 17:34:11,230 - Recv: X:247.50 Y:207.87 Z:0.80 E:-0.40 Count X: 245.32 Y:208.34 Z:0.91 E:-0.40
2021-07-23 17:34:11,231 - Recv: ok
2021-07-23 17:34:11,538 - Send: N1226 G0 X114.085 Y116.746*21
2021-07-23 17:34:11,575 - Recv: ok
2021-07-23 17:34:11,579 - Send: N1227 G91*39
2021-07-23 17:34:11,602 - Recv: ok
2021-07-23 17:34:11,603 - Send: N1228 G1 Z-0.200*106
2021-07-23 17:34:11,607 - Recv: T:215.3 /215.0 B:64.7 /65.0 T0:215.3 /215.0 @:66 B@:68 P:45.6 A:39.3
2021-07-23 17:34:11,630 - Recv: ok
2021-07-23 17:34:11,633 - Send: N1229 G1 E0.40000 F1440.000*38
2021-07-23 17:34:11,648 - Recv: ok
2021-07-23 17:34:11,650 - Send: N1230 G90*32
2021-07-23 17:34:11,656 - Recv: ok
2021-07-23 17:34:11,658 - Send: N1231 G1 F10952.635*94
2021-07-23 17:34:11,664 - Recv: ok
2021-07-23 17:34:11,668 - Send: N1232 M117 End Octosnap*98

M117 After layer 0.8 change G-code Octosnap
M400 ; Wait for buffer to empty
@OCTOLAPSE TAKE-SNAPSHOT
M117 End Octosnap

2021-07-23 17:34:11,753 - Send: N1235 M117 After layer 0.8 change G-code Octosnap*74
2021-07-23 17:34:11,763 - Recv: LCD status changed
2021-07-23 17:34:11,764 - Recv: ok
2021-07-23 17:34:11,768 - Send: N1236 M400*17
2021-07-23 17:34:12,848 - Recv: ok
2021-07-23 17:34:12,860 - Send: N1237 G0 X247.500 Y207.870*17
2021-07-23 17:34:12,889 - Recv: ok
2021-07-23 17:34:12,896 - Send: N1238 M400*31
2021-07-23 17:34:13,615 - Recv: T:215.2 /215.0 B:64.7 /65.0 T0:215.2 /215.0 @:71 B@:77 P:45.5 A:39.0
2021-07-23 17:34:14,020 - Recv: ok
2021-07-23 17:34:14,022 - Send: N1239 M114*30
2021-07-23 17:34:14,037 - Recv: X:247.50 Y:207.87 Z:0.80 E:-0.40 Count X: 245.32 Y:208.34 Z:0.91 E:-0.40
2021-07-23 17:34:14,038 - Recv: ok
2021-07-23 17:34:14,335 - Send: N1240 G0 X114.085 Y116.746*21
2021-07-23 17:34:14,368 - Recv: ok
2021-07-23 17:34:14,370 - Send: N1241 M117 End Octosnap*102

M117 Before layer 1 change G-code Octosnap
M400 ; Wait for buffer to empty
@OCTOLAPSE TAKE-SNAPSHOT
M117 End Octosnap

2021-07-23 17:34:39,955 - Send: N1472 M117 Before layer 1 change G-code Octosnap*37
2021-07-23 17:34:39,965 - Recv: LCD status changed
2021-07-23 17:34:39,966 - Recv: ok
2021-07-23 17:34:39,969 - Send: N1473 M400*22
2021-07-23 17:34:40,714 - Recv: T:215.1 /215.0 B:64.8 /65.0 T0:215.1 /215.0 @:79 B@:97 P:43.8 A:40.0
2021-07-23 17:34:40,891 - Recv: ok
2021-07-23 17:34:40,916 - Send: N1474 G1 E-0.40000 F3060.000*1
2021-07-23 17:34:40,928 - Recv: ok
2021-07-23 17:34:40,932 - Send: N1475 G91*38
2021-07-23 17:34:40,939 - Recv: ok
2021-07-23 17:34:40,940 - Send: N1476 G1 Z0.200 F12000.000*1
2021-07-23 17:34:40,951 - Recv: ok
2021-07-23 17:34:40,952 - Send: N1477 G90*37
2021-07-23 17:34:40,955 - Recv: ok
2021-07-23 17:34:40,956 - Send: N1478 G0 X247.500 Y207.870*28
2021-07-23 17:34:41,001 - Recv: ok
2021-07-23 17:34:41,002 - Send: N1479 M400*28
2021-07-23 17:34:42,062 - Recv: ok
2021-07-23 17:34:42,064 - Send: N1480 M114*26
2021-07-23 17:34:42,082 - Recv: X:247.50 Y:207.87 Z:1.00 E:-0.40 Count X: 245.32 Y:208.34 Z:1.12 E:-0.40
2021-07-23 17:34:42,084 - Recv: ok
2021-07-23 17:34:42,430 - Send: N1481 G0 X113.254 Y94.085*36
2021-07-23 17:34:42,472 - Recv: ok
2021-07-23 17:34:42,478 - Send: N1482 G91*46
2021-07-23 17:34:42,484 - Recv: ok
2021-07-23 17:34:42,489 - Send: N1483 G1 Z-0.200*109
2021-07-23 17:34:42,504 - Recv: ok
2021-07-23 17:34:42,514 - Send: N1484 G1 E0.40000 F1440.000*39
2021-07-23 17:34:42,525 - Recv: ok
2021-07-23 17:34:42,526 - Send: N1485 G90*40
2021-07-23 17:34:42,537 - Recv: ok
2021-07-23 17:34:42,540 - Send: N1486 G1 F7762.000*111
2021-07-23 17:34:42,560 - Recv: ok
2021-07-23 17:34:42,564 - Send: N1487 M117 End Octosnap*106

M117 After layer 1 change G-code Octosnap
M400 ; Wait for buffer to empty
@OCTOLAPSE TAKE-SNAPSHOT
M117 End Octosnap

2021-07-23 17:34:42,783 - Send: N1494 M117 After layer 1 change G-code Octosnap*80
2021-07-23 17:34:42,795 - Recv: LCD status changed
2021-07-23 17:34:42,796 - Recv: ok
2021-07-23 17:34:42,799 - Send: N1495 M400*30
2021-07-23 17:34:43,807 - Recv: ok
2021-07-23 17:34:43,816 - Send: N1496 M117 ETA is 17:35:42*114
2021-07-23 17:34:43,831 - Recv: LCD status changed
2021-07-23 17:34:43,832 - Recv: ok
2021-07-23 17:34:43,846 - Send: N1497 G0 X247.500 Y207.870*29
2021-07-23 17:34:43,890 - Recv: ok
2021-07-23 17:34:43,896 - Send: N1498 M400*19
2021-07-23 17:34:44,990 - Recv: T:215.8 /215.0 B:64.4 /65.0 T0:215.8 /215.0 @:59 B@:127 P:43.6 A:39.7
2021-07-23 17:34:45,076 - Recv: ok
2021-07-23 17:34:45,078 - Send: N1499 M114*18
2021-07-23 17:34:45,089 - Recv: X:247.50 Y:207.87 Z:1.00 E:-0.40 Count X: 245.32 Y:208.34 Z:1.12 E:-0.40
2021-07-23 17:34:45,090 - Recv: ok
2021-07-23 17:34:45,433 - Send: N1500 G0 X113.254 Y94.085*44
2021-07-23 17:34:45,474 - Recv: ok
2021-07-23 17:34:45,476 - Send: N1501 M117 End Octosnap*101

M117 End G-code Octosnap 1 of 2
M400 ; Wait for buffer to empty
@OCTOLAPSE TAKE-SNAPSHOT
M117 End Octosnap

2021-07-23 17:35:26,612 - Send: N1784 M117 End G-code Octosnap 1 of 2*7
2021-07-23 17:35:26,623 - Recv: LCD status changed
2021-07-23 17:35:26,625 - Recv: ok
2021-07-23 17:35:26,644 - Send: N1785 M400*28
2021-07-23 17:35:26,992 - Recv: T:214.9 /215.0 B:64.8 /65.0 T0:214.9 /215.0 @:81 B@:45 P:41.4 A:40.5
2021-07-23 17:35:27,399 - Recv: ok
2021-07-23 17:35:27,418 - Send: N1786 G0 X247.500 Y207.870*30
2021-07-23 17:35:27,447 - Recv: ok
2021-07-23 17:35:27,449 - Send: N1787 M400*30
2021-07-23 17:35:28,583 - Recv: ok
2021-07-23 17:35:28,590 - Send: N1788 M114*17
2021-07-23 17:35:28,602 - Recv: X:247.50 Y:207.87 Z:1.20 E:49.14 Count X: 245.32 Y:208.34 Z:1.32 E:49.14
2021-07-23 17:35:28,603 - Recv: ok
2021-07-23 17:35:28,924 - Send: N1789 G0 X113.975 Y116.748*26
2021-07-23 17:35:28,954 - Recv: ok
2021-07-23 17:35:28,955 - Send: N1790 M117 End Octosnap*111

M117 End G-code Octosnap 2 of 2
M400 ; Wait for buffer to empty
@OCTOLAPSE TAKE-SNAPSHOT
M117 End Octosnap

2021-07-23 17:35:30,243 - Send: N1803 M117 End G-code Octosnap 2 of 2*4
2021-07-23 17:35:30,253 - Recv: LCD status changed
2021-07-23 17:35:30,253 - Recv: ok
2021-07-23 17:35:30,255 - Send: N1804 M400*26
2021-07-23 17:35:31,199 - Recv: T:216.1 /215.0 B:65.1 /65.0 T0:216.1 /215.0 @:48 B@:25 P:41.3 A:40.6
2021-07-23 17:35:32,506 - Recv: echo:busy: processing
2021-07-23 17:35:33,297 - Recv: T:216.3 /215.0 B:65.2 /65.0 T0:216.3 /215.0 @:42 B@:19 P:41.2 A:40.8
2021-07-23 17:35:34,603 - Recv: echo:busy: processing
2021-07-23 17:35:35,394 - Recv: T:216.3 /215.0 B:65.3 /65.0 T0:216.3 /215.0 @:42 B@:12 P:41.2 A:40.7
2021-07-23 17:35:36,700 - Recv: echo:busy: processing
2021-07-23 17:35:37,491 - Recv: T:216.1 /215.0 B:65.3 /65.0 T0:216.1 /215.0 @:43 B@:23 P:41.1 A:40.5
2021-07-23 17:35:38,797 - Recv: echo:busy: processing
2021-07-23 17:35:39,314 - Recv: ok
2021-07-23 17:35:39,317 - Send: N1805 M117 ETA is 17:35:26*118
2021-07-23 17:35:39,334 - Recv: LCD status changed
2021-07-23 17:35:39,335 - Recv: ok
2021-07-23 17:35:39,353 - Send: N1806 G0 X247.500 Y207.870 F12000.000*82
2021-07-23 17:35:39,382 - Recv: ok
2021-07-23 17:35:39,386 - Send: N1807 M400*25
2021-07-23 17:35:39,592 - Recv: T:216.0 /215.0 B:65.2 /65.0 T0:216.0 /215.0 @:45 B@:37 P:41.0 A:40.6
2021-07-23 17:35:40,330 - Recv: ok
2021-07-23 17:35:40,332 - Send: N1808 M114*22
2021-07-23 17:35:40,345 - Recv: X:247.50 Y:207.87 Z:100.63 E:-0.80 Count X: 245.32 Y:208.34 Z:100.75 E:-0.80
2021-07-23 17:35:40,347 - Recv: ok
2021-07-23 17:35:40,729 - Send: N1809 G0 X125.000 Y210.000*29
2021-07-23 17:35:40,755 - Recv: ok
2021-07-23 17:35:40,760 - Send: N1810 G1 F10200.000*91
2021-07-23 17:35:40,768 - Recv: ok
2021-07-23 17:35:40,775 - Send: N1811 M117 End Octosnap*105

Side note. My preference for where to put the snapshot is in the after layer change because the slicer generated retract happens between the before layer change and after layer change custom gcodes. And, because the after layer change custom gcode is inserted by PrusaSlicer before the first layer I'm not sure if it is necessary to have any octolapse triggers in the start gcode. But, I want to have my first snapshot be of the empty bed, taken before the nozzle is at full temperature (and thus not oozing). I want to be able do this by putting the trigger where I want in my start gcode and use a conditional to put the trigger in the after layer change for every layer number except zero.

Hopefully I can summon the spirit of @FormerLurker to help with this or get advice if this should be escalated to github as an actual bug report.
My environment:
OctoPi: 0.17.0 (Yeah, I haven't upgraded to 0.18.0 yet)
OctoPrint: 1.6.1
Python: 3.7.3
Raspberry Pi 4
Prusa Original MK3S fw: 3.10.0
PrusaSlicer 2.3.2 (Yeah, I haven't upgraded to 2.3.3 yet)

Here is my Systeminfo bundle:
octoprint-systeminfo-20210723173732.zip (677.7 KB)
Here is the 3mf of my test print. (Change the .zip extension to .3mf):
OctoSnap_Test.zip (22.0 KB)
Here is the resulting gcode as downloaded from Octoprint:
OctoSnap_Test_0.4n_0.2mm_PLA_MK3S_4m.gcode (91.3 KB)

Hi Sembazuru,

Thank you so much for the information. I really appreciate your insight! I'm new to this gcode thing and I was wondering where you would insert these commands? For example, in the start gcode, do you insert it at the beginning, the end, the middle, after a specific command line? I have made an attempt to experiment with your suggestions. I didn't know where to insert the commands you mentioned, so I just added them at the top of the start, the end, the before and after gcode text boxes, as you suggested-before the printer starts reading the preset commands. I don't know if this is the correct order though. Can you please elaborate where exactly I should insert them? I would greatly appreciate your thoughts on how to properly organize the gcode you created that takes a snapshot of the print plate, before the printer starts the first layer.

I'll get back to you with my results after trying out the gcode you wrote.

Well, I downloaded your .zip to .3mf files and I'm currently giving it a go. I was able to get the answers to the questions I previously posted. I'm trying out the download setting you configured with a different model than the one in the file. The only problem I'm still having is that the printer lays down a small line from the skirt on the first layer, after the print head moves out of the way to take a snapshot. I was hoping it would take the snapshot before the print even started.

Maybe if I remove the skirt completely, it will take the snapshot without a problem. I'll give it a try and get back to this post.

Hi @Sembazuru,

Works like a charm! I had to start from scratch and reinstall the newest version of octoprint. In addition, I reconfigured all my setting in the setup wizard. That seemed to solved the issue with the line being laid down before the snapshot was taken. Now, there is a clean surface with no blobs on the print plate.

This is a great resource for all Prusa Slicer users who want the perfect setting for a .4mm nozzle at a 0.2 layer height (potentially even smaller layer heights). Also, I should mention that I didn't have to use the G4 P1 command in the G-code settings/Alternative snapshot command. I would never be able to dial in those settings with my learning disability. You are indeed a g code/slicer wizard! The results on the surface finish are amazing!

I hope @FormerLurker is summoned to fix this bug; otherwise, the Octoprint community can refer to this thread to fix the issue of taking a snapshot before the first layer is laid down. I love how the G-code tells the nozzle to home before it reaches full temperature and lays down the purge line to prevent oozing.

It was annoying to remove the oozing filament each time the print started laying down the purge line. Now, it waits at the front left side before reaching full temperature and then lays down the purge line, eliminating the need to remove any oozing - genius! Also, with the Print and Filament Settings you provided, the efficiency of the printing time is substantially reduced.

I hope this thread helps those who are interested in taking time lapse videos, using OctoLapse, of a 3D print that is generated from the ground up. Much like a construction site, where the concrete is laid down first (the print plate) and the structure/building is constructed above (the 3D model). I can't thank you enough. You are the best! Live long and prosper my friend... \V/..."Spock" (Star Trek)

Sincerely,
1derman

After running a couple of test prints with my own model, I noticed I was getting blobs from the nozzle moving out of the way, more than once, sometimes three or four, to take the snapshot. This excessive movement was giving the nozzle more time to ooze before printing the next layer, creating these blobs as the nozzle wiped over the next layer. So, I decided to go back to Octosnap, Sembazuru's G-code, and modify it. I removed all the G codes:

M117 Start G-code Octosnap 1 of 6
M400 ; Wait for buffer to empty
@OCTOLAPSE TAKE-SNAPSHOT
M117 End Octosnap

M117 End G-code Octosnap 1 of 2
M400 ; Wait for buffer to empty
@OCTOLAPSE TAKE-SNAPSHOT
M117 End Octosnap

M117 Before layer [layer_z] change G-code Octosnap
M400 ; Wait for buffer to empty
@OCTOLAPSE TAKE-SNAPSHOT
M117 End Octosnap

The G codes that were removed are only from the Start G-code, even the one below the E values, the End G-code, and the Before layer change G-code. The only G-code I left was in the After layer change G-code, illustrated below and "...preferred..." by @Sembazuru in the After_Layer_Change.

;AFTER_LAYER_CHANGE
; [layer_z]

M117 After layer [layer_z] change G-code Octosnap
M400 ; Wait for buffer to empty
@OCTOLAPSE TAKE-SNAPSHOT
M117 End Octosnap

I also removed the Between objects G-code (for sequential printing), Color Change G-code, and the Pause Print G-code since I did not require their use, including the @bedlevelvisualizer command, as I am using the Prusa Bed Leveling Guide plugin instead. However, If you are using these features, I would leave them alone.

After running a test print using the downloadable .3mf file, provided by @Semazuru, as it is a small square and takes less time, (don't forget to enable test mode in octolapse) I was able to eliminate the extra print moves that were causing the blobs from wiping the filament on the next layer. I will run some tests using my own model and get back to this thread with the results.

Yes! @Sembazur's G-code works! Here are my Octolapse settings:

First, configure the Printer settings in the navigation bar/settings (wrench icon)/under Printer/Printer Properties/under Action/click pencil icon to edit profile and configure. Refer to social media to dial in your settings. Click save.

Go back to Navigation bar and click Octolapse tab/Printer to edit all printer profiles, which includes Stabilization, Trigger, Rendering, Camera, and Logging. In Octolapse settings/ Printer/click the pencil icon to edit Printer settings. Add name, description. In import printer, input Make and Model. In Current Slicer Settings, select Slicer Type: (slic3er/slis3er PE/Prusa slicer). In Slicer - Slic3r, Slic3r PE, match settings from in your Prusa slicer using the .3mf downloadable file provided by @Sembazuru.

In Build Volume Origin, enable Override Octoprint Printer Profile. Bed shape/rectangular. Enable Printer Volume build area and input required information. Make sure to disable Restrict Snapshot Area or Octolapse will not work, at least for me. For Layer Change Detection, use the presets that were enabled in Custom Profile.

Disable Position Detection. Don't change Home Position or Firmware Settings. Input 1 for Extruders (I only have one extruder). For G-code settings, leave Alternative Snapshot Commands blank (No G4 P1 command). Using Sembazuru's G-code does not require this command, at least for me. Do not enable Suppress Snapshot Command when disabled. Enable Snapshot G-code Axis Compatibility Mode and Save.

Go to Stabilization tab/Back Left. Go to Trigger tab/Smart-Gcode. Go to Rendering/MP4-30 FPS. Go to Camera tab and configure correct camera settings (Make sure to enable Custom Image Preferences in Camera Settings). Go to Logging/log all errors. Go to About and don't make any changes. Finally, click Save and you should be done. Upload model to Octolapse and print. I am using a USB Webcam.

I hope this helps to guide you through the the process of taking a time-lapse video using Octolapse to take snapshots of your 3D prints before laying down the first layer.