Resume print after filament runout

What is the problem?

WRITE HERE
when the filament sensor runs out the printer behaves weird. it will home and wait for a second and then it will ask on the printer if i want to resume and in octoprint it shows t0 fillament runout but then continues back to the print without me selecting any resume options and does a weird wiping motion before ultimately causing complete failure where the printer shuts down. the printer also doesnt acknowledge when i cancel the print from octoprint on the screen but the print will cancel and vice versa. I have host action enabled but it seems to not work properly I am sure I am probably just missing something but I am just trying to find a way to make sure all of the sensors on the printer are working properly through octoprint so that i am able to monitor this print that will be pushing 5 days. any and all help is greatly appreciated. if you need any more info or need me to run any more tests just let me know what and how to do it!

What did you already try to solve it?

WRITE HERE
I have been troubleshooting it as much as possible with my limited knowledge and havent been able to find a solution i tried adding these code lines in the pause and resume gcode but it didnt change anything. pause

; relative XYZE
    G91
    M83
    
    ; retract filament, move Z slightly upwards
    G1 Z+5 E-5 F4500 
    
    ; absolute XYZE
    M82
    G90
    
    ; move to a safe rest position, adjust as necessary
    G1 X0 Y180

resume

; relative extruder
M83

; prime nozzle
G1 E-5 F4500
G1 E5 F4500
G1 E5 F4500

; absolute E
M82

; absolute XYZ
G90

; reset E
G92 E{{ pause_position.e }}

; move back to pause position XYZ
G1 X{{ pause_position.x }} Y{{ pause_position.y }} Z{{ pause_position.z }} F4500

; reset to feed rate before pause
G1 {{ pause_position.f }}

Have you tried running in safe mode?

WRITE HERE
yes it behaves the same way

Did running in safe mode solve the problem?

WRITE HERE
no it continues with the odd behavior

Systeminfo Bundle

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

WRITE HERE
octoprint-systeminfo-20241018071229.zip (351.2 KB)

Additional information about your setup

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

WRITE HERE
octoprint-logs(10).zip (371.8 KB)

"Send: M115
Recv: FIRMWARE_NAME:Marlin 2.0.8.2 (Oct  9 2024 22:05:34) SOURCE_CODE_URL:github.com/MarlinFirmware/Marlin PROTOCOL_VERSION:1.0 MACHINE_TYPE:SanLu S9 Series EXTRUDER_COUNT:1 UUID:cede2a2f-41a2-4748-9b12-c55c62f367ff
Recv: Cap:SERIAL_XON_XOFF:0
Recv: Cap:BINARY_FILE_TRANSFER:0
Recv: Cap:EEPROM:1
Recv: Cap:VOLUMETRIC:1
Recv: Cap:AUTOREPORT_POS:0
Recv: Cap:AUTOREPORT_TEMP:0
Recv: Cap:PROGRESS:0
Recv: Cap:PRINT_JOB:1
Recv: Cap:AUTOLEVEL:1
Recv: Cap:RUNOUT:1
Recv: Cap:Z_PROBE:1
Recv: Cap:LEVELING_DATA:1
Recv: Cap:BUILD_PERCENT:0
Recv: Cap:SOFTWARE_POWER:0
Recv: Cap:TOGGLE_LIGHTS:0
Recv: Cap:CASE_LIGHT_BRIGHTNESS:0
Recv: Cap:EMERGENCY_PARSER:0
Recv: Cap:HOST_ACTION_COMMANDS:1
Recv: Cap:PROMPT_SUPPORT:1
Recv: Cap:SDCARD:1
Recv: Cap:REPEAT:0
Recv: Cap:SD_WRITE:1
Recv: Cap:AUTOREPORT_SD_STATUS:0
Recv: Cap:LONG_FILENAME:0
Recv: Cap:THERMAL_PROTECTION:1
Recv: Cap:MOTION_MODES:0
Recv: Cap:ARCS:1
Recv: Cap:BABYSTEPPING:1
Recv: Cap:CHAMBER_TEMPERATURE:0
Recv: Cap:COOLER_TEMPERATURE:0
Recv: Cap:MEATPACK:0
Recv: ok"

