Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pyboard-D: Webrepl not responding #7208

Open
kevinkk525 opened this issue May 3, 2021 · 4 comments
Open

Pyboard-D: Webrepl not responding #7208

kevinkk525 opened this issue May 3, 2021 · 4 comments

Comments

@kevinkk525
Copy link
Contributor

kevinkk525 commented May 3, 2021

I tried using the webrepl on my pyboard-D but it doesn't go further than entering my password. After that, nothing happens. Not even the repl output gets sent to the webrepl. Sending/Receiving files also doesn't work.
When I interrupt my uasyncio program or any other executed code on the pyboard, everything works fine again. (But I need to Interrupt from the console, it doesn't work through the webrepl)
Oddly enough, starting the same code again from the webrepl makes the repl output appear in the webrepl, however the KeyboardInterrupt still won't work.
I don't have these problems on my esp8266 or esp32.

I'm using micropython 1.15 nightly from the download page.

additionally: Sending files to the pyboard through webrepl doesn't make them appear in the PYBFLASH drive on windows until a hard reset. Not even a soft reset makes them show up. But that is a separate issue and not really important (who uses webrepl to upload files while connected to a pc...)

Steps to reproduce:

  1. Connect to wlan and start webrepl
  2. Have a script (or run from serial repl) start some code:
import time
c=0
while True:
    print(c)
    c+=1
    time.sleep(1)
  1. Connect through webrepl
  2. Entering password works, serial repl prints connection established

Expected Behaviour:
The output of the script gets printed to both serial repl and webrepl, file upload/downloads work while the script runs, KeyboardInterrupts work.

Actual Behaviour:

  1. No output printed to the webrepl. Interestingly though, if you Interrupt the script from the serial repl and start it again from the webrepl, the output gets printed to the webrepl. But reconnecting the webrepl results in the same problem, no output.
  2. No KeyboardInterrupt. Not even when the script prints the output to the webrepl.
  3. Webrepl is only responsive while no script is running (so you need to interrupt it from the serial repl before you can enter anything in the webrepl).
  4. No file upload/download while a script is running.
  5. Disconnect only due to timeout while a script is running.
@robert-hh
Copy link
Contributor

additionally: Sending files to the pyboard through webrepl doesn't make them appear in the PYBFLASH drive on windows until a hard reset.

That's a PC behvior and a common cause for file system corruption on the board. The PC's OS does not expect the board to change the content of it's file system. The PC assumes it's the only instance doing so. A reset detaches the USB shortly and causes the PC to re-scan the board.

@kevinkk525
Copy link
Contributor Author

Judging by the lack of responses here and in the forum thread, I must be the only one with this problem. So for everyone else reading this, your webrepl is working just fine on the pyboard?

@felixdoerre
Copy link
Contributor

Just to post for future reference, it seems that the feature to have KeyboardInterrupts accepted while not reading from stdin (like while waiting with sleep or reading from a socket), is only implemented for esp8266:

STATIC mp_obj_t mp_uos_dupterm_notify(mp_obj_t obj_in) {

in combination with https://github.com/micropython/micropython-lib/blob/796a5986cd65e8f2c76d06267b92497ff602eca6/micropython/net/webrepl/webrepl.py#L132. Although other ports could probably quite easily import that callback as well.

@felixdoerre
Copy link
Contributor

Ooh, I just found 2 more ports implementing this callback. And it seems they do it in a rather "portable" way:

STATIC mp_obj_t mp_uos_dupterm_notify(mp_obj_t obj_in) {

Probably the respective function could just be copied to the port you're interested in.

tannewt added a commit to tannewt/circuitpython that referenced this issue Nov 18, 2022
Add support for the 16MB WeAct Studio Pico
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants