Webrepl not working with arduino nano rp2040 connect

152 views
Skip to first unread message

nithin ps

unread,
Jul 9, 2022, 8:00:14 AM7/9/22
to thonny
Backend terminates with the following output.

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/thonny-4.0.0b3-py3.8.egg/thonny/plugins/esp/esp_back.py", line 5, in <module>
    from thonny.plugins.micropython.bare_metal_backend import (
ImportError: cannot import name 'launch_bare_metal_backend' from 'thonny.plugins.micropython.bare_metal_backend' (/usr/local/lib/python3.8/dist-packages/thonny/plugins/micropython/bare_metal_backend.py)

Process ended with exit code 1.

Any ideas?

Aivar Annamaa

unread,
Jul 13, 2022, 5:49:35 AM7/13/22
to thonny
Your stacktrace contains two locations:
  • /usr/local/lib/python3.8/dist-packages/thonny-4.0.0b3-py3.8.egg/thonny/plugins/esp/esp_back.py
  • /usr/local/lib/python3.8/dist-packages/thonny/plugins/micropython/bare_metal_backend.py
It looks like you may have two different Thonny versions interfering with each-other. Try removing everything related to thonny under /usr/local/lib/python3.8/dist-packages/ and also ~/.local/lib/python3.X and then re-install Thonny.

Best regards,
Aivar

nithin ps

unread,
Jul 13, 2022, 9:17:06 AM7/13/22
to thonny
Now I am getting the following error message.
Traceback (most recent call last):
  File "/home/inspiron3000/.local/lib/python3.8/site-packages/thonny/plugins/micropython/bare_metal_backend.py", line 1562, in <module>
    connection = WebReplConnection(args["url"], args["password"])
  File "/home/inspiron3000/.local/lib/python3.8/site-packages/thonny/plugins/micropython/webrepl_connection.py", line 47, in __init__
    raise res
  File "/home/inspiron3000/.local/lib/python3.8/site-packages/thonny/plugins/micropython/webrepl_connection.py", line 60, in _ws_main
    await self._ws_connect()
  File "/home/inspiron3000/.local/lib/python3.8/site-packages/thonny/plugins/micropython/webrepl_connection.py", line 73, in _ws_connect
    self._ws = await websockets.connect(self._url, ping_interval=None)
  File "/home/inspiron3000/.local/lib/python3.8/site-packages/websockets/legacy/client.py", line 650, in __await_impl_timeout__
    return await asyncio.wait_for(self.__await_impl__(), self.open_timeout)
  File "/usr/lib/python3.8/asyncio/tasks.py", line 501, in wait_for
    raise exceptions.TimeoutError()
asyncio.exceptions.TimeoutError

Backend terminated or disconnected. Use 'Stop/Restart' to restart.

Any suggestions?

nithin ps

unread,
Jul 13, 2022, 9:43:56 AM7/13/22
to thonny
With Thonny 4.0.0b3 I am getting the following error message.

WebREPL connected
PROBLEM IN THONNY'S BACK-END: Internal error (asyncio.exceptions.TimeoutError).
See Thonny's backend.log for more info.
You may need to press "Stop/Restart" or hard-reset your MicroPython device and try again.


Process ended with exit code 0.

Any suggestions?
On Wednesday, July 13, 2022 at 3:19:35 PM UTC+5:30 aivar....@gmail.com wrote:

Aivar Annamaa

unread,
Jul 15, 2022, 12:49:31 AM7/15/22
to thonny
I was finally able to reproduce your issue in Thonny 4.0 (had hard time updating board's firmware).

I could make it kind of work by reducing write_block_size setting (https://github.com/thonny/thonny/wiki/MicroPython#advanced-configuration) to 127, but the communication was unbearably slow. I've seen the same with ESP-32 boards, but with Nano RP2040 Connect it's even slower.

At the moment I don't have ideas how to fix this. Here's a related issue in MicroPython's tracker: https://github.com/micropython/micropython/issues/2497

nithin ps

unread,
Jul 15, 2022, 10:34:11 AM7/15/22
to thonny
Thanks for the support. Hope it will be fixed in the future.
Reply all
Reply to author
Forward
0 new messages