jukebox42 / Octoprint-PrusaMMU

An Octoprint plugin that adds MMU support.
GNU Affero General Public License v3.0
13 stars 2 forks source link

MMU not found #43

Open Anubis1971 opened 2 months ago

Anubis1971 commented 2 months ago

Behaviors:

Perhaps Octoprint not recognizing MMU3 is the problem. If not, then I believe when single color printing, the filament select should appear regardless of the profile used.

jukebox42 commented 2 months ago

Hm interesting, I haven't tested with a 3.5 before (i've only got a 3s) so there may be something interesting in the firmware. You may be the first 3.X user to try this plugin :).

Would you be able to send me two logs from the octoprint terminal? They don't have to be complete I just want to see what commands are coming back, I might have to make some tweaks.

  1. From when octoprint connects to the printer to after the MMU finishes it's initialization.
  2. When the printer gets up to temp and starts a print.

Just to confirm:

Using a profile that does not include the MMU (your last test) is expected to fail and print air. Prusa expects you to manually feed the filament in if you slice without the MMU since the MMU won't receive any load commands from the gcode. I'm fairly certain the filament runoff sensor will malfunction in this case because it's expecting to be paired with the sensor on the MMU. To go back to printing without the MMU you need to remove the power connectors.

Anubis1971 commented 2 months ago

Hopefully I am providing the correct logs which you are requesting.

1) Octoprint connected to Printer and MMU3 intialize Log 1 (Octoprint connect to 3.5 with MMU3).txt

2) Start print with 3.5 + MMU3 profile default extruder. With this condition, no filament popup and MMU3 tries to load slot 0. Log 2 (Sliced with 3.5 + MMU3 Profile - Default Extruder).txt

3) Start print with normal single extruder 3.5 profile. No filament selection popup. Prints starts but prints nothing since no filament is loaded. Log 3 (Sliced with Regular 3.5 Profile).txt

NOTE: If I do a "load to nozzle" #3 (from above) works fine. I prefer non MMU3 profile for single color because it's faster. Save time for longer prints.

To answer your questions:

Ideally, if MMU3 is present and default extruder used, a pop up should appear. Likewise, if single extruder profile is used and MMU3 is present a popup should also occur.

If I recall correctly, prior to upgrading to 3.5, the MK3S+ + MMU3 had a profile called MMU3 Single. When that profile was used, a pop would appear. Not sure what the difference is between those profiles, but it worked well.

MysticGringo commented 2 months ago

A similar situation exists on the MK4 and MMU3. Prusa has not included a "single mmu" profile. Prints made with the MK4/MMU3 profile work as expected. Prints with just MK4 profile don't trigger any action from Octoprint (no pop-up) nor the MMU and it does not load any filament, and prints air.

I can provide logs and more detail if needed.

jukebox42 commented 2 months ago

Oh, that's interesting. I didn't realize they omitted the single mmu profile on the 3.X/4 models. I wonder if this means there's no single selection option being omitted. I just loaded some profiles in my slicer and i'm going to do some digging.

I'm not sure how i'm going to solve it yet. the popup shows because the printer sends a Tx when slicing with single mode. If the single mode doesnt exist I assume that means it's not sending a Tx

jukebox42 commented 2 months ago

Alright I did some digging, it looks like they undid a lot of the support they added for the MMU3 from the MK3. It seems to resemble closer to what we used to get with the MMU2 in terms of reporting.

Would one of you be able to send me a successful load?

Looking at the second log, I can see the load being sent but it looks like it failed.

I'm hoping to see these three commands:

Recv: echo:MMU2:Feeding to FINDA
Recv: echo:MMU2:Feeding to extruder
Recv: echo:MMU2:Feeding to nozzle

followed by a:

Recv: echo:MMU2:Disengaging idler
Anubis1971 commented 2 months ago

@jukebox42 Thank you for looking into this. Do you mean gcode which automatically loads filament? If so, the only way that works is if sliced with a specified extruder instead of using default. Will that log work for you?

jukebox42 commented 2 months ago

Oh, yeah, I just want to see the Octoprint log when the mmu starts loading filament and succeeds. Doesn't matter what slice profile you use. I'm looking to see what it tells Octoprint so I know how to handle the state change. I found the code for it in their firmware I'm just not sure how much makes it to the serial connection.

This should help me fix the indicator. The single print popup is going to be a bit harder, it looks like they internalized that so I need to find another way to get at it.

Kjubyte commented 2 months ago

I did a small test print with one tool change in the middle: serial(1).log

I'm hoping to see these three commands:

Recv: echo:MMU2:Feeding to FINDA
Recv: echo:MMU2:Feeding to extruder
Recv: echo:MMU2:Feeding to nozzle

Almost correct, it's:

2024-04-27 19:36:34,768 - Send: N54 T0*11
2024-04-27 19:36:35,781 - Recv: echo:MMU2:Feeding to FINDA
2024-04-27 19:36:38,836 - Recv: echo:MMU2:Feeding to extruder
2024-04-27 19:36:40,894 - Recv: echo:MMU2:Feeding to FSensor
2024-04-27 19:36:44,142 - Recv: echo:MMU2:Disengaging idler
2024-04-27 19:36:45,158 - Recv: ResetRetryAttempts
2024-04-27 19:36:45,159 - Recv: echo:MMU2:CompensatedFeedDistance=50.0
2024-04-27 19:36:46,913 - Recv: ok

Change from t0 to t1:

2024-04-27 19:41:33,568 - Send: N1584 T1*3
2024-04-27 19:41:36,728 - Recv: echo:MMU2:Unloading to FINDA
2024-04-27 19:41:40,807 - Recv: echo:MMU2:Disengaging idler
2024-04-27 19:41:41,840 - Recv: echo:MMU2:Feeding to FINDA
2024-04-27 19:41:44,889 - Recv: echo:MMU2:Feeding to extruder
2024-04-27 19:41:46,931 - Recv: echo:MMU2:Feeding to FSensor
2024-04-27 19:41:50,130 - Recv: echo:MMU2:Disengaging idler
2024-04-27 19:41:51,150 - Recv: ResetRetryAttempts
2024-04-27 19:41:51,152 - Recv: echo:MMU2:CompensatedFeedDistance=50.0
2024-04-27 19:41:52,903 - Recv: ok

Unload at the end of the print:

2024-04-27 19:45:52,476 - Send: N3310 M702*23
2024-04-27 19:45:58,029 - Recv: X:241.00 Y:170.00 Z:40.00 E:-0.70 Count X:24100 Y:17000 Z:16000
2024-04-27 19:46:09,038 - Recv: echo:MMU2:Unloading to FINDA
2024-04-27 19:46:12,098 - Recv: echo:MMU2:Retract from FINDA
2024-04-27 19:46:13,116 - Recv: echo:MMU2:Disengaging idler
2024-04-27 19:46:14,136 - Recv: ResetRetryAttempts
2024-04-27 19:46:14,142 - Recv: echo:Hotend too cold
2024-04-27 19:46:14,143 - Recv: ok
Anubis1971 commented 2 months ago

I think this log is another example of what you are looking for.
Log (3.5 + MMU3 Load Extruder 4).txt

How come Octoprint doesn't even recogize the MMU3?

MysticGringo commented 2 months ago

serial.txt

Here's a log from my MK4 and MMU3. I took this mid print. This has a few loads and unloads.

2024-04-28 07:42:23,025 - Recv: echo:MMU2:Feeding to FINDA 2024-04-28 07:42:25,057 - Recv: echo:MMU2:Feeding to extruder 2024-04-28 07:42:27,103 - Recv: echo:MMU2:Feeding to FSensor 2024-04-28 07:42:35,758 - Recv: echo:MMU2:Disengaging idler 2024-04-28 07:42:36,775 - Recv: echo:MMU2:CompensatedFeedDistance=50.0 2024-04-28 07:44:25,667 - Recv: echo:MMU2:Unloading to FINDA 2024-04-28 07:44:29,748 - Recv: echo:MMU2:Disengaging idler 2024-04-28 07:44:30,770 - Recv: echo:MMU2:Feeding to FINDA 2024-04-28 07:44:32,799 - Recv: echo:MMU2:Feeding to extruder 2024-04-28 07:44:35,868 - Recv: echo:MMU2:Feeding to FSensor 2024-04-28 07:44:44,163 - Recv: echo:MMU2:CompensatedFeedDistance=50.0 2024-04-28 07:50:04,246 - Recv: echo:MMU2:Unloading to FINDA 2024-04-28 07:50:08,330 - Recv: echo:MMU2:Disengaging idler 2024-04-28 07:50:09,346 - Recv: echo:MMU2:Feeding to FINDA 2024-04-28 07:50:11,381 - Recv: echo:MMU2:Feeding to extruder 2024-04-28 07:50:13,430 - Recv: echo:MMU2:Feeding to FSensor 2024-04-28 07:50:22,082 - Recv: echo:MMU2:Disengaging idler 2024-04-28 07:50:23,099 - Recv: echo:MMU2:CompensatedFeedDistance=50.0 2024-04-28 07:52:50,333 - Recv: echo:MMU2:Unloading to FINDA 2024-04-28 07:52:54,411 - Recv: echo:MMU2:Disengaging idler 2024-04-28 07:52:55,426 - Recv: echo:MMU2:Feeding to FINDA 2024-04-28 07:52:57,462 - Recv: echo:MMU2:Feeding to extruder 2024-04-28 07:53:00,525 - Recv: echo:MMU2:Feeding to FSensor 2024-04-28 07:53:08,869 - Recv: echo:MMU2:CompensatedFeedDistance=47.9

