Error:! KILL caused by too much inactive time - current command: M400

What is the problem?

For few months now ive been having a issue where after a print finishes i get the following message from octopi : Error:!! KILL caused by too much inactive time - current command: M400
when i check the serial log i get the following
2023-03-08 09:31:12,742 - No response from printer after 3 consecutive communication timeouts, considering it dead. Configure long running commands or increase communication timeout if that happens regularly on specific commands or long moves.
2023-03-08 09:31:17,829 - Changing monitoring state from "Operational" to "Offline after error"
2023-03-08 09:31:17,859 - Connection closed, closing down monitor

What did you already try to solve it?

1: recompiling marlin
2: replace mainboard from skr mini 1.2 to 2.0 ( usb port was loose)
3. tried 5 different cables across 4 brands ( BTT included , amazon basic, Wago, and seimens)
4. Gotten emf reader to make sure there are no crazy EMI fields
5. moved printer to a separate grounded circuit

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!)
octoprint-systeminfo-20230312013832.zip (280.8 KB)

Additional information about your setup

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

In a grounded server cabinet
Ikea cabinet lights taped on roof
Printer is a Ender 3 pro with a bl touch and dual z
mainboard was an skr mini 1.2 now is a skr mini 2.0
raspberry pi 3b+ running octopi using mainboard included cable

Never during a print?
How long after the print finished?

Ranges From 5 to 10 min

Also never during a print

I'm asking because in the serial.log you provided it was pretty much exactly 15 mins.

If It's always 15 mins something might cause it it on purpose like a timeout in the firmware or something.
Just a theory.

Marlin firmware or octoprint side ?

Ah yes found it (it's on the marlin side)
Missed it somehow on the first time

2023-03-12 01:35:58,884 - Recv: Error:!! KILL caused by too much inactive time - current command: M400

So it's a 15 mins timeout after the M400 command. Some command doesn't finish. I'm trying to figure out which one

K I think I got it.
The M400 gcode is supposed to be at the beginng of your end gcode in the slicer - not at the end of it.
Mine looks like this

M400
G91 ;Relative positioning
G1 E-2 F2700 ;Retract a bit
G1 E-2 Z0.2 F2400 ;Retract and raise Z
G1 X5 Y5 F3000 ;Wipe out
G1 Z10 ;Raise Z more
G90 ;Absolute positionning

The issue is that M400 tells marlin to wait until all other gcodes are finished before it should execute the next commands.
But your last commands where cool down the bed and hotend and there were no commands to execute after M400.
I don't know exactly what happens on the marlin side - but I guess it crashes after the timeout or disconnects the printer as a safety feature.

so my end gcode looks like this:

G91 ;Relative positioning

G1 E-2 F2700 ;Retract a bit

G1 E-2 Z0.2 F2400 ;Retract and raise Z

G1 X5 Y5 F3000 ;Wipe out

G1 Z10 ;Raise Z more

G90 ;Absolute positioning

G1 X0 Y{machine_depth} ;Present print

M106 S0 ;Turn-off fan

M104 S0 ;Turn-off hotend

M140 S0 ;Turn-off bed

M84 X Y E ;Disable all steppers but Z

my beginning looks like :

; Ender 3 Custom Start G-code

G92 E0 ; Reset Extruder

G28 ; Home all axes

G29 ; ABL

M85 S900

M104 S{material_standby_temperature} ; Start heating up the nozzle most of the way

M190 S{material_bed_temperature_layer_0} ; Start heating the bed, wait until target temperature reached

M109 S{material_print_temperature_layer_0} ; Finish heating the nozzle

G1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed

G1 X0.1 Y20 Z0.3 F5000.0 ; Move to start position

G1 X0.1 Y200.0 Z0.3 F1500.0 E15 ; Draw the first line

G1 X0.4 Y200.0 Z0.3 F5000.0 ; Move to side a little

G1 X0.4 Y20 Z0.3 F1500.0 E30 ; Draw the second line

G92 E0 ; Reset Extruder

G1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed

G1 X5 Y20 Z0.3 F5000.0 ; Move over to prevent blob squish

unsure where the m400 is

Interesting.
I wonder where that M400 comes from.
Is there anything in the OctoPrint end gcode?

only here nothing else

Could you upload the gcode of that print?
If it's a large file just zip it.

abt cube.gcode (152.4 KB)

Hm no M400 in there. So it comes from OctoPrint.

You said that safe mode didn't change anything? I really can't explain where it comes from.

ill try again in safe mode and wait the 15 min to see what happens again
but if safe mode does fix this is it a plug in error?

Yep. That's the only option left imo.
Some plugin sends that gcode after the print has finished.

ran the print 3 times in safe mode still same issue
image

Can you upload the systeminfo bundle with a safe mode run inside?

I noticed, that you always restarted the Pi by power cycling it, yes?

You are enabling your firmware's inactivity timer in your start code and set it to a timeout of 15min:

M85 S900

You never disable it in your end code and since your firmware supports auto reporting, there's no reason for OctoPrint to regularly send commands to your printer outside of a job, and thus the timeout gets triggered.

Disable the inactivity timer in your end code and also OctoPrint's cancel script. Should be M85 S0 I guess.

3 Likes

system info with safe mode.zip (59.2 KB)

wouldn't that just shorten the timer not disable it so instead of halting at 15 min it would halt/kill right after a print?