Skip to content

RFC2217 & raw TCP connections don't work with MeatPack #27

@jbubik

Description

@jbubik

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions