MMU2S firmware update fails on Linux, PrusaSlicer 2.2.0
I am attempting to update my MMU2S to 1.0.6 to go along with the MK3S 3.9.0. I am using the PrusaSlicer 2.2.0 appimage under Linux, Ubuntu 18.04.4 LTS.
The MK3S firmware update went fine, but the MMU2S update is not working. I see:
Flashing Original Prusa MMU 2.0 Control, looking for VID/PID 0x2c99/3 or 0x2c99/4 ...
Found VID/PID 0x2c99/4 at `/dev/ttyACM0`, rebooting the device ...
Found VID/PID 0x2c99/3 at `/dev/ttyACM0`, flashing ...
avrdude-slic3r -v -p atmega32u4 -c avr109 -P /dev/ttyACM0 -b 57600 -D -U flash:w:0:/home/morrone/Downloads/fw/prusa3d_fw_MMU2board_1_0_6.hex:i
avrdude-slic3r: Version 6.3-20160220-prusa3d, compiled on Mar 21 2020 at 18:56:46
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
Using Port : /dev/ttyACM0
Using Programmer : avr109
Overriding Baud Rate : 57600
avrdude-slic3r: ser_open(): can't open device "/dev/ttyACM0": Permission denied
avrdude-slic3r: Could not open port: /dev/ttyACM0
avrdude-slic3r: done. Thank you.
I see that the MMU2S does appear to reboot as the logs suggest. I absolutely do have permission to access /dev/ttyACM0, as I am in the dialout group (this is also the same tty name that was employed just fine for the MK3S firmare update).
I suspect that PrusaSlicer's update procedure is racy. When the MMU2S is rebooted, the USB connection is lost and the /dev/ttyACM0 device is removed:
[37887.220422] usb 1-1: USB disconnect, device number 16
[37887.562079] usb 1-1: new full-speed USB device number 17 using xhci_hcd
[37887.712747] usb 1-1: New USB device found, idVendor=2c99, idProduct=0003
[37887.712756] usb 1-1: New USB device strings: Mfr=2, Product=1, SerialNumber=3
[37887.712761] usb 1-1: Product: Original Prusa i3 MK3 Multi Material 2.0 upgrade (bootloader)
[37887.712766] usb 1-1: Manufacturer: Prusa Research (prusa3d.com)
[37887.712771] usb 1-1: SerialNumber: XXXXXXXXXXXXXXXXXXXXXX
[37887.713862] cdc_acm 1-1:1.0: ttyACM0: USB ACM device
[37895.323044] usb 1-1: USB disconnect, device number 17
[37895.800102] usb 1-1: new full-speed USB device number 18 using xhci_hcd
[37895.952262] usb 1-1: New USB device found, idVendor=2c99, idProduct=0004
[37895.952271] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[37895.952278] usb 1-1: Product: Original Prusa i3 MK3 Multi Material 2.0 upgrade
[37895.952283] usb 1-1: Manufacturer: Prusa Research (prusa3d.com)
[37895.953460] cdc_acm 1-1:1.0: ttyACM0: USB ACM device
I think just need a couple seconds of delay between resetting the MMU2S and trying to write the firmware.