← index #4196PR #10041
Related · medium · value 0.485
QUERY · ISSUE

BUG -- initial prompt on WebREPL connect is always ">>> ", even for paste (and raw) mode

openby Hermann-SWopened 2018-09-28updated 2018-09-28

If bringing MicroPython into paste mode and disconnecting then, initial prompt on next WebREPL connect is wrong. The prompt is ">>> " although MicroPython is in paste mode as can be seen in screenshot. Initial prompt on connect is wrong as well if the module gets into raw mode (eg. by screen session). Initial prompt on WebREPL connect then is ">>> " as well.

Since MicroPython should know its mode on connect, it should present the correct initial prompt:
<img src="https://stamm-wilbrandt.de/en/forum/webrepl.initial_prompt.wrong.png"/>

CANDIDATE · PULL REQUEST

wait for >>> when attempting to enter_raw_repl

closedby BrianPughopened 2022-11-21updated 2025-01-16
tools

On some boards (notably esp32), pyboard.py hangs when attempting to enter raw repl mode. As outlined in this thread and this PR, @roaldarbol and I have resolved this issue. Basically, the issue/solution is this:

  1. After pressing ctrl+c twice, some boards take a while to respond (up to ~2 or ~3 seconds).
  2. Attempting to enter raw repl during this time will result in the command being ignored.
  3. To detect the board responding, the new change is to wait until the >>> prompt is sent from device.
  4. If the device is already in raw repl mode, the >>> prompt will not be sent. To mitigate this, we will attempt to exit raw repl mode. If not in raw repl mode, this will do nothing.
  5. Once the >>> prompt is reached, we know the device is ready for more commands and we can set the device in raw repl mode.

This should also mitigate the issue in some other very old issues. This change is working well in Belay, but I didn't really test this exact PR for micropython.

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