ESP32, Mac Os, Enter raw repl failes
Hi there,
I was using the micropython 1.17 firmware on an ESP32 and was trying to load a file into memory with the pyboard.py tool. I was doing the same thing on a Linux machine (where the serial port was /dev/tty.USB0) but for some reason the same fails on Mac OS (serial port /dev/tty.usbserial-0001) with the following error:
b'\x9a\x82\xc2\x82\xa2\x82\x82bb\x95\xb9\xe94292\r\nentry 0x400806b0\r\nMicroPython v1.17 on 2021-09-02; ESP32 module with ESP32\r\nType "help()" for more information.\r\n>>> ' Traceback (most recent call last): File "/Users/luca/mambaforge/bin/mpremote", line 8, in <module> sys.exit(main()) File "/Users/luca/mambaforge/lib/python3.9/site-packages/mpremote/main.py", line 414, in main pyb.enter_raw_repl() File "/Users/luca/mambaforge/lib/python3.9/site-packages/mpremote/pyboard.py", line 340, in enter_raw_repl raise PyboardError("could not enter raw repl") mpremote.pyboard.PyboardError: could not enter raw repl
Looking at the pyboard file, it suggest that the activation of the "raw repl" mode is unsuccessful, which is weird since i can use "mpremote connect /dev/tty.usbserial-0001" to get into the normal repl and the use Ctrl-B to access the raw repl mode.
On further investigation it seems like the write does not actually reach or gets interpreted by the microcontroller.
Thanks in advance for any recommendation or resources that might be useful to fix this issue
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