jukebox42 commented 2 months ago

Thank you all, that was exactly what I was looking for, appreciate the help!

I'm starting a PR (#44) with the changes I need to make, it'll take me a few days to work through it (side project after all). Still working through how I'm going to handle single filament prints, I'm not seeing a tool command in that gcode but I'll keep digging. I should be able to have the mmu state detection done soon, but that's not really the best feature of this plugin.

I'll reach out when I need some testers :).

jukebox42 commented 1 month ago

Hello All,

I'm wondering if I could solicit a few of you to test out a new version before I publish. I've tested already with my MK3 to make sure there are no regressions. Attached is the alpha build. I would love if I could get an MK3.5, MK3.9 and MK4 to try it out. If you are curious what is in the build check the PR link above, it's up to date.

This version should add the MMU status data back into the nav bar. I don't have the filament selection modal figured out yet but gotta start somewhere :).

If you'd like to test:

Assuming this one works as expected I'll get it out so you all at least have that feature working while I figure the rest out.

Thank you in advance!

Octoprint-PrusaMmu.zip 3-lines.zip

jshank commented 1 month ago

EDIT: First, a huge thank you for providing this plugin. I've been grudgingly using PrusaConnect since upgrading to the MMU3 and this gives me hope that I'll be able to come back to Octoprint. I wasn't able to get to the point of printing the test files due to loss of connectivity. Hopefully my logs are useful. LMK if you need any other debugging.

From devtools

{
    "action": "debug",
    "msg": "firmware_info_hook: MK4 {\"FIRMWARE_NAME\": \"Prusa-Firmware-Buddy 6.0.0+14794 (Github)\", \"SOURCE_CODE_URL\": \"https://github.com/prusa3d/Prusa-Firmware-Buddy\", \"PROTOCOL_VERSION\": \"1.0\", \"MACHINE_TYPE\": \"Prusa-MK4\", \"EXTRUDER_COUNT\": \"1\", \"UUID\": \"REDACTED\"}"
}

I lose connection within a few seconds of connecting. Disabling the plugin resolves the issue and I can connect via serial again.