This is the block of code that comes out when the sensor detects runout.

"Recv: //action:prompt_end
Recv: //action:prompt_begin FilamentRunout T0
Recv: //action:prompt_show
Recv: //action:paused filament_runout 0
Printer signalled that it paused, switching state...
Changing monitoring state from "Printing" to "Pausing"
Recv: echo:busy: processing
Recv: echo:busy: processing
Recv: echo:busy: processing
Recv: ok
Changing monitoring state from "Pausing" to "Paused"
Send: M105
Recv: Writing to file: /PLR
Recv: echo:busy: processing
Recv: echo:busy: processing
Recv: echo:busy: processing
Recv: //action:pause
Pausing on request of the printer...
Recv: echo:busy: processing
Recv: echo:busy: processing
Recv: X:0.00 Y:0.00 Z:5.00 E:68.37 Count X:0 Y:0 Z:2000
Recv: echo:busy: processing
Recv: echo:busy: processing
Recv: echo:busy: processing
Recv: echo:busy: processing
Recv: echo:busy: processing
Recv: echo:busy: processing
Recv: echo:busy: processing
Recv: ok
Send: M105
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:244.38 /245.00 B:90.68 /90.00 @:74 B@:0
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:244.38 /245.00 B:90.68 /90.00 @:74 B@:0
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:244.38 /245.00 B:90.68 /90.00 @:74 B@:0
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:244.38 /245.00 B:90.68 /90.00 @:74 B@:0
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:244.38 /245.00 B:90.68 /90.00 @:74 B@:0
Send: M105
Recv: echo:busy: processing
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:244.61 /245.00 B:90.75 /90.00 @:70 B@:0
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:244.69 /245.00 B:90.73 /90.00 @:69 B@:0
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:244.69 /245.00 B:90.74 /90.00 @:69 B@:0
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:244.84 /245.00 B:90.73 /90.00 @:67 B@:0
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:244.84 /245.00 B:90.70 /90.00 @:67 B@:0
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:244.77 /245.00 B:90.70 /90.00 @:69 B@:0
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:245.00 /245.00 B:90.68 /90.00 @:64 B@:0
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:245.00 /245.00 B:90.68 /90.00 @:65 B@:0
Send: M105
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:245.00 /245.00 B:90.68 /90.00 @:65 B@:0
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:245.00 /245.00 B:90.68 /90.00 @:65 B@:0
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:245.00 /245.00 B:90.68 /90.00 @:65 B@:0
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:245.00 /245.00 B:90.68 /90.00 @:65 B@:0
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:245.00 /245.00 B:90.65 /90.00 @:66 B@:0
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:245.00 /245.00 B:90.61 /90.00 @:66 B@:0
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:245.08 /245.00 B:90.54 /90.00 @:64 B@:0
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:245.08 /245.00 B:90.54 /90.00 @:64 B@:0
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:245.08 /245.00 B:90.54 /90.00 @:65 B@:0
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:245.08 /245.00 B:90.50 /90.00 @:65 B@:0
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:245.31 /245.00 B:90.45 /90.00 @:60 B@:0
Recv: ok
Recv: ok
Send: M105
Recv: ok
Recv: ok T:245.47 /245.00 B:90.41 /90.00 @:58 B@:0
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:245.31 /245.00 B:90.41 /90.00 @:61 B@:0
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:245.55 /245.00 B:90.40 /90.00 @:57 B@:0
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:245.94 /245.00 B:90.28 /90.00 @:50 B@:0
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:246.02 /245.00 B:90.27 /90.00 @:48 B@:0
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:245.78 /245.00 B:90.27 /90.00 @:53 B@:0
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:246.09 /245.00 B:90.18 /90.00 @:47 B@:0
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:245.86 /245.00 B:90.14 /90.00 @:52 B@:0
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:246.02 /245.00 B:90.14 /90.00 @:49 B@:0
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:245.94 /245.00 B:90.03 /90.00 @:51 B@:0
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:245.86 /245.00 B:90.00 /90.00 @:52 B@:0
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:245.63 /245.00 B:90.00 /90.00 @:56 B@:0
Recv: ok
Recv: ok
Send: M105
Recv: ok
Recv: ok T:246.25 /245.00 B:89.96 /90.00 @:44 B@:127
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:246.25 /245.00 B:89.86 /90.00 @:44 B@:127
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:245.86 /245.00 B:89.86 /90.00 @:52 B@:127
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:245.78 /245.00 B:89.78 /90.00 @:53 B@:127
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:245.94 /245.00 B:89.73 /90.00 @:50 B@:127
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:245.70 /245.00 B:89.73 /90.00 @:54 B@:127
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:245.55 /245.00 B:89.66 /90.00 @:56 B@:127
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:245.31 /245.00 B:89.62 /90.00 @:60 B@:127
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:245.00 /245.00 B:89.59 /90.00 @:65 B@:127
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:245.00 /245.00 B:89.59 /90.00 @:64 B@:127
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:245.00 /245.00 B:89.56 /90.00 @:64 B@:127
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:245.00 /245.00 B:89.50 /90.00 @:64 B@:127
Recv: ok
Recv: ok
Send: M105
Recv: ok
Recv: ok T:245.00 /245.00 B:89.46 /90.00 @:63 B@:127
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:245.00 /245.00 B:89.46 /90.00 @:63 B@:127
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:245.00 /245.00 B:89.46 /90.00 @:62 B@:127
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:244.92 /245.00 B:89.43 /90.00 @:63 B@:127
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:244.77 /245.00 B:89.35 /90.00 @:66 B@:127
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:244.53 /245.00 B:89.33 /90.00 @:70 B@:127
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:244.84 /245.00 B:89.32 /90.00 @:64 B@:127
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:244.69 /245.00 B:89.32 /90.00 @:67 B@:127
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:244.14 /245.00 B:89.32 /90.00 @:76 B@:127
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:244.61 /245.00 B:89.32 /90.00 @:67 B@:127
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:244.53 /245.00 B:89.32 /90.00 @:69 B@:127
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:244.30 /245.00 B:89.28 /90.00 @:73 B@:127
Recv: ok
Send: M105
Recv: ok
Recv: ok
Recv: ok T:244.14 /245.00 B:89.30 /90.00 @:75 B@:127
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:244.14 /245.00 B:89.26 /90.00 @:75 B@:127
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:244.22 /245.00 B:89.25 /90.00 @:74 B@:127
Recv: ok
Recv: ok
Recv: ok
Recv: ok T:244.30 /245.00 B:89.26 /90.00 @:72 B@:127
Recv: ok T:244.30 /245.00 B:89.26 /90.00 @:72 B@:127
Recv: ok T:244.30 /245.00 B:89.26 /90.00 @:72 B@:127
Recv: ok T:244.30 /245.00 B:89.26 /90.00 @:72 B@:127
Recv: ok T:244.30 /245.00 B:89.26 /90.00 @:72 B@:127
Recv: ok T:244.30 /245.00 B:89.26 /90.00 @:72 B@:127
Recv: ok T:244.30 /245.00 B:89.26 /90.00 @:72 B@:127
Recv: ok T:244.30 /245.00 B:89.26 /90.00 @:72 B@:127
Send: M105
Recv: ok T:244.77 /245.00 B:89.19 /90.00 @:65 B@:127
Send: M105
Recv: ok T:245.00 /245.00 B:89.25 /90.00 @:63 B@:127
Send: M105
Recv: ok T:245.00 /245.00 B:89.32 /90.00 @:64 B@:127
Send: M105
Recv: ok T:245.23 /245.00 B:89.54 /90.00 @:60 B@:127
Send: M105
Recv: ok T:245.16 /245.00 B:89.73 /90.00 @:61 B@:127"

