You can also use this board with MicroPython and it's quite a nice experience

This page has information and download for the most recent release of MicroPython for ESP32-C3 - just make sure you select 'USB' type since we are taking advantage of the USB port built into the C3!

You'll need esptool 3.1 or later to program the C3. Enter the ROM bootloader by holding down the BOOT button while clicking RESET button. Then upload to the serial port or COM port created.

We used a command like this to upload successfully

esptool --chip esp32c3 --port COM3 --baud 115200 --before default_reset --after hard_reset --no-stub  write_flash --flash_mode dio --flash_freq 80m 0x0 firmware.bin

To manage and run code, we used Thonny - setup to be a MicroPython (ESP32) board, then pick the matching serial port.

Install the urequests library via the Package Manager

Download the following code and save it to your ESP32-C3 as

Don't forget to change MY_SSID and MY_PASSWORD to your WiFi access point

import time
import network
import urequests
station = network.WLAN(network.STA_IF)

# Network settings
wifi_ssid = "MY_SSID"
wifi_password = "MY_PASSWORD"
url = ""

print("Scanning for WiFi networks, please wait...")
authmodes = ['Open', 'WEP', 'WPA-PSK' 'WPA2-PSK4', 'WPA/WPA2-PSK']
for (ssid, bssid, channel, RSSI, authmode, hidden) in station.scan():
  print("* {:s}".format(ssid))
  print("   - Channel: {}".format(channel))
  print("   - RSSI: {}".format(RSSI))
  print("   - BSSID: {:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}".format(*bssid))

# Continually try to connect to WiFi access point
while not station.isconnected():
    # Try to connect to WiFi access point
    station.connect(wifi_ssid, wifi_password)

# Display connection details
print("My IP Address:", station.ifconfig()[0])

# Perform HTTP GET request on a non-SSL web
response = urequests.get(url)

# Display the contents of the page

Now click Stop and Run to load the and run it, you should get the following indicating it could connect to WiFI and read the data from our webserver

This guide was first published on Mar 14, 2022. It was last updated on Jun 19, 2024.

This page (MicroPython Setup) was last updated on Mar 08, 2024.

Text editor powered by tinymce.