Changing monitoring state from "Offline" to "Detecting serial connection"
Performing autodetection with 1 port/baudrate candidates: /dev/ttyACM0@115200
Trying port /dev/ttyACM0, baudrate 115200
Connecting to port /dev/ttyACM0, baudrate 115200
Handshake attempt #1 with timeout 2.0s
Connected to: Serial<id=0x677e6a90, open=True>(port='/dev/ttyACM0', baudrate=115200, bytesize=8, parity='N', stopbits=1, timeout=2.0, xonxoff=False, rtscts=False, dsrdtr=False), starting monitor
Send: N0 M110 N0*125
Recv: ok
Changing monitoring state from "Detecting serial connection" to "Operational"
Send: N0 M110 N0*125
Recv: ok
Send: N1 M115*39
Recv: FIRMWARE_NAME:Prusa-Firmware-Buddy 6.0.0+14794 (Github) SOURCE_CODE_URL:https://github.com/prusa3d/Prusa-Firmware-Buddy PROTOCOL_VERSION:1.0 MACHINE_TYPE:Prusa-MK4 EXTRUDER_COUNT:1 UUID:REDACTED
Recv: Cap:SERIAL_XON_XOFF:0
Recv: Cap:BINARY_FILE_TRANSFER:0
Recv: Cap:EEPROM:0
Recv: Cap:VOLUMETRIC:1
Recv: Cap:AUTOREPORT_TEMP:1
Recv: Cap:PROGRESS:0
Recv: Cap:PRINT_JOB:1
Recv: Cap:AUTOLEVEL:1
Recv: Cap:Z_PROBE:1
Recv: Cap:LEVELING_DATA:1
Recv: Cap:BUILD_PERCENT:0
Recv: Cap:SOFTWARE_POWER:1
Recv: Cap:TOGGLE_LIGHTS:0
Recv: Cap:CASE_LIGHT_BRIGHTNESS:0
Recv: Cap:EMERGENCY_PARSER:0
Recv: Cap:PROMPT_SUPPORT:0
Recv: Cap:AUTOREPORT_SD_STATUS:0
Recv: Cap:THERMAL_PROTECTION:1
Recv: Cap:MOTION_MODES:0
Recv: Cap:CHAMBER_TEMPERATURE:0
Recv: ok
Recv: RSTCommTimeout
Recv: RSTCommTimeout
Recv: RSTCommTimeout
Communication timeout while idle, trying to trigger response from printer. Configure long running commands or increase communication timeout if that happens regularly on specific commands or long moves.
Send: M21
Recv: ok
Communication timeout while idle, trying to trigger response from printer. Configure long running commands or increase communication timeout if that happens regularly on specific commands or long moves.
Send: M105
Recv: ok T:19.00/0.00 B:20.42/0.00 X:20.06/36.00 A:29.48/0.00 @:0 B@:0 HBR@:0
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.
Changing monitoring state from "Operational" to "Offline after error"
Connection closed, closing down monitor

Once MMU plugin is disabled:

Performing autodetection with 1 port/baudrate candidates: /dev/ttyACM0@115200
Trying port /dev/ttyACM0, baudrate 115200
Connecting to port /dev/ttyACM0, baudrate 115200
Handshake attempt #1 with timeout 2.0s
Connected to: Serial<id=0x6b2fa8d0, open=True>(port='/dev/ttyACM0', baudrate=115200, bytesize=8, parity='N', stopbits=1, timeout=2.0, xonxoff=False, rtscts=False, dsrdtr=False), starting monitor
Send: N0 M110 N0*125
Recv: ok
Changing monitoring state from "Detecting serial connection" to "Operational"
Send: N0 M110 N0*125
Recv: ok
Send: N1 M115*39
Recv: FIRMWARE_NAME:Prusa-Firmware-Buddy 6.0.0+14794 (Github) SOURCE_CODE_URL:https://github.com/prusa3d/Prusa-Firmware-Buddy PROTOCOL_VERSION:1.0 MACHINE_TYPE:Prusa-MK4 EXTRUDER_COUNT:1 UUID:REDACTED
Recv: Cap:SERIAL_XON_XOFF:0
Recv: Cap:BINARY_FILE_TRANSFER:0
Recv: Cap:EEPROM:0
Recv: Cap:VOLUMETRIC:1
Recv: Cap:AUTOREPORT_TEMP:1
Recv: Cap:PROGRESS:0
Recv: Cap:PRINT_JOB:1
Recv: Cap:AUTOLEVEL:1
Recv: Cap:Z_PROBE:1
Recv: Cap:LEVELING_DATA:1
Recv: Cap:BUILD_PERCENT:0
Recv: Cap:SOFTWARE_POWER:1
Recv: Cap:TOGGLE_LIGHTS:0
Recv: Cap:CASE_LIGHT_BRIGHTNESS:0
Recv: Cap:EMERGENCY_PARSER:0
Recv: Cap:PROMPT_SUPPORT:0
Recv: Cap:AUTOREPORT_SD_STATUS:0
Recv: Cap:THERMAL_PROTECTION:1
Recv: Cap:MOTION_MODES:0
Recv: Cap:CHAMBER_TEMPERATURE:0
Recv: ok
Send: M21
Recv: ok
Send: M155 S2
Recv: ok
Recv:  T:19.00/0.00 B:20.33/0.00 X:19.88/36.00 A:27.53/0.00 @:0 B@:0 HBR@:0
Send: M20
Recv: Begin file list
--SNIP--
Recv: End file list
Recv: ok
Recv:  T:19.00/0.00 B:20.24/0.00 X:19.93/36.00 A:27.58/0.00 @:0 B@:0 HBR@:0
Recv:  T:19.00/0.00 B:20.24/0.00 X:19.90/36.00 A:27.76/0.00 @:0 B@:0 HBR@:0
MysticGringo commented 1 month ago

