-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ENHANCEMENT] [OctoPrint support] Printer state information is not passed to host over serial #3748
Comments
In this case not a bug but a feature request, as most SD card related commands haven't yet been implemented so far (as SD card isn't used anymore but USB is used instead). As for M27, I already filed the PR #3739. It would be helpful if you can state the issued commands by octoprint with the "S" flag for auto report so I can trace back which functionality needs to be added to the xbuddy firmware. Thanks. |
After "MK3S+" -> "MK3.5" upgrade it's a regression for me, so a bug. But naming doesn't matter for me. I get your thinking. New printer family, new software, new start. You can change label to feature request etc if you want.
so
Unfortunately I guess that won't be enough. Old 8-bit firmware and also Marlin 1 or Marlin 2 prints various texts on serial that OctoPrint uses to figure out what is happening. All that sits in src/octoprint/util/comm.py in _monitor():
Failure or "umounted" media. On M22 or just automatically after media failed insert/release.
"Mounted" / available media. On M21 or just automatically after media insert.
("Writing to file: " == MSG_SD_WRITE_TO_FILE is called in CardReader::openFile() but no idea if this method is called by Buddy firmware)
That's pretty important for monitoring progress and showing/estimating end of print time or time until filament change on host. Old 8bit firmware did that in simple way: Marlin 2 got this implemented not long time ago in more generic way, so that could be an inspiration, too MarlinFirmware/Marlin#24714
Cap:HOST_ACTION_COMMANDS Not sure if I found out everything needed. I could miss something.
|
@arekm thanks for the detailed explanation. I cannot change the label as I'm not a prusa dev :) I'll start having a look at "M154 - Auto Report Position / Cap:AUTOREPORT_POSITION". |
Ok, M154 doesn't seem to be implemented at all (not in Marlin and not in MK3 firmware) |
Hmm
Note: "Cap:AUTOREPORT_POSITION:1". Maybe it works without M154 being called. Ah, yes, M114 (and M114 is also called by OctoPrint). Best way on what to choose to implement for better OctoPrint support would be by looking into serial.log from MK3S+ print job started from LCD. Sadly my OctoPrint rotated logs deleting all my serial.log files with jobs started from MK3S+ :/ And my printer is already upgraded to MK3.5. (well, there is https://github.com/vintagepc/MK404) |
I've just added M20 options in PR #3765. |
M114 does exist actually and it also works fine. |
Nice. So the question now is if the firmware should (like 8bit) or should not report AUTOREPORT_POSITION capability. Edit: Octoprint isn't using M155 C. So M154 could be implemented in 32bit firmware, OctoPrint would use this but all that would be a new thing that wasn't available (to OctoPrint) before. |
Yes, seems to be a bug on the MK3. So M154 doesn't exist, thus no Cap:AUTOREPORT_POS:1 is given, which is correct behaviour on the MK4. |
M73 is disabled as "LCD_SET_PROGRESS_MANUALLY" isn't enabled. So seems to be intended behaviour on the MK4. |
Probably they don't want to support "M73 P" which is fine [1] but M73 report was the only way for host (OctoPrint) to get information about print progress and more importantly estimated times when job was started from sd/usb media. Marlin2 firmware splits that into separate options: SET_PROGRESS_PERCENT for "P" and M73_REPORT for reporting to host and M73_REPORT is what's missing mainly https://github.com/MarlinFirmware/Marlin/blob/2.1.2.2/Marlin/src/gcode/lcd/M73.cpp#L76C3-L91C9
|
ok, so added M73 report functionality as a PR #3767. |
Got MK404 running, so two logs that can be useful in future:
mk3s-print-from-octoprint-serial.txt
|
@arekm Thank you very much for your hard work tracking and reporting this, much appreciated! |
PR #3739 couldn't be merged because it didn't pass the approbation control yet. PR #3765 couldn't be merged because it didn't pass the approbation control yet. PR #3767 - same as PR #3766 - was merged before the last firmware release so it is already implemented, theoretically. Michele Moramarco |
Printer type - MK3.5
Printer firmware version - 5.2.0
Original or Custom firmware - Original
USB drive or USB/Octoprint
USB flash drive - that's important. Prints are started from printer LCD screen, from USB drive.
Describe the bug
MK3S+ firmware informed host (OctoPrint) over serial about what is the state of the printer.
For example if you started print from sd card then OctoPrint knew that. When print finished - the same. On pause - the same.
OctoPrint with such knowledge was able to start timelapse recording when print was started (from lcd) and finish it when it ended. And do much more like turn on LED lighting at print start, turn off at end of print. Send notification about printer state to the user phone (using OctoPod plugin) and more.
All that functionality is lost with 32bit firmware.
How to reproduce / Expected behavior
Connect Octoprint to MK3.5/MK4 printer. Start print from LCD. OctoPrint should see that print has started. Stop the print from LCD. OctoPrint should also see that fact.
Logs
Example from MK3S+ log for a print started from MK3S+ LCD:
Notice that OctoPrint recognized that print started - "Changing monitoring state from "Operational" to "Starting print from SD"", "Changing monitoring state from "Starting print from SD" to "Printing from SD""
MK3.5 puts zero information over serial about printer state which means OctoPrint never sees that print from USB flash drive is happening.
(that's mostly all)
Related - HOST_ACTION_COMMANDS but not sure if that was fully supported in MK3S+. Partially at least I think.
The text was updated successfully, but these errors were encountered: