WebREPL freeze

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
gurrae
Posts: 6
Joined: Sat Jan 23, 2021 1:59 pm

WebREPL freeze

Post by gurrae » Sat Jan 23, 2021 2:15 pm

I am trying to use WebRepl on my ESP32 (ESP32 Devkit v1) & ESP8266 (Wemos d1 mini) boards.
I have no problem loading MicroPython firmware & running programs on the ESP32 or the 8266.
The problem appears when I want to run WebRepl on the boards.

I can import & run webrepl_setup, setup password and reboot so the Webrepl-program starts on both ESP32 & ESP8266).

I can then connect to the boards from my repl-client (downloaded from github), and type the password and get the message
WebREpl connected
>>>

After that I cannot type any commands , nothing happens when I try commands, or just simple 2+2 things
It seems dead, but I can go to the GET section and write boot.py and it downloads the file.

This behaviour is exactly the same on both the ESP32 & ESP8266.
I have tried different versions of firmware for both of them, tried different clients (PC, iPad etc.), downloaded firmware via Linux & via PC etc. but the problem remains.

Any ideas what to do ???

Christian Walther
Posts: 129
Joined: Fri Aug 19, 2016 11:55 am

Re: WebREPL freeze

Post by Christian Walther » Sat Jan 23, 2021 3:11 pm

To check whether the problem is with WebREPL, try a serial connection at the same time, you should see the same thing in both (what you type in one also appears in the other). If the serial connection is stuck too, the problem is not with WebREPL.

The behavior you describe is expected if there is a program running. The REPL only runs when no program is running – when there is no main.py or it has exited already. If your main.py is still running, try pressing ctrl-C to stop it (on either the WebREPL or serial terminal).

(The prompt >>> you see in the WebREPL terminal right after connecting is a fake one, it does not indicate that the REPL is running. The WebREPL client fabricates it to make things look normal when the real one has already been sent before the connection was open.)

gurrae
Posts: 6
Joined: Sat Jan 23, 2021 1:59 pm

Re: WebREPL freeze

Post by gurrae » Sat Jan 23, 2021 6:25 pm

I dont have any other programs running, I have erased the flash before installing the firmware, but no difference.

if i do:
import os
os.listdir()

the output is []

When I rebbot the shell says :
WebREPL daemon started on ws://192.168.4.1:8266
Started webrepl in normal mode


(and after that)
>>>

When I connect from my WebREPL client I get
WebREPL connection from ('192.168.4.3', 50419)

after that NOTHING

I dont know what more to do ??
Any other clues ??

seganku
Posts: 1
Joined: Mon Feb 15, 2021 4:00 pm

Re: WebREPL freeze

Post by seganku » Mon Feb 15, 2021 5:09 pm

Christian Walther wrote:
Sat Jan 23, 2021 3:11 pm
To check whether the problem is with WebREPL, try a serial connection at the same time, you should see the same thing in both (what you type in one also appears in the other). If the serial connection is stuck too, the problem is not with WebREPL.

The behavior you describe is expected if there is a program running. The REPL only runs when no program is running – when there is no main.py or it has exited already. If your main.py is still running, try pressing ctrl-C to stop it (on either the WebREPL or serial terminal).

(The prompt >>> you see in the WebREPL terminal right after connecting is a fake one, it does not indicate that the REPL is running. The WebREPL client fabricates it to make things look normal when the real one has already been sent before the connection was open.)
This was really helpful. Thonny had been throwing errors, but I was assuming that serial communication and WebREPL were mutually exclusive.

Code: Select all

ERROR   thonny.plugins.micropython.backend: PROBLEM WITH THONNY'S BACK-END:
Traceback (most recent call last):
  File "C:\Users\smith\AppData\Local\Programs\Thonny\lib\site-packages\thonny\plugins\micropython\backend.py", line 335, in _handle_normal_command
    response = handler(cmd)
  File "C:\Users\smith\AppData\Local\Programs\Thonny\lib\site-packages\thonny\plugins\micropython\backend.py", line 660, in _cmd_get_object_info
    basic_info = self._find_basic_object_info(cmd.object_id, context_id)
  File "C:\Users\smith\AppData\Local\Programs\Thonny\lib\site-packages\thonny\plugins\micropython\backend.py", line 721, in _find_basic_object_info
    % object_id
  File "C:\Users\smith\AppData\Local\Programs\Thonny\lib\site-packages\thonny\plugins\micropython\backend.py", line 544, in _evaluate
    out, err = self._execute(script, capture_output=True)
  File "C:\Users\smith\AppData\Local\Programs\Thonny\lib\site-packages\thonny\plugins\micropython\backend.py", line 500, in _execute
    self._execute_with_consumer(script, consume_output)
  File "C:\Users\smith\AppData\Local\Programs\Thonny\lib\site-packages\thonny\plugins\micropython\bare_metal_backend.py", line 701, in _execute_with_consumer
    self._submit_code(script)
  File "C:\Users\smith\AppData\Local\Programs\Thonny\lib\site-packages\thonny\plugins\micropython\bare_metal_backend.py", line 560, in _submit_code
    self._submit_code_via_raw_paste_mode(to_be_sent)
  File "C:\Users\smith\AppData\Local\Programs\Thonny\lib\site-packages\thonny\plugins\micropython\bare_metal_backend.py", line 650, in _submit_code_via_raw_paste_mode
    self._raw_paste_write(script_bytes)
  File "C:\Users\smith\AppData\Local\Programs\Thonny\lib\site-packages\thonny\plugins\micropython\bare_metal_backend.py", line 684, in _raw_paste_write
    raise AssertionError("Unexpected read during raw paste: {}".format(data))
AssertionError: Unexpected read during raw paste: bytearray(b'd')
upterm: Exception in write() method, deactivating: OSError: [Errno 104] ECONNRESET
ERROR   thonny.plugins.micropython.backend: PROBLEM WITH THONNY'S BACK-END:
Traceback (most recent call last):
  File "C:\Users\smith\AppData\Local\Programs\Thonny\lib\site-packages\thonny\plugins\micropython\backend.py", line 335, in _handle_normal_command
    response = handler(cmd)
  File "C:\Users\smith\AppData\Local\Programs\Thonny\lib\site-packages\thonny\plugins\micropython\backend.py", line 631, in _cmd_get_globals
    "{name : (__thonny_helper.repr(value), id(value)) for (name, value) in globals().items() if not name.startswith('__')}"
  File "C:\Users\smith\AppData\Local\Programs\Thonny\lib\site-packages\thonny\plugins\micropython\backend.py", line 544, in _evaluate
    out, err = self._execute(script, capture_output=True)
  File "C:\Users\smith\AppData\Local\Programs\Thonny\lib\site-packages\thonny\plugins\micropython\backend.py", line 500, in _execute
    self._execute_with_consumer(script, consume_output)
  File "C:\Users\smith\AppData\Local\Programs\Thonny\lib\site-packages\thonny\plugins\micropython\bare_metal_backend.py", line 701, in _execute_with_consumer
    self._submit_code(script)
  File "C:\Users\smith\AppData\Local\Programs\Thonny\lib\site-packages\thonny\plugins\micropython\bare_metal_backend.py", line 560, in _submit_code
    self._submit_code_via_raw_paste_mode(to_be_sent)
  File "C:\Users\smith\AppData\Local\Programs\Thonny\lib\site-packages\thonny\plugins\micropython\bare_metal_backend.py", line 648, in _submit_code_via_raw_paste_mode
    raise AssertionError("Got %r instead of raw-paste confirmation" % response)
AssertionError: Got bytearray(b'\x01\x01') instead of raw-paste confirmation
This is looking more like a Thonny issue, what with the "PROBLEM WITH THONNY'S BACK-END" and all.

Looking at that forum, I do see a post on the issue.

Post Reply