BUG -- initial prompt on WebREPL connect is always ">>> ", even for paste (and raw) mode
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"/>
wait for >>> when attempting to enter_raw_repl
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:
- After pressing ctrl+c twice, some boards take a while to respond (up to ~2 or ~3 seconds).
- Attempting to enter raw repl during this time will result in the command being ignored.
- To detect the board responding, the new change is to wait until the
>>>prompt is sent from device. - 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. - 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.