Can't connect to ESP32-WROOM-32D (stuck at "Trying to connect to REPL..")

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
zachmoshe
Posts: 6
Joined: Fri Jun 24, 2022 8:28 am

Can't connect to ESP32-WROOM-32D (stuck at "Trying to connect to REPL..")

Post by zachmoshe » Wed Aug 03, 2022 5:54 pm

Hi,
I have a ESP32D board which I've erased the flash and installed Micropython 1.19.1 from the regular downloads page(esp32-20220618-v1.19.1.bin). I'm using `rshell` to connect. Everything works fine for the first couple of minutes (or operations..), but every time, after copying a few files, or playing a little bit with the REPL, the board stucks and when I try to reconnect with rshell I get the following output:

Code: Select all

> rshell -p /dev/tty.usbserial-0001   
Using buffer-size of 32
Connecting to /dev/tty.usbserial-0001 (buffer-size 32)...
Trying to connect to REPL .
It hangs forever. Sometimes with 2-3 dots instead of one. Doesn't seem to matter if I'm in boot mode or not. Doesn't seem to matter if I reboot, or reconnect the USB device.

When I interrupt the process I get the following traceback:

Code: Select all

Traceback (most recent call last):
  File "/Users/zmoshe/.pyenv/versions/3.10.1/bin/rshell", line 8, in <module>
    sys.exit(main())
  File "/Users/zmoshe/.pyenv/versions/3.10.1/lib/python3.10/site-packages/rshell/command_line.py", line 4, in main
    rshell.main.main()
  File "/Users/zmoshe/.pyenv/versions/3.10.1/lib/python3.10/site-packages/rshell/main.py", line 3082, in main
    real_main()
  File "/Users/zmoshe/.pyenv/versions/3.10.1/lib/python3.10/site-packages/rshell/main.py", line 3044, in real_main
    connect(args.port, baud=args.baud, wait=args.wait, user=args.user, password=args.password)
  File "/Users/zmoshe/.pyenv/versions/3.10.1/lib/python3.10/site-packages/rshell/main.py", line 1387, in connect
    connect_serial(port, baud=baud, wait=wait)
  File "/Users/zmoshe/.pyenv/versions/3.10.1/lib/python3.10/site-packages/rshell/main.py", line 1411, in connect_serial
    dev = DeviceSerial(port, baud, wait)
  File "/Users/zmoshe/.pyenv/versions/3.10.1/lib/python3.10/site-packages/rshell/main.py", line 1729, in __init__
    data = pyb.read_until(1, b'>>> ', timeout=0.1)
  File "/Users/zmoshe/.pyenv/versions/3.10.1/lib/python3.10/site-packages/rshell/pyboard.py", line 164, in read_until
    data = self.serial.read(min_num_bytes)
  File "/Users/zmoshe/.pyenv/versions/3.10.1/lib/python3.10/site-packages/serial/serialposix.py", line 565, in read
    ready, _, _ = select.select([self.fd, self.pipe_abort_read_r], [], [], timeout.time_left())
KeyboardInterrupt
Which suggest that rshell is waiting for a ">>>" prompt from the board.
I can only solve this by erasing flash again and reinstalling Micropython but this only helps for a few minutes until it starts again..

Any idea what is happening here? Any other steps I can take to solve or further debug this?
I'm not even sure what direction to look at in order to solve this...

Many thanks!
Zach

davef
Posts: 811
Joined: Thu Apr 30, 2020 1:03 am
Location: Christchurch, NZ

Re: Can't connect to ESP32-WROOM-32D (stuck at "Trying to connect to REPL..")

Post by davef » Wed Aug 03, 2022 6:50 pm

I have this in .bashrc and it works maybe 99% of the time. Was a recommendation found on this site. Note: 30 not 32

Code: Select all

alias rsusb='rshell -p /dev/ttyUSB0 --baud=115200 --editor nano --buffer-size=30 -a>
then

Code: Select all

source ~/.bashrc

zachmoshe
Posts: 6
Joined: Fri Jun 24, 2022 8:28 am

Re: Can't connect to ESP32-WROOM-32D (stuck at "Trying to connect to REPL..")

Post by zachmoshe » Wed Aug 03, 2022 7:09 pm

Thanks @davef but sadly it doesn't seem to work in my case. Still stuck on the same thing...
(and definitely a weird buffer size... :) )

davef
Posts: 811
Joined: Thu Apr 30, 2020 1:03 am
Location: Christchurch, NZ

Re: Can't connect to ESP32-WROOM-32D (stuck at "Trying to connect to REPL..")

Post by davef » Wed Aug 03, 2022 7:26 pm

Which chip for the USB to serial conversion?

zachmoshe
Posts: 6
Joined: Fri Jun 24, 2022 8:28 am

Re: Can't connect to ESP32-WROOM-32D (stuck at "Trying to connect to REPL..")

Post by zachmoshe » Wed Aug 03, 2022 8:21 pm

Well, I hope I get it right here.. Other than the large ESPRESSIF chip and the 1117C chip (which I believe is the voltage regulator), there is a chip named "SILABS CP2102". Is that the one?
If it helps with USB drivers, I'm on MacOS.

davef
Posts: 811
Joined: Thu Apr 30, 2020 1:03 am
Location: Christchurch, NZ

Re: Can't connect to ESP32-WROOM-32D (stuck at "Trying to connect to REPL..")

Post by davef » Wed Aug 03, 2022 8:38 pm

You got it right.

Sorry, no MacOS experience here.

Post Reply