As I told you already in another thread:

Also, always format your code as Preformatted Text, else things can get lost.

Format

sorry I forgot. I edited it to be preformatted. can you help me figure this out?

1 Like

Hey ewald, i would really appreciate any help, this is delaying my project majorly and i would like to be able to figure out.

What printer and what firmware are you using? it sure sounds like host actions isn't really enable, particularly if you can't stop the print from the printer's own control screen. You should also be aware that some use sensors that direct connect to a raspberry pi running octopi. This can be good and bad. The good is I THINK the sensors that can detect if no filament is moving (i.e., perhaps a jammed spool) versus no filament physically being present. I have no experience with those and have read they are good but can also be tricky to get working in octopi. If it's something like the anycubic filament out detector I think it is a simple switch - it just detects when the filament is no longer present but not when a spool is jammed and the filament isn't moving. I believe Marlin firmware is what requires host actions on and when I read all of it you have to completely rebuild the Marlin firmware. I asked on the anycubic kobra 2 facebook if anyone had successfully gotten this to work but got no replies. I tried like heck but couldn't the anycubic marlin firmware source. To use the "regular" Marlin source there are all kinds of things you have to know about your printer and motherboard to configure it prior to building it. I decided I wasn't in need of that at this time. I would like to be able to use the printer's control screen even while octoprint is controlling the printer but I can live without it until I learn a heck of a lot more about the firmware and building the firmware.

I am using the sunlu s9+ with marlin 2.0 from their website. I enabled host action and it says it is turned on the problem I think I am having is I am recieving paused filament_runout 0 but I am not sure where in marlin that function is I have searched for it and everything looks to be proper but I am not sure which setting will enable paused filament_runout if there is a gcode to set it to 1 that would probably fix my specific problem

This firmware is doing incredibly weird stuff.

First it signals that the print should be considered paused, and that it has handled everything (action:paused, this means OctoPrint won't send its GCODE scripts). Then a few seconds later it tells OctoPrint to pause through action:pause - which it already has. Additionally it is abusing the prompt action for a completely nonsensical notification.

Sorry to say, but this looks like a really wonky firmware implementation, the workflow it is presenting doesn't make a ton of sense. What it should be doing is either send action:paused and handle the pause completely on its own, as in manage the parking position, temperature management, filament swap etc, or send action:pause and leave all of that to OctoPrint/you. And whatever it is doing doesn't reflect in your serial.log at all, all I'm seeing there is OctoPrint receiving M105 responses while it's paused. It also means that your pause/resume GCODE scripts are currently not used at all.

Is that mainline Marlin or something from your printer vendor? If the latter, I strongly suggest to drop that. And did you prepare that systeminfo bundle after those weird movements of the printer had finished?

Maybe someone else has an idea of what exactly is going wrong here if this is in fact mainline Marlin, I'm a bit out of the loop tbh with recent code changes. Though 2.0.8.2 sounds a bit old given that the latest release is 2.1.2.4. Marlin releases show that 2.0.8.2 was tagged in 2021, so my guess is this is a vendor fork? I can only always recommend to stay away from vendor provided firmware, they usually don't test with any host software, fiddle around with stuff they don't seem to understand particularly well, and the consequence is breakage all over.

I am in the middle of moving but when i get my printer setup next week i can send the serial log over, it is infact provided by sunlu its their update and it broke a lot of things but gave me access to host action which isnt much help with how its behaving! Im trying to figure out how to migrate the new version of marlin with the sunlu menus because im not sure what menu to go with otherwise, any advice in this aspect would be helpful! Your insight is explaining my exact problem and im trying to figure out why it would send the m105 signal but i figure its probably easiest to try and create a marlin build on the newest 2.1.2.4 version! Im new to this and dont do coding at all but i would love to get this working proper!