OctoPrint-MeatPack: OctoPrint unable to connect to printer when plug-in is enabled

I have an Ender 3 Pro with SKR BTT Mini E3 v1.2, OctoPi v0.18 (RPi-4) fully up to date, MeatPack plug-in v 1.5.21. My fork of Marlin can be found here https://github.com/Taomyn/Marlin

Compiled latest bugfix as I found tonight including enabling MeatPack.

When enabled OctoPrint will not connect to the printer, disable it and OctoPrint is working fine. Some log data below, let me know if I can provide anything else.

Excerpt from OctoPrint log:

2021-01-28 20:03:25,462 - octoprint.util.comm - INFO - Changing monitoring state from "Offline" to "Detecting serial connection"
2021-01-28 20:03:25,482 - octoprint.util.comm - INFO - Serial detection: Performing autodetection with 2 port/baudrate candidates: /dev/ttyACM0@250000, /dev/ttyS0@250000
2021-01-28 20:03:25,482 - octoprint.util.comm - INFO - Serial detection: Trying port /dev/ttyACM0, baudrate 250000
2021-01-28 20:03:25,483 - octoprint.plugins.meatpack - INFO - [Serial]: Cannot query packing state -- port not open.
2021-01-28 20:03:25,484 - octoprint.plugins.meatpack - INFO - [Serial]: Cannot query packing state -- port not open.
2021-01-28 20:03:25,507 - octoprint.util.comm - INFO - Serial detection: Handshake attempt #1 with timeout 2.0s
2021-01-28 20:03:25,511 - octoprint.util.comm - INFO - M110 detected, setting current line number to 0
2021-01-28 20:03:27,721 - octoprint.util.comm - INFO - Serial detection: Handshake attempt #2 with timeout 2.0s
2021-01-28 20:03:27,726 - octoprint.util.comm - INFO - M110 detected, setting current line number to 0
2021-01-28 20:03:29,753 - octoprint.util.comm - INFO - Serial detection: Handshake attempt #3 with timeout 2.0s
2021-01-28 20:03:29,757 - octoprint.util.comm - INFO - M110 detected, setting current line number to 0
2021-01-28 20:03:32,753 - octoprint.util.comm - INFO - Serial detection: Trying port /dev/ttyS0, baudrate 250000
2021-01-28 20:03:32,763 - octoprint.util.comm - ERROR - Unexpected error while connecting to serial port /dev/ttyS0, baudrate 250000 from hook meatpack: SerialException: 'Could not configure port: (5, 'Input/output error')' @ comm.py:_open_serial:3670
Traceback (most recent call last):
  File "/home/pi/oprint/lib/python3.7/site-packages/serial/serialposix.py", line 398, in _reconfigure_port
    orig_attr = termios.tcgetattr(self.fd)
termios.error: (5, 'Input/output error')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/util/comm.py", line 3670, in _open_serial
    settings().getFloat(["serial", "timeout", "connection"]),
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/util/__init__.py", line 1890, in wrapper
    return f(*args, **kwargs)
  File "/home/pi/oprint/lib/python3.7/site-packages/OctoPrint_MeatPack/__init__.py", line 52, in serial_factory_hook
    self._serial_obj.port = str(port)
  File "/home/pi/oprint/lib/python3.7/site-packages/serial/serialutil.py", line 276, in port
    self.open()
  File "/home/pi/oprint/lib/python3.7/site-packages/serial/serialposix.py", line 332, in open
    self._reconfigure_port(force_update=True)
  File "/home/pi/oprint/lib/python3.7/site-packages/serial/serialposix.py", line 401, in _reconfigure_port
    raise SerialException("Could not configure port: {}".format(msg))
serial.serialutil.SerialException: Could not configure port: (5, 'Input/output error')
2021-01-28 20:03:32,802 - octoprint.util.comm - INFO - Serial detection: Could not open port /dev/ttyS0, baudrate 250000, skipping
2021-01-28 20:03:32,802 - octoprint.util.comm - INFO - Changing monitoring state from "Detecting serial connection" to "Error: No more candidates to test, and no working port/baudrate combination detected."
2021-01-28 20:03:32,804 - octoprint.util.comm - INFO - Changing monitoring state from "Error: No more candidates to test, and no working port/baudrate combination detected." to "Offline (Error: No more candidates to test, and no working port/baudrate combination detected.)"
2021-01-28 20:03:32,811 - octoprint.plugins.printoid - INFO - //// Send alert to Printoid: 'printer-error' with value Error: No more candidates to test, and no working port/baudrate combination detected. (mydomain)
2021-01-28 20:03:33,180 - octoprint.plugins.printoid - INFO - //// Send alert to Printoid: 'printer-error' with value Error: No more candidates to test, and no working port/baudrate combination detected. (mydomain)

Serial.log - failing

2021-01-28 20:02:47,456 - serial.log is currently not enabled, you can enable it via Settings > Serial Connection > Log communication to serial.log
2021-01-28 20:03:25,445 - serial.log is currently not enabled, you can enable it via Settings > Serial Connection > Log communication to serial.log
2021-01-28 20:08:08,102 - serial.log is currently not enabled, you can enable it via Settings > Serial Connection > Log communication to serial.log
2021-01-28 20:10:42,155 - Enabling serial logging
2021-01-28 20:10:52,495 - Changing monitoring state from "Offline" to "Detecting serial connection"
2021-01-28 20:10:52,531 - Performing autodetection with 2 port/baudrate candidates: /dev/ttyACM0@250000, /dev/ttyS0@250000
2021-01-28 20:10:52,531 - Trying port /dev/ttyACM0, baudrate 250000
2021-01-28 20:10:52,549 - Handshake attempt #1 with timeout 2.0s
2021-01-28 20:10:52,552 - Connected to: PackingSerial<id=0xa8c07a70, open=True>(port='/dev/ttyACM0', baudrate=250000, bytesize=8, parity='N', stopbits=1, timeout=2.0, xonxoff=False, rtscts=False, dsrdtr=False), starting monitor
2021-01-28 20:10:52,554 - Send: N0 M110 N0*125
2021-01-28 20:10:53,141 - Recv: Not SD printing
2021-01-28 20:10:54,132 - Recv:  T:21.87 /0.00 B:34.17 /0.00 @:0 B@:0
2021-01-28 20:10:54,142 - Recv: Not SD printing
2021-01-28 20:10:55,143 - Recv: Not SD printing
2021-01-28 20:10:55,144 - Handshake attempt #2 with timeout 2.0s
2021-01-28 20:10:55,157 - Send: N0 M110 N0*125
2021-01-28 20:10:56,131 - Recv:  T:20.94 /0.00 B:34.17 /0.00 @:0 B@:0
2021-01-28 20:10:56,142 - Recv: Not SD printing
2021-01-28 20:10:57,142 - Recv: Not SD printing
2021-01-28 20:10:58,131 - Recv:  T:21.25 /0.00 B:34.14 /0.00 @:0 B@:0
2021-01-28 20:10:58,139 - Handshake attempt #3 with timeout 2.0s
2021-01-28 20:10:58,147 - Send: N0 M110 N0*125
2021-01-28 20:10:58,150 - Recv: Not SD printing
2021-01-28 20:10:59,143 - Recv: Not SD printing
2021-01-28 20:11:00,131 - Recv:  T:21.41 /0.00 B:34.17 /0.00 @:0 B@:0
2021-01-28 20:11:00,143 - Recv: Not SD printing
2021-01-28 20:11:00,145 - Trying port /dev/ttyS0, baudrate 250000
2021-01-28 20:11:00,156 - Unexpected error while connecting to serial port /dev/ttyS0, baudrate 250000 from hook meatpack: SerialException: 'Could not configure port: (5, 'Input/output error')' @ comm.py:_open_serial:3670
2021-01-28 20:11:00,192 - Could not open port /dev/ttyS0, baudrate 250000, skipping
2021-01-28 20:11:00,193 - Changing monitoring state from "Detecting serial connection" to "Error: No more candidates to test, and no working port/baudrate combination detected."
2021-01-28 20:11:00,194 - Changing monitoring state from "Error: No more candidates to test, and no working port/baudrate combination detected." to "Offline (Error: No more candidates to test, and no working port/baudrate combination detected.)"
2021-01-28 20:11:00,195 - Connection closed, closing down monitor
2021-01-28 20:11:07,075 - Disabling serial logging

