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
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
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.
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
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.