How to upload files to MicroPython using WebREPL using

First, clone the webrepl repository:

git clone

Now use ampy to initially setup your wifi connection and setup both wifi and WebREPL on on boot (see How to autoconnect to Wifi using MicroPython on your ESP32 board):

import network
station = network.WLAN(network.STA_IF)
station.connect("MyWifi", "MyWifiPassword")

# Start webrepl
import webrepl

Upload via the serial port using

ampy -p /dev/ttyUSB0 put

You should only have to do this once (except if you break you If the upload doesn’t work

Go to the directory where is located:

cd webrepl

Now you can upload using

./ -p Rua8ohje ../ espressif.local:/

You might need to use a different host, but espressif.local seems to work out-of-the-box in many configurations.

The output should look like this:

op:put, host:espressif.local, port:8266, passwd:Rua8ohje.
../ -> /
Remote WebREPL version: (1, 12, 0)
Sent 329 of 329 bytes

Now, reset your board using the reset button, so your updated will be executed.