# WebREPL Set Up for Micropython

**URL:** <https://forum.arduino.cc/t/webrepl-set-up-for-micropython/1280670>\
**Category:** Tutorials\
**Created:** [July 11, 2024, 5:22pm UTC](https://forum.arduino.cc/t/webrepl-set-up-for-micropython/1280670 "2024-07-11T17:22:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sumguy](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sumguy/32/1134826_2.png) [@sumguy](https://forum.arduino.cc/u/sumguy)\
**Post date:** [July 11, 2024, 5:22pm UTC](https://forum.arduino.cc/t/webrepl-set-up-for-micropython/1280670/1 "2024-07-11T17:22:23Z")

</div>

WebREPL allows programming Micropython, modifying, adding and deleting files using your home network without having to disconnect from the internet. Your device doesn't even have to be physically connected to a PC , the option to use the normal usb com port still remains.  
WebREPL is an option built into the Thonny IDE and the following instructional steps were written while using Thonny and a variety of ESP32 modules. It's obviously not as fast to use as a usb com port but I think it works well and you don't even have to be in the same room as the device..

1./ Using Thonny and your device connected via usb save the following code to the device as boot.py. Rename SSID and PASSWORD to suit your network

```arduino
import network
import time
import webrepl

def wifi_connect():
    wlan = network.WLAN(network.STA_IF)
    wlan.active(True)
    wlan.connect(SSID, PASSWORD)
    while not wlan.isconnected():
        time.sleep_ms(100)
    import webrepl_setup
    
wifi_connect()

webrepl.start()

```

2./ In the Shell type "import boot"  
3./ The resulting output should ask whether you want to enable webrepl on boot.  
4./ Type E and press enter.  
5./ It then asks for a password followed by confirmation, enter and confirm your password.  
6./ After that you should be back at the prompt in the Shell "\>\>\>"  
7./ Now comment out the line of code "import webrepl\_setup" and save the modified code to your device as boot.py.  
8./ In the Shell type "import boot"  
9./ This time you should get the following message in the Shell, your URL details will probably be different.

```
WebREPL server started on http://192.168.1.215:8266/
Started webrepl in normal mode

```

10./ Finally goto "Tools - Options - Intepreter and change the port to WebREPL , and enter the url from the previous step eg. ws://192.168.1.215:8266/ , then the password. When you click "OK" the Shell should say WebREPL connected and the files on the device should be refreshed in the file view pane of Thonny, this takes a few seconds so be patient.

Boards tried and tested successfully

ESP32 Devkit V1  
ESP32 S2 DevkitC  
Nano ESP32 S3  
Lilygo T display with ESP32 S3  
Rasberry Pi Pico W (RP2040)

---

<div class="post-metadata">

**Author:** ![sumguy](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sumguy/32/1134826_2.png) [@sumguy](https://forum.arduino.cc/u/sumguy)\
**Post date:** [July 11, 2024, 7:52pm UTC](https://forum.arduino.cc/t/webrepl-set-up-for-micropython/1280670/2 "2024-07-11T19:52:18Z")

</div>

Guys I would love some feedback positive or negative on this instructional, I did have a failure on a Seeed Studio ESP C3 and I have not tried all of the Nano's the Giga or Portenta.

Even if it's not for you long term maybe you could give it a try, any comments would be great .

---

<div class="post-metadata">

**Author:** ![EmilyJane](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/emilyjane/32/821537_2.png) [@EmilyJane](https://forum.arduino.cc/u/EmilyJane)\
**Post date:** [July 11, 2024, 7:53pm UTC](https://forum.arduino.cc/t/webrepl-set-up-for-micropython/1280670/3 "2024-07-11T19:53:51Z")

</div>

I did a quick test on a Raspberry Pi PicoW and it worked. It didn’t seem any faster or better than RVNC into a Raspberry Pi 4 running Thonny and hosting the PicoW though so I won’t be changing probably.

---

<div class="post-metadata">

**Author:** ![sumguy](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sumguy/32/1134826_2.png) [@sumguy](https://forum.arduino.cc/u/sumguy)\
**Post date:** [July 11, 2024, 8:17pm UTC](https://forum.arduino.cc/t/webrepl-set-up-for-micropython/1280670/4 "2024-07-11T20:17:30Z")

</div>

@EmilyJane thanks, my objective is to give anyone that is inclined the option to "wifi" into their board in the easiest way possible and also give a list of known devices that work with this method so your comment is 5 stars.

---

<div class="post-metadata">

**Author:** ![EmilyJane](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/emilyjane/32/821537_2.png) [@EmilyJane](https://forum.arduino.cc/u/EmilyJane)\
**Post date:** [July 11, 2024, 8:22pm UTC](https://forum.arduino.cc/t/webrepl-set-up-for-micropython/1280670/5 "2024-07-11T20:22:02Z")

</div>

I think you’re objective is good and I’m just used to doing it over VNC because when I started programming Picos in MicroPython there wasn’t a W version so WebRepl wasn’t an option.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [January 7, 2025, 8:22pm UTC](https://forum.arduino.cc/t/webrepl-set-up-for-micropython/1280670/6 "2025-01-07T20:22:47Z")

</div>

Closed on January 7, 2025, 8:22pm UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