Yep, I get a "crash" every time I try to connect to the printer. The top bar says MMU Needs attention, unknown error. and directs me to: https://help.prusa3d.com/article/unknown-error-04900-mmu_484853

The display shows something about unloading filament manually with a retry button that doesn't do anything.

Disabling the plugin makes everything work again.

MK4 (6.0.0 - RC1), MMU3 (3.0.3), Octoprint (1.9.3)

jukebox42 commented 1 month ago

Huh, well that's unsettling. Could either of you look in your octoprint.log and see if there's a python error in there? I don't do any manipulation during a connection, I just read the metadata

MysticGringo commented 1 month ago

Maybe this (I am in design and construction, not coding, so not sure if this is helpful):

2024-05-13 17:18:40,725 - octoprint.util.comm - ERROR - Unexpected error while reading from serial port Traceback (most recent call last): File "/home/pi/oprint/lib/python3.9/site-packages/octoprint/util/comm.py", line 4081, in _readline ret = self._serial.readline() File "/home/pi/oprint/lib/python3.9/site-packages/octoprint/util/comm.py", line 6832, in readline c = self.read(1) File "/home/pi/oprint/lib/python3.9/site-packages/serial/serialposix.py", line 595, in read raise SerialException( serial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?)

That may be from a different error? After this print, I flush the log, turn on the plugin and restart everything to see what happens, and include the log here.

jshank commented 1 month ago

Octoprint Version 1.10.0 OctoPi Version 0.18.0, running on Raspberry Pi 3 Model B Rev 1.2

No python errors related to MMU in octoprint.log. I did find some python errors relating to the bgcode plugin. I used pip to remove it (another problem for another day) but it didn't change anything with the disconnects from MMU plugin.

Do I need to disable PrusaLink/PrusaConnect integrations?

octoprint.log