Serial.log - working

2021-01-28 20:22:37,140 - Changing monitoring state from "Offline" to "Detecting serial connection"
2021-01-28 20:22:37,760 - Performing autodetection with 2 port/baudrate candidates: /dev/ttyACM0@250000, /dev/ttyS0@250000
2021-01-28 20:22:37,761 - Trying port /dev/ttyACM0, baudrate 250000
2021-01-28 20:22:37,762 - Connecting to port /dev/ttyACM0, baudrate 250000
2021-01-28 20:22:37,868 - Handshake attempt #1 with timeout 2.0s
2021-01-28 20:22:37,893 - Connected to: Serial<id=0xa8b76910, open=True>(port='/dev/ttyACM0', baudrate=250000, bytesize=8, parity='N', stopbits=1, timeout=2.0, xonxoff=False, rtscts=False, dsrdtr=False), starting monitor
2021-01-28 20:22:37,895 - Send: N0 M110 N0*125
2021-01-28 20:22:37,931 - Recv: ok WNÂ…0g P31 B31
2021-01-28 20:22:37,978 - Changing monitoring state from "Detecting serial connection" to "Operational"
2021-01-28 20:22:38,036 - Send: N0 M110 N0*125
2021-01-28 20:22:38,116 - Recv: ok WNÂ…0g P31 B31
2021-01-28 20:22:38,118 - Send: N1 M115*39
2021-01-28 20:22:38,155 - Recv: FIRMWARE_NAME:Marlin v2.0.x (Jan 28 2021 19:53:47) SOURCE_CODE_URL:github.com/MarlinFirmware/Marlin PROTOCOL_VERSION:1.0 MACHINE_TYPE:Ender-3 Pro EXTRUDER_COUNT:1 UUID:

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 92 (16 by maintainers)

Most upvoted comments

I’m on an Ender-3 using Marlin Bugfix 2.0.9.1 on a BTT SKR E3 Mini V2 with OctoPrint 1.6.1. I was having similar issues where I could connect to the printer, but couldn’t transmit anything via octoprint if the meatpack plugin was enabled (even if i told it not to compress in the plugin options). I followed the Meatpack install instructions but it wasn’t working. I skimmed through some of the responses here and then updated my Configuration_adv.h file from

#define MEATPACK_ON_SERIAL_PORT_1       // 680 bytes
//#define MEATPACK_ON_SERIAL_PORT_2

to

//#define MEATPACK_ON_SERIAL_PORT_1       // 680 bytes
#define MEATPACK_ON_SERIAL_PORT_2

and this fixed it! I’m not an expert on any of this stuff, but if anyone else is running into the same situation with a similar setup, try this first since it’s an easy change.

With CDC serial (the “USB serial comm port emulation”), the UART speed is completely ignored, since UART’s data does not flow with 2 wires and strict clocking, it’s captured and send as bytes in USB packets (at native USB speed, 12MBits 480 MBits whatever). So you were probably doing < 12Mbits serial without even knowing it.

Can you describe the issue a bit more ?

  1. Without enabling Meatpack, do you get data from that USB’s serial link in a terminal/octoprint ?
  2. If yes, then Meatpack is probably doing something unexpected on the serial link (like, for example, trying to read 2 bytes while there’s only one available. On a usual serial port, it’ll just work with a single byte returned, but for USB, it’s waiting for the 2 bytes to come, so you don’t even get the former byte ?)
  3. If no, then it’s an issue with Marlin, and I need to figure out why it happens.

Hi having the same issue with Ender 3 V2 and standard E3 V2 BLTouch firmware from https://marlin.crc.id.au/ Using /dev/ttyUSB0