As far as I know, the Prusa Mk4 does not report back to Octoprint that the filament has run out and it needs changing. The Prusa Mk3 does and its really helpful on long prints.
Prusa is not making any attempt to fix this issue, despite it been raised as a defect. I have no confidence they will do.
So I started thinking about what the options are here:
- I could try and update the firmware but discarded that as a stupid idea. A lot of effort to learn it and no guarantee that it would work/
- Pressure on Prusa to implement the right command. That's still underway.
- Put a camera on it and train some tool or bot to recognise when the head is in more or less the right place and has been there without moving for a minute or so. No reason why it can't be done. My knowledge of bots and visual AI is limited, but a small model to train it could be done.
- Query the printer every 30 secs or so and see if 1. The printer has a job to print. 2. has anything extruded for 30 secs OR/AND the extruder head hasn't moved for 60-120 secs. If so send an alert out using Octotext or whatever.
The easiest option appears to be the last one, a simple plugin that checks if something is printing, something is moving (X,Y,Z) in the last 90 secs OR extruder has done something in last 90 secs.
To my mind, if the extruder is in the same position on the right of the printer (Mk4) and not moved, then its worth an alert.
So a simple plugin, that runs every 60 secs, checks if something is printing, if so it then checks what the X, Y and Z positions are, checks what the positions were 60 secs ago, if within 1% or something of those positions, then pings an alert out using the yet-to-be-found alert framework within Octoprint
So I had a look around, I have no idea how to write a plugin, but we'll cross that bridge if and when I come to it. I had a trawl through the API and I couldn't see if that information exists but I can see that a marlin code M114 returns some information. Tried in a shell and got
[...]
Send: M114
Recv: X:1.38 Y:200.00 Z:52.60 E:47.80 Count X: 0.00 Y:200.44 Z:52.57 E:47.80
Recv: ok
Looks about right as I glance at the Mk3. No idea if it works on a Mk4 as thats six hours into a 12 hour print and I am not messing that up
This is all a bit high level, but does my logic stand up?
All views welcomed
Rob