2024-05-13 15:51:28,281 - octoprint.plugins.tracking - INFO - Sent tracking event webui_load, payload: {'browser_name': 'Chrome', 'browser_version': '125.0.0.0', 'os_name': 'Mac OS', 'os_version': '10.15.7'}
2024-05-13 15:51:37,054 - octoprint.plugins.psucontrol - INFO - Switching PSU On
2024-05-13 15:51:37,568 - octoprint.util.comm - INFO - Changing monitoring state from "Offline" to "Detecting serial connection"
2024-05-13 15:51:37,618 - octoprint.util.comm - INFO - Serial detection: Performing autodetection with 0 port/baudrate candidates: 
2024-05-13 15:51:37,619 - octoprint.util.comm - INFO - Changing monitoring state from "Detecting serial connection" to "Error"
2024-05-13 15:51:37,631 - octoprint.util.comm - INFO - Changing monitoring state from "Error" to "Offline after error"
2024-05-13 15:51:37,673 - octoprint.plugins.enclosure - INFO - Detected Error in PrinterStateChanged id: ERROR state: Error  will call listeners for shutdown_on_error!
2024-05-13 15:51:37,807 - octoprint.plugins.enclosure - INFO - Detected Error or Disconnect in Error will call listeners for shutdown_on_error!
2024-05-13 15:51:37,918 - octoprint.server - INFO - Autorefresh of serial port list stopped
2024-05-13 15:51:37,924 - octoprint.server - INFO - Starting autorefresh of serial port list
2024-05-13 15:51:37,943 - octoprint.plugins.action_command_notification - INFO - Notifications cleared
2024-05-13 15:51:37,954 - octoprint.plugins.enclosure - INFO - Detected Error or Disconnect in Disconnected will call listeners for shutdown_on_error!
2024-05-13 15:51:38,545 - octoprint.plugins.tracking - INFO - Sent tracking event commerror_autodetect, payload: {'commerror_text': 'No more candidates to test, and no working port/baudrate combination detected.'}
2024-05-13 15:51:49,169 - octoprint.server - INFO - Serial port list was updated, refreshing the port list in the frontend
2024-05-13 15:51:56,645 - octoprint.util.comm - INFO - Changing monitoring state from "Offline" to "Detecting serial connection"
2024-05-13 15:51:56,742 - octoprint.util.comm - INFO - Serial detection: Performing autodetection with 1 port/baudrate candidates: /dev/ttyACM0@115200
2024-05-13 15:51:56,742 - octoprint.util.comm - INFO - Serial detection: Trying port /dev/ttyACM0, baudrate 115200
2024-05-13 15:51:56,746 - octoprint.util.comm - INFO - Connecting to port /dev/ttyACM0, baudrate 115200
2024-05-13 15:51:56,792 - octoprint.util.comm - INFO - Serial detection: Handshake attempt #1 with timeout 2.0s
2024-05-13 15:51:56,811 - octoprint.util.comm - INFO - M110 detected, setting current line number to 0
2024-05-13 15:51:56,902 - octoprint.util.comm - INFO - Changing monitoring state from "Detecting serial connection" to "Operational"
2024-05-13 15:51:56,924 - octoprint.util.comm - INFO - M110 detected, setting current line number to 0
2024-05-13 15:51:56,987 - octoprint.util.comm - INFO - Printer reports firmware name "Prusa-Firmware-Buddy 6.0.0+14794 (Github)"
2024-05-13 15:51:56,987 - octoprint.util.comm - INFO - Firmware info line: FIRMWARE_NAME:Prusa-Firmware-Buddy 6.0.0+14794 (Github) SOURCE_CODE_URL:https://github.com/prusa3d/Prusa-Firmware-Buddy PROTOCOL_VERSION:1.0 MACHINE_TYPE:Prusa-MK4 EXTRUDER_COUNT:1 UUID:REDACTED
2024-05-13 15:51:56,987 - octoprint.util.comm - INFO - Detected Prusa firmware, enabling relevant features for issue free communication
2024-05-13 15:51:57,251 - octoprint.plugins.firmwareupdater - INFO - Got CONNECTED event
2024-05-13 15:51:57,282 - octoprint.plugins.firmwareupdater - INFO - Run postflash flag is not set
2024-05-13 15:51:57,303 - octoprint.server - INFO - Autorefresh of serial port list stopped
2024-05-13 15:51:58,279 - octoprint.plugins.tracking - INFO - Sent tracking event printer_connected, payload: {'firmware_name': 'Prusa-Firmware-Buddy 6.0.0+14794 (Github)', 'printer_port': 'AUTO', 'printer_baudrate': 115200}
--SNIP camera detection--
2024-05-13 15:52:28,301 - octoprint.util.comm - INFO - Communication timeout while idle, trying to trigger response from printer.
2024-05-13 15:52:28,320 - octoprint.util.comm - INFO - Communication timeout while idle, trying to trigger response from printer.
2024-05-13 15:52:28,336 - octoprint.util.comm - INFO - No response from printer after 3 consecutive communication timeouts, considering it dead.
2024-05-13 15:52:28,364 - octoprint.util.comm - INFO - Changing monitoring state from "Operational" to "Offline after error"
2024-05-13 15:52:28,430 - octoprint.plugins.enclosure - INFO - Detected Error or Disconnect in Error will call listeners for shutdown_on_error!
2024-05-13 15:52:28,540 - octoprint.server - INFO - Starting autorefresh of serial port list
2024-05-13 15:52:28,551 - octoprint.plugins.action_command_notification - INFO - Notifications cleared
2024-05-13 15:52:28,562 - octoprint.plugins.enclosure - INFO - Detected Error or Disconnect in Disconnected will call listeners for shutdown_on_error!
MysticGringo commented 1 month ago

octoprint-5.log

This morning I deleted the log, rebooted Octoprint with plugin disabled. Enabled the MMU plugin, and restarted octoprint. I would not connect to the printer. I pushed the button to connect, it did not. I turned off the plugin, restarted octoprint, and it connected.

This log should only contain this info. Hopefully it ill help you narrow down where the issue is.

Anubis1971 commented 1 month ago

octoprint-5.log

This morning I deleted the log, rebooted Octoprint with plugin disabled. Enabled the MMU plugin, and restarted octoprint. I would not connect to the printer. I pushed the button to connect, it did not. I turned off the plugin, restarted octoprint, and it connected.

Tried the plugin last night as well. Experienced the same issues as MysticGringo. Thanks for working on this.

jshank commented 1 month ago

What's really strange is that I can clearly see the responses from the printer. Is there any chance you're "intercepting" the responses and the comm routine doesn't see them?

AaronVARC commented 1 month ago

