← index #18660Issue #17918
Related · high · value 0.899
QUERY · ISSUE

mpremote REPL and mount issues with socket:// and RFC2217 connections

openby Josverlopened 2026-01-07updated 2026-01-07
bugtools

Port, board and/or hardware

Any platform - affects mpremote tool when connecting via socket:// or RFC2217

MicroPython version

  • mpremote 1.27.0
  • Tested against MicroPython unix port 1.27.0 via
    • socket://localhost:port
    • rfc2217://localhost:2217

Reproduction

1 unable to mount host filesystem over socket connections

  • mpremote connect socket://localhost:2218 mount .
AttributeError: 'SerialIntercept' object has no attribute 'in_waiting'

2 Incorrect newline handling in interactive repl over socket

  1. Connect to MicroPython Unix port:

    mpremote connect socket://localhost:2218 repl
    
  2. Type commands and observe output appears like:

    >>> print("hello")
                       hello
                             >>>
    

3 repl over socket://

mpremote connect socket://localhost:2218 repl

REPL may fail to respond or hang

4 repl over rfc2217

mpremote connect rfc2217://localhost:2217 repl

Output may be delayed, laggy, or appear in bursts
pyserial's RFC2217 implementation uses a background thread to process telnet data from the socket into an internal buffer. When mpremote's REPL loop uses select() on the socket, it signals "ready" when data arrives, but inWaiting() returns 0 because the background thread hasn't processed the data yet.

Race condition sequence:

  1. select() returns because socket has data
  2. inWaiting() returns 0 (background thread hasn't processed yet)
  3. REPL loop skips reading
  4. Next iteration: select() returns, now inWaiting() > 0
  5. Finally reads the data

This causes noticeable lag and stuttering in the REPL.

Expected behaviour

mpremote should work correctly with socket-based connections (socket://, RFC2217), providing:

  • Functional mount operations
  • Proper newline handling in REPL output
  • Responsive REPL without lag or race conditions

Observed behaviour

  • Mount operations fail with AttributeError
  • REPL output has "staircase" effect (misaligned lines)
  • REPL may hang or fail to get input from socket connections
  • REPL output is laggy/stuttering with RFC2217 connections

Additional Information

  • aeb1ce6 - Add in_waiting property to SerialIntercept class
  • 2d46d52 - Fix REPL newline handling
  • 7f0abfd - Improve waitchar() wrt socket connections
  • 1ff555c - Fix REPL race conditions with RFC2217

Code of Conduct

Yes, I agree

CANDIDATE · ISSUE

mpremote: enter_raw_repl: not working with micropython v1.26

openby sebert007opened 2025-08-14updated 2025-09-05
bugtools

Port, board and/or hardware

esp32-s3, mpremote

MicroPython version

micropython v1.26 with ESP32-S3

Reproduction

mpremote cp process_handler.py :/process_handler.py

Expected behaviour

Should copy

Observed behaviour

mpremote.transport.TransportError: could not enter raw repl

Additional Information

I observed that from being in raw REPL, you cannot initiate a reboot with CTRL-D any more like it was in earlier micropython version.
For reboot, you now need to leave the raw REPL with CTRL-A first before being able to reboot with CTRL-D.

So the behavior of enter_raw_repl in transport_serial.pymight need modification.

Code of Conduct

Yes, I agree

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied