WebREPL tutorial
WebREPL tutorial
Dear all,
Sorry if this is a stupid/lazy question, but I wasn't able to figure it out myself: is it possible to edit or upload code wirelessly on a pyboard-D, using webREPL or some other method? If so, is there a tutorial somewhere?
Thanks in advance.
Sorry if this is a stupid/lazy question, but I wasn't able to figure it out myself: is it possible to edit or upload code wirelessly on a pyboard-D, using webREPL or some other method? If so, is there a tutorial somewhere?
Thanks in advance.
Re: WebREPL tutorial
webrepl does not work on the PYBD. The _webrepl module is missing, and also when including it, I get an error:
So there is more to do. I use my ftp server for copying file by ftp locally. https://github.com/robert-hh/FTP-Server ... 2-and-PYBD
File uftpd.py, which runs in background. There are other variants, like ftp.py, which runs in foreground. The server uses the same event noticing mechanism as webrepl, so it cannot coexist with webrepl. ftp.py can. One task on my list is to rewrite it using uasyncio.
Code: Select all
Traceback (most recent call last):
File "webrepl.py", line 47, in accept_conn
AttributeError: 'module' object has no attribute 'dupterm_notify'
File uftpd.py, which runs in background. There are other variants, like ftp.py, which runs in foreground. The server uses the same event noticing mechanism as webrepl, so it cannot coexist with webrepl. ftp.py can. One task on my list is to rewrite it using uasyncio.
Re: WebREPL tutorial
Hi, RoberthhRoberthh wrote: ↑Sun Oct 20, 2019 6:41 amwebrepl does not work on the PYBD. The _webrepl module is missing, and also when including it, I get an error:So there is more to do. I use my ftp server for copying file by ftp locally. https://github.com/robert-hh/FTP-Server ... 2-and-PYBDCode: Select all
Traceback (most recent call last): File "webrepl.py", line 47, in accept_conn AttributeError: 'module' object has no attribute 'dupterm_notify'
File uftpd.py, which runs in background. There are other variants, like ftp.py, which runs in foreground. The server uses the same event noticing mechanism as webrepl, so it cannot coexist with webrepl. ftp.py can. One task on my list is to rewrite it using uasyncio.
Are you sure WebREPL does not work on the PYBD? In this thread viewtopic.php?f=20&t=6438 jimmo says otherwise, but that was a couple months ago, so maybe the WebREPL support has been dropped recently. I would like to check that but I don't have a PYBD yet .
Re: WebREPL tutorial
I'm not sure.
I build the firmware myself. If I do that, neither webrepl.py is present. I can copy webrepl.py from the ESP8266 port to the device, and the I get the error above. dupterm_notify() is a method of the uos module for ESP32 and ESP8266, and in the STM32 package it does not exist. It may be that a different webrepl.py i needed, but that is not in the repository.
I build the firmware myself. If I do that, neither webrepl.py is present. I can copy webrepl.py from the ESP8266 port to the device, and the I get the error above. dupterm_notify() is a method of the uos module for ESP32 and ESP8266, and in the STM32 package it does not exist. It may be that a different webrepl.py i needed, but that is not in the repository.
Re: WebREPL tutorial
I think back in that thread I was using the firmware images that were on the downloads page before PYBD was integrated into master. I guess Damien must have been manually including webrepl.py into the builds. It definitely worked at the time. I don't know why the dupterm_notify wasn't a problem then though -- it's kind of annoying that this is a esp32/esp8266-port specific feature, I just ran into it with the BLE REPL too.
Anyway, now that we have manifests, there's a better path forward for how to make the STM32 builds include webrepl, so I will send a PR this morning to fix this and get webrepl properly supported in the PYBD builds.
Anyway, now that we have manifests, there's a better path forward for how to make the STM32 builds include webrepl, so I will send a PR this morning to fix this and get webrepl properly supported in the PYBD builds.
Re: WebREPL tutorial
The answer was that the pre-merging-to-master PYBD firmware available at the time had a version of webrepl.py with the dupterm_notify line commented out.
Anyway https://github.com/micropython/micropython/pull/5235 should sort this out. I've tested it with sending/receiving files.
Anyway https://github.com/micropython/micropython/pull/5235 should sort this out. I've tested it with sending/receiving files.
Re: WebREPL tutorial
With that change to webrepl it works indeed. I do not know whether is is needed to create a new place for webrepl. It may be better now that it is shared by three ports. But instead of extmod it could also be another existing directory like drivers, which already hold python modules.
Re: WebREPL tutorial
Yeah...conceptually I think it makes sense to live alongside modwebrepl.c as they only make sense together, but it does feel weird to put python code in extmod. Perhaps the answer is that webrepl doesn't live in extmod? There's a category of things that aren't drivers or tools... a kind of micropython standard library that isn't micropython-lib. I don't have strong feelings...will see what Damien thinks.
Re: WebREPL tutorial
At least with MicroPython 1.12 on PYBD (Pyboard D-series) seems to work when installing
https://github.com/micropython/micropyt ... od/webrepl
and setup using the usual "import webrepl_setup". However, when there is a main.py running, I get a password prompt but I do not get any output after login. When there is no main.py, I can login, start script, but I cannot abort execution (Ctrl+C).
https://github.com/micropython/micropyt ... od/webrepl
and setup using the usual "import webrepl_setup". However, when there is a main.py running, I get a password prompt but I do not get any output after login. When there is no main.py, I can login, start script, but I cannot abort execution (Ctrl+C).
-
- Posts: 2
- Joined: Tue Mar 23, 2021 5:41 pm
Re: WebREPL tutorial
I came here seeking answers to my webrepl issue on my esp32. In my case, I was using a chrome extension that forced a https connection at all times. As you know, the Micropython Webrepl can not work on an https connection, only http. In my case I just switched over to firefox and the problem went away.
Bottom line, when troubleshooting webrepl issues make sure your browser will accept http connections.
Bottom line, when troubleshooting webrepl issues make sure your browser will accept http connections.