micropython / webrepl

WebREPL client and related tools for MicroPython
MIT License
625 stars 296 forks source link

Pico-W and webrepl.py WebSocket - store micropython files inside this repository #71

Open mchobby opened 2 years ago

mchobby commented 2 years ago

Hi, I'm currently writing my third book around MicroPython (in French) and each time I'm getting trouble to setup the WebRepl deamon on the WiFi microcontroler. The reason for this is simple... the webrepl.py & webrepl_setup.py are moving here and there each time I need them.

Current 2022, the webrepl.py was located in micropython/micropython/extmod/webrepl/ (as mentionned in this Raspberry-Pi Thread https://forums.raspberrypi.com/viewtopic.php?t=337632 ). The missing files were there... but today (Sept 12, 2022) they have moved again :-/

Would it be a good idea to store such MicroPython sources together-with/aside the WebRepl client sources?

dpgeorge commented 2 years ago

There was recently a change to make webrepl work with HTTPS. See https://github.com/micropython/micropython/commit/924e55aca18978215209a2ed81a49b0a6bdcaaa7

But then it very recently moved to the micropython-lib repo (along with some other drivers), see https://github.com/micropython/micropython/commit/24678fe452e9c0d0b96575424f81fb4a5f5f4302

These files are frozen into Pico W firmware, so webrepl should "just work".

jimmo commented 2 years ago

These files are frozen into Pico W firmware, so webrepl should "just work".

@mchobby If there are any boards that you are describing in your book that don't already include webrepl as part of the standard firmware (i.e. frozen) then please let us know and we'll fix it.

mchobby commented 2 years ago

@dpgeorge Thank you, the information comes just right in time... I'm closing the chapter. I located the files in https://github.com/micropython/micropython-lib/tree/master/micropython/net/webrepl :-)

@jimmo, Just update the firmware to latest version ( MicroPython v1.19.1 on 2022-09-13; Raspberry Pi Pico W with RP2040 ) I can't import webrepl_setup and webrepl... apparently not included in the firmware yet.

Thanks you both for your quick reaction.

jimmo commented 2 years ago

Thanks @mchobby -- Sorry I forgot that we hadn't resolved https://github.com/micropython/micropython/issues/8928 yet.

Looks like I forgot to come back to that after resolving the https issue. I will sort this out today/tomorrow and the end result will be that all network-enabled rp2 boards will include webrepl automatically (and this will be in the 1.20 release). Just FYI, the correct way to use webrepl now is to go to http://device:8266/ rather than via http://micropython.org/webrepl/.

FYI if you're writing a book about the Pico W, I would definitely wait until 1.20 is released (soon!) before finalising anything as some APIs around WiFi might change in order to make it more consistent with other ports.

roaldarbol commented 1 year ago

@jimmo Just checking if there's an ETA for 1.20? Really excited to see webrepl included for RP2 boards! :-)