Skip to content

Add exclusive printer relay for binary file transfer - #1155

Closed
SpankyDevil wants to merge 1 commit into
luc-github:3.1from
SpankyDevil:feature/printer-link-marlin-relay
Closed

SpankyDevil wants to merge 1 commit into
luc-github:3.1from
SpankyDevil:feature/printer-link-marlin-relay

Conversation

@SpankyDevil

@SpankyDevil SpankyDevil commented Nov 30, 2026 •

Copy link
Copy Markdown

Purpose

This PR adds an exclusive printer serial-link relay for stateful protocols such as Marlin Binary File Transfer.

It prevents ESP3D polling and terminal traffic from interfering while binary packets are being exchanged, and restores normal serial behavior afterward.

How it works

  • MS captures exclusive printer-link ownership.
  • MB forwards binary packets through the ESP serial service.
  • ME releases the printer link and restores normal operation.
  • Printer RX is diverted while the relay is active.
  • Normal serial command dispatch is rejected during an active relay session.
  • The relay is released on normal WebSocket close/disconnect.

Scope

This PR changes only the ESP3D firmware relay primitive. It does not modify Marlin firmware or implement the complete HTTP binary-transfer service.

The companion WebUI PR performs SYNC, QUERY, OPEN, WRITE, CLOSE, Heatshrink negotiation, and cancellation cleanup.

Hardware requirements

No additional hardware or physical modifications are required. ESP3D and Marlin use their existing serial connection. Both ends must use matching serial configuration and baud rate.

Testing

  • ESP32 firmware builds successfully with python -m platformio run -e esp32dev.
  • Printer-link source files compile with no editor diagnostics.
  • ESP32 flash usage: 69.0%.
  • Hardware confirmation is still required for repeated M115, M28 B1, binary close, cancellation cleanup, and final M20 file listing.

Known limitations

  • This PR does not provide a complete transfer service or persistence verification.
  • It requires a compatible companion WebUI or protocol client.
  • Transfer testing must include serial polling isolation to avoid interference.

@luc-github

Copy link
Copy Markdown
Owner

can you elaborate ? this is for transfer to where if Marlin do no change? what hardware configuration?
how does this work ?
what is the purpose ?
the current description is really not meaninful

@SpankyDevil

Copy link
Copy Markdown
Author

Have updated the description.

@luc-github

Copy link
Copy Markdown
Owner

M28 B won't be supported so what is the point ?

@SpankyDevil

SpankyDevil commented Nov 30, 2026 •

Copy link
Copy Markdown
Author

M28 B1 appears to be the only practical option for this hardware configuration. The goal is to improve binary file-transfer reliability - serial isolation, packet recovery, exact cancellation cleanup, and confirmed close/persistence - while retaining the existing Marlin and ESP3D setup. No additional hardware or Marlin firmware changes are intended.

luc-github/ESP3D-WEBUI#468

@luc-github

Copy link
Copy Markdown
Owner

I have already explained many times why M28 and M28 B won't be supported. situation did not changed

@SpankyDevil

Copy link
Copy Markdown
Author

I have read your previous comments, and #1155 is an attempt to address the concerns you raised around binary file transfer. My aim is to resolve those issues so that binary file transfer can become a viable option.

@luc-github

luc-github commented Nov 30, 2026 •

Copy link
Copy Markdown
Owner

I have read your previous comments, and #1155 is an attempt to address the concerns you raised around binary file transfer. My aim is to resolve those issues so that binary file transfer can become a viable option.

Building a construction on sand is not right, adding some stone on some part instead of redo the fondations is a temporary way to hide the problems that will happen - using a an experimental method, based on existing outdated way , which is even not finalized neither stable per it's own dev and still have issue per some user, where documentation has been done on guess based on reading current code is exactly what M28 and its evolution M28 B are.

I understand the need but this is not the way to do - at least in ESP3D

if you want to improve situations have a look to #575

https://github.com/luc-github/ESP3D/tree/3.1/to_do/CommunicationProtocol

the websocket binary file transfer is already implemented and the evolution for serial have a draft but nothing is yet finalized neither published because this is ongoing reflexion :

websockets_protocol_V1_0.md

esp3d_serial_mux_framing_draft.md

@luc-github

Copy link
Copy Markdown
Owner

I close PR as no go

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.

2 participants