8000 feat: add RFC2217 network serial transport support by ChristophKomenda · Pull Request #450 · inkcut/inkcut · GitHub
[go: up one dir, main page]

Skip to content

feat: add RFC2217 network serial transport support - #450

Open
ChristophKomenda wants to merge 1 commit into
inkcut:masterfrom
ChristophKomenda:feat/rfc2217-serial-transport
Open

ChristophKomenda wants to merge 1 commit into
inkcut:masterfrom
ChristophKomenda:feat/rfc2217-serial-transport

Conversation

@ChristophKomenda
Copy link
Copy Markdown

Summary

This draft introduces RFC2217 network serial transport support for Inkcut, allowing serial and USB-connected vinyl cutters to be operated over a network.

Motivation

Inkcut uses serial.serial_for_url(), but its existing serial transport assumes non-blocking write timeouts and file-descriptor-based I/O. On real RFC2217 hardware, initialization failed with:

NotImplementedError: write_timeout is currently not supported

Changes

  • Dedicated RFC2217 transport selected for RFC2217 URLs.
  • Network reads and writes executed outside the main event loop.
  • Buffered, ordered writes and detection of failed or incomplete writes.
  • Improved serial write error propagation.
  • Custom serial port / URL input field.
  • Six RFC2217 regression tests.

Hardware validation

Component Configuration
Cutter Refine EH-1351
USB serial interface CH340
Hosts Raspberry Pi 5 (ARM64)
OS Debian 13 Trixie
Python 3.13.5
Inkcut 2.2.0
Qt runtime 6.8.2
Network bridge ser2net 4.6.4
Protocol HPGL
Serial settings 9600 baud, 8N1, RTS/CTS
flowchart TD
    A[Browser / noVNC] --> B[Inkcut on Raspberry Pi 5]
    B -->|RFC2217| C[ser2net on Raspberry Pi 5]
    C -->|USB / CH340| D[Refine EH-1351]
Loading

A physical pen plot of a calibration SVG containing a 20 x 20 mm square, a 14 mm diameter circle and a 6 x 6 mm crosshair succeeded. The contours appeared closed, with correct pen-up/down movements and approximate dimensional agreement. This is preliminary validation, not precision calibration or a cutting test. Photos are available separately.

Automated tests

The new tests cover initialization, write ordering, incoming data, write exceptions, incomplete writes and graceful shutdown. The full suite was run against an isolated snapshot of the proposed changes:

92 passed, 8 warnings in 11.38s

Compatibility and security

The separate transport path is intended to minimize impact on existing local serial devices; direct local serial regression testing remains outstanding. HPGL, DMPL and GPGL implementations are unchanged. RFC2217 has no native authentication or encryption; use trusted networks or secured tunnels.

Remaining work

This draft is for early technical feedback, not production deployment.

  • Harden blocking I/O and timeout handling.
  • Validate cancellation, abort and pause/resume behavior.
  • Extend connection-loss and resource-cleanup tests.
  • Add targeted plugin-level error propagation tests.
  • Validate compatibility with additional serial devices.

The dedicated Refine profile and headless Raspberry Pi documentation are intentionally excluded and will be proposed separately.

Feedback on transport architecture and lifecycle management is welcome.

@ChristophKomenda
ChristophKomenda marked this pull request as ready for review November 25, 2026 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0