On OSX, mpremote.transport.TransportError: could not enter raw repl
mpremote can't seem to enter raw repl:
% mpremote ls
b'MicroPython v1.20.0-745-g30ba5e11e-dirty on 2024-01-23; ESP32 module (spiram) with ESP32\r\nType "help()" for more information.\r\n>>>
Traceback (most recent call last):
File "/Users/danielmcshan/Library/Python/3.9/bin/mpremote", line 8, in <module>
sys.exit(main())
File "/Users/danielmcshan/Library/Python/3.9/lib/python/site-packages/mpremote/main.py", line 528, in main
handler_func(state, args)
File "/Users/danielmcshan/Library/Python/3.9/lib/python/site-packages/mpremote/commands.py", line 110, in do_filesystem
state.ensure_raw_repl()
File "/Users/danielmcshan/Library/Python/3.9/lib/python/site-packages/mpremote/main.py", line 470, in ensure_raw_repl
self.transport.enter_raw_repl(soft_reset=soft_reset)
File "/Users/danielmcshan/Library/Python/3.9/lib/python/site-packages/mpremote/transport_serial.py", line 155, in enter_raw_repl
raise TransportError("could not enter raw repl")
mpremote.transport.TransportError: could not enter raw repl
but mpremote connects fine:
% mpremote
Connected to MicroPython at /dev/cu.usbserial-210
Use Ctrl-] or Ctrl-x to exit this shell
MicroPython v1.20.0-745-g30ba5e11e-dirty on 2024-01-23; ESP32 module (spiram) with ESP32
Type "help()" for more information.
>>>
% sw_vers
ProductName: macOS
ProductVersion: 13.0
BuildVersion: 22A380
% python3 --version
Python 3.9.6
% mpremote --version
mpremote 1.22.0
mpremote: unable to execute fs commands - mpremote.transport.TransportError: could not enter raw repl
Port, board and/or hardware
esp32 wroom
MicroPython version
MicroPython v1.23.0 on 2024-06-02; Generic ESP32 module with ESP32
mpremote 1.24.0
Reproduction
mpremote fs ls failed with
mpremote.transport.TransportError: could not enter raw repl
Expected behaviour
expected
mpremote fs ls
ls :
0 mrequests/
Observed behaviour
b'MicroPython v1.23.0 on 2024-06-02; Generic ESP32 module with ESP32\r\nType "help()" for more information.\r\n>>> '
Traceback (most recent call last):
File "/opt/homebrew/bin/mpremote", line 8, in <module>
sys.exit(main())
^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/mpremote/main.py", line 538, in main
handler_func(state, args)
File "/opt/homebrew/lib/python3.11/site-packages/mpremote/commands.py", line 294, in do_filesystem
state.ensure_raw_repl()
File "/opt/homebrew/lib/python3.11/site-packages/mpremote/main.py", line 480, in ensure_raw_repl
self.transport.enter_raw_repl(soft_reset=soft_reset)
File "/opt/homebrew/lib/python3.11/site-packages/mpremote/transport_serial.py", line 139, in enter_raw_repl
raise TransportError("could not enter raw repl")
mpremote.transport.TransportError: could not enter raw repl
Additional Information
My temporary workaround is additional time.sleep(1) at line
https://github.com/micropython/micropython/blob/0e490b7c8f32bb72c516985abe67147b9385dc34/tools/mpremote/mpremote/transport_serial.py#L125
before flush input.
Code of Conduct
Yes, I agree