OctoPrint-MeatPack icon indicating copy to clipboard operation
OctoPrint-MeatPack copied to clipboard

RFC2217 & raw TCP connections don't work with MeatPack

Open jbubik opened this issue 1 year ago • 0 comments

Octoprint 1.8.7 with MeatPack connecting to raw TCP socket://192.168.1.200:5000 - fails with:

2023-04-07 19:44:14,663 - octoprint.util.comm - ERROR - Unexpected error while connecting to serial port socket://192.168.1.200:5000, baudrate 115200 from hook meatpack: SerialException: '[Errno 2] could not open port socket://192.168.1.200:5000: [Errno 2] No such file or directory: 'socket://192.168.1.200:5000'' @ comm.py:_open_serial:3832
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/serial/serialposix.py", line 322, in open
    self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
FileNotFoundError: [Errno 2] No such file or directory: 'socket://192.168.1.200:5000'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/octoprint/util/comm.py", line 3832, in _open_serial
    serial_obj = factory(
  File "/usr/lib/python3.10/site-packages/octoprint/util/__init__.py", line 1688, in wrapper
    return f(*args, **kwargs)
  File "/usr/lib/python3.10/site-packages/OctoPrint_MeatPack/__init__.py", line 64, in serial_factory_hook
    self._serial_obj.open()
  File "/usr/lib/python3.10/site-packages/serial/serialposix.py", line 325, in open
    raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))

Same issue in vanilla Octoprint was solved in plugin OctoPrint-Network-Printing The fix could be to open ports named like :// with serial.serial_for_url() instead of serial.open() in serial_factory_hook.

Anyone would benefit from this improvement? Low prio for me now - BufferBuddy helped me enough with latency issues.

Jan

jbubik avatar Apr 08 '23 08:04 jbubik