Just to add in here.... I am using a mk3.5 with the MMU3. I cranked up the logs to debug level and noticed this on startup: 2024-05-16 19:46:34,850 - octoprint.plugin.core - ERROR - Error loading plugin prusammu Traceback (most recent call last): File "/home/aaron/oprint/lib/python3.9/site-packages/octoprint/plugin/core.py", line 1297, in _import_plugin module = _load_module(module_name, spec) File "/home/aaron/oprint/lib/python3.9/site-packages/octoprint/plugin/core.py", line 52, in _load_module return imp.load_module(name, f, filename, details) File "/home/aaron/oprint/lib/python3.9/site-packages/octoprint/vendor/imp.py", line 238, in load_module return load_package(name, filename) File "/home/aaron/oprint/lib/python3.9/site-packages/octoprint/vendor/imp.py", line 210, in load_package return _exec(spec, sys.modules[name]) File "", line 613, in _exec File "", line 790, in exec_module File "", line 228, in _call_with_frames_removed File "/home/aaron/oprint/lib/python3.9/site-packages/octoprint_prusammu/init.py", line 12, in from octoprint_prusammu.common.Mmu import MmuStates, MmuKeys, MMU3Codes, \ ImportError: cannot import name 'MMU3MK4Commands' from 'octoprint_prusammu.common.Mmu' (/home/aaron/oprint/lib/python3.9/site-packages/octoprint_prusammu/common/Mmu.py)

looks like there may be an import error that's causing the loop? My MK3.5 doesn't really crash per se but I can't complete the connection using octopi. It eventually times out with the error:

State: Offline after error Too many consecutive timeouts, printer still connected and alive?

Hope this helps. I may poke around the code as well and see if I see anything easy that may help.

jukebox42 commented 1 month ago

These logs helped, thanks all. Was a silly mistake 🤦. I was silencing all gcode lines if they weren't they ones I was looking for when it detected one of the new MKs. What I get for flying blind. I'm going to try to make the VirtualPrinter pretend to be an MK4 to do some additional digging before I subject you all to another experiment.

@AaronVARC That's an interesting error, looks like it had trouble installing, I double checked and the files were all included in the zip. Hopefully the next one helps.

jukebox42 commented 1 month ago

Alright, I think I've got a version that should hopefully work. It's hard to simulate the MMU during printing so it may not report correctly.

I'd love another test when folks have time, this one shouldn't cause connection issues.

This should work with a multi color print and show the MMU state changes. No need to enable debug mode or check for the firmware line (unless it's not telling you the MMU is present. Still no single print support yet.

Thank you in advance!

Octoprint-PrusaMmu.zip

AaronVARC commented 1 month ago

This update works great now. No error messages like I saw in the last build and everything connects great. I can see the status as it's loading the filament (including the intermediate steps) but once the printer is loaded and starts printing with a tool it looks like it misses the last message as the navbar gets stuck on the following message instead of showing the tool in use like the old one did:

image

I quit out of the print so not sure what happens on the next tool change but progress for sure.

jukebox42 commented 1 month ago

Thank @AaronVARC for the quick test. 🤞 I've fixed the detection for the end of loading.

If anyone could please test the one below.

It would be really helpful if you could post your Octoprint Terminal in the event a state change didnt detect properly. It's going to be a little like whack-a-mole making sure the right states are being sent back (prusa has a lot more than they use in their array)

Octoprint-PrusaMmu.zip

AaronVARC commented 1 month ago

That got it. It shows the filament now when it is printing after it's loaded successfully. Here's the serial.log for the three line print 3mf you included above. One thing is that when you restart octopi it shows the MMU as not found until a print starts and the first gcode intercept happens. This blocks changing any settings in the plugin as it doesn't think there is an MMU there.

serial.log

MysticGringo commented 1 month ago

Yep, this seems to be working as expected. Looking forward to selecting the material for the print when you can figure it out. It's a shame Prusa changed so much and took away some of the user adaptability.

AaronVARC commented 1 month ago

So I dug into the new buddy gcode a bit and played around with it this morning. It looks like M1600 may be a start. When you start a single tool print on the 3.5 it pops up a menu on the LCD to select which tool to use, which is a front end for this M1600 command. It looks like M1600 done before the print basically allows configuration as if you are selecting on this menu and then bypasses the pause on the printer. I did a quick test and was able to get it to load a specific tool just by using the M1600. It doesn't look like there is a comparable command on the MK3s but I don't have one anymore so can't really monitor it the same way.

https://help.prusa3d.com/article/buddy-firmware-specific-g-code-commands_633112

Also just from a user experience standpoint may want to think about changing the "not found" to something like "unknown" as I can imagine users thinking it's broken and not working and going bonkers with tickets.

Anubis1971 commented 1 month ago

Installed the lastest version. My MMU still shows not found. Here is the console log:

Screenshot 2024-05-23 183446

Disconnected and connected several times and still no connection to MMU.

jukebox42 commented 1 month ago

@AaronVARC now that's an interesting idea. When you have a sec, can you please test this build. I want to see if the M1600 is sent to octoprint (assuming it calls M1600 on print start). You'll need to turn debug back on in the plugin and watch the devtools console.

When you start a single print I'm hoping you see WE SAW AN M1600: {} in the log. If you do we might be able to hijack it and replace it.

I'd love if you can start a single print and select a tool. If even one comes back I've got a plan...

This build should also hopefully fix the MMU detection. And I swapped "Not Found" to "Unknown". Good suggestion.

Octoprint-PrusaMmu.zip

As always, thank you all for helping me with this.

AaronVARC commented 1 month ago

So the single print from octoprint is super derpy. I can get the M1600 to work when you direct print from USB but when I try a single print from octoprint it's kind of all over the place.

There is no M1600 command issued and in fact, it doesn't even check if there is a filament loaded. It will just start executing the gcode without anything loaded like the print is going off as normal. If there is filament still loaded from a prior print it will just use that material regardless of type/color etc. I've tried manually pushing in the M1600 prior to starting the print but it doesn't seem to do anything. I did notice that under controls I now have a tool option and can choose 0-4. See the pic: image

When I do this it doesn't give me any feedback but when I go to print the printer does load the filament selected and starts the print. There seems to be some loading command missing (I think it's extruder to hotend that last inch or so) because nothing actually comes out but I'll keep playing with it and see if I can sort through how to make it work. I did a bit of monitoring when using the dropdown and noticed it was just sending a simple Tx command as decribed here:

https://help.prusa3d.com/article/prusa-firmware-specific-g-code-commands_112173#t-codes

I'll keep digging but as long as you can grab and block before the print starts I think a Tx command and some type of load command could get it there.

TangoOversway commented 5 days ago

I'm trying to absorb all that's discussed here.

I have a Prusa Mk3.5 and just installed an MMU3. I have OctoPi running on a Pi Zero 2W and I keep it up to date. (Version is OctoPi build 2023.10.09.151442.) I installed this plugin, but it does not see my MMU. I do see some zip files from @jukebox42 for download. Are these later than the current plugin version I get from a "normal" plugin install on OctoPrint?

And will any logs or info from my system help with any work on this?

jukebox42 commented 3 days ago

Hey, All; thanks for your patience. Getting back to this now.

Don't get your hopes too far up about my latest release. It fixes the MMU detection for MK3.5+ but it still doesn't fix the popup for single filament print.

Prusa made this really hard to do reliably. I'm going to start another PR for that support. I still want to do something there. I'm going to see if I can catch the initial print button press and pause there. then make use of overwriting filament that @BlueFyre recommended.

jukebox42 commented 6 hours ago

Alright, I've got something I'd love for someone to test. I've tested as much as I can with my MK3 but since the MK3 doesn't recognize the M863 command I couldn't test the actual feature.

If you are curious what's in this release you can view the source here #49.

The general idea is that for MK3.5+ you will always use the MMU3 slice mode and never the base profile. The popup will show offering you to pick a color, and will have a new "Skip" option. Selecting a color will cause ALL tool changes to be re-mapped to that tool. Selecting Skip will have it print like normal (whatever tool the print has, it will use).

It makes use of M863. When you select a color I send M863 E1 (to enable). Then for every tool not selected it sends a M863 P# L# to overwrite to that selected tool. On print start and end I reset (M863 R) to avoid preserving the previous choice.

It will probably show the wrong color in the header, I'm expecting it to and can fix that if this test works.

Please try this with a multi-filament print first. We want to make sure it replaces all of them

Here's what I'd like to know:

I've attached a version you can test with below and a zip file with an stl to test with (the smallest test i can make)

If you have any issues you should be able to send M863 E0 to your printer to disable the rewrite mode.

Thank you all for the help!

Octoprint-PrusaMmu.zip 3-lines.zip