← index #6023PR #18694
Likely Duplicate · high · value 2.773
QUERY · ISSUE

no input for repl with dupterm

openby uraichopened 2020-05-10updated 2024-11-09

On my esp32 and the esp8266 port REPL does not seem to ask for input except for slot 0.
webrepl shows output but does not take input. Same if I try to use a second serial port. Same for utelnetserver. Is this a dupterm problem?
Working with the newest micropython commit v1.12-447-gab4e19770-dirty

CANDIDATE · PULL REQUEST

esp32: Add dupterm polling to mp_hal_stdin_rx_chr

closedby jetpaxopened 2026-01-16updated 2026-01-16
port-esp32

Summary

The ESP32 port's mp_hal_stdin_rx_chr() currently only reads from the local stdin_ringbuf, ignoring any dupterm streams. This means that Python's input() function never receives data from dupterm-based interfaces like WebREPL.

This PR adds a call to mp_os_dupterm_rx_chr() in the main polling loop, consistent with other ports.

Problem

When running a script that uses input() over WebREPL (or any other dupterm stream), the function hangs indefinitely waiting for UART input because the ESP32 port's mp_hal_stdin_rx_chr() never checks the dupterm stream for available characters.

Solution

Add dupterm polling after checking the local ringbuf, matching the pattern used in other ports:

Testing

Tested with WebREPL over WebSocket on ESP32-P4, confirming that input() now correctly receives and returns user input.

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