Hello, and thanks for your work on this plugin! I've been using it for a while now.
I've been doing a lot of research into how the MMU output works, so I decided to implement a lot of what I've learned here, to display more info in the navbar.
I'm pretty new to python, and almost completely new to GitHub and Octoprint plugins, so sorry if I did something wrong. I've tried to replicate your code style, but I've changed things a lot in some areas. If you need to edit anything for any reason, go right ahead.
Other than that, I've thoroughly tested on my 3.0.0 MMU, including a small multicolor print, and I don't see any issues. I haven't tested on a lower MMU firmware, but in theory it should still work the same way it used to. Might be good to give it a quick test if possible though.
Detection and display of "Preload to MMU", "Cutting", and "Ejecting" MMU States
Display MMU progress messages in the navbar alongside the current state
Display MMU error messages in the navbar alongside the current state
Fixed Bugs:
Fix directional arrows being wrong in navbar for filament changes
Fix previous filament showing up when doing a final unload
Fix other strange navbar display issues
Fixed a bunch of small bugs relating to MMU 3.x.x state detection edge cases
In-depth Changes:
Added LOADING_MMU, CUTTING, and EJECTING states
I only coded detections for the MMU 3.x.x firmware, not sure if possible for older MMUs
Completely redid MMU 3.x.x state checking
A general REGEX check in gcode_received_hook quickly returns most useless lines with just one check
A single REGEX search splits the MMU response into 4 convenient groups
All states except for ATTENTION and PAUSED_USER are found by looking at the MMU output
Added an extra span to the navbar to display the extra message text for status messages and errors
The text is blank unless there's a progress or error message. It's also blank if the message is just F0 - Finished
Removed MMU3Commands
I put a couple other lines in MMU3Codes instead. It's not quite right, but I thought having 4 different sections was kind of pointless
Added MMU3RequestCodes and MMU3ResponseCodes
Added a TON of documentation in Mmu.py about these codes
Removed MmuKeys.ERROR
Added MmuKeys.RESPONSE which contains the MMU's response code: F, P, E, etc
Added MmuKeys.RESPONSE_DATA which contains the data from the response code. For example, the data after the E in Exxxx response codes
Removed MmuKeys.LIVE_STATE
We can just use self.mmu[MmuKeys.STATE] to look up the current state before we change it
Added MmuKeys.LAST_LINE
The entire last matched MMU line we care about is stored, and used for spamminess reduction in gcode_received_hook itself. Seems to work flawlessly with my tests
Removed deduplication from _fire_event. All initial spamminess reduction is done in gcode_recieved_hook
Actual deduplication is all done in on_event. I've edited it to allow changes to response and responseData to fire MMU_CHANGED and update the navbar
Added mmuProgress.js, which allows looking up the progress messages that the MMU sends while responding
Filled out the remaining error messages in mmuErrors.js
As noted in the comment, it's possible for the Temperature and Electrical errors to have multiple cases at once, and produce a strange code. It's a complicated fix, so for now I just filled in the error codes for the single cases, which should be the most common
Removed the E from the error codes. Since the E response code and the responseData are split up now, it's easier to look at the single letter response code in prusammu.js, and just send the responseData itself to mmuErrors.js. mmuProgress.js works the same way
Changed STATES.OK text from "Ready" to "Idle". "Ready" looked strange when an error occurred: "Ready -> ERROR"
Various other changes to fix subtle bugs as I came across them
Hello, and thanks for your work on this plugin! I've been using it for a while now.
I've been doing a lot of research into how the MMU output works, so I decided to implement a lot of what I've learned here, to display more info in the navbar.
I'm pretty new to python, and almost completely new to GitHub and Octoprint plugins, so sorry if I did something wrong. I've tried to replicate your code style, but I've changed things a lot in some areas. If you need to edit anything for any reason, go right ahead.
Other than that, I've thoroughly tested on my 3.0.0 MMU, including a small multicolor print, and I don't see any issues. I haven't tested on a lower MMU firmware, but in theory it should still work the same way it used to. Might be good to give it a quick test if possible though.
Here's a quick video I made showing the new features and fixes in action. https://www.youtube.com/watch?v=KW_aa21Af64
New Features:
Fixed Bugs:
In-depth Changes: