↓ Skip to main content

Introduction to the ESP32-S31 with Vision: Tooling: Getting started with ESP-Vision

·8 mins·
Table of Contents
ESP32-S31-VISION - This article is part of a series.
Part 3: This Article

Build vision applications fast
#

ESP-Vision logo

ESP-Vision is an open-source rapid-development environment for camera and edge-AI applications on Espressif hardware. It combines an ESP32 build of MicroPython with high-level camera, image, display, and inference modules.

In this assignment, you will flash ESP-Vision and connect the ESP32-S31-Korvo-1 to the ESP-Vision Web IDE. The first Python application comes after the LED Blink assignment.

Tip

The Web IDE requires no installation. It provides editing, run and stop controls, camera preview, examples, and access to device files.

How ESP-Vision works
#

ESP-Vision code runs on the SoC, not on your computer. It uses MicroPython, a compact implementation of Python designed for microcontrollers, rather than desktop CPython. Common Python syntax is available, but the standard library is intentionally smaller and selected at firmware build time. Desktop packages, native wheels, pip, and operating-system services are not available on the device.

The ESP32-S31 build provides these principal modules:

ModulePurpose
sensorConfigure the installed OV3660 or SC101IOT and capture frames
imageDraw, filter, transform, and analyze images
displayControl the board LCD
espdlLoad and execute .espdl models
tfliteExecute supported TensorFlow Lite Micro models
image.ImageIO (part of image)Read and write supported image sequences

ImageIO is registered as part of the image public API. Access it as image.ImageIO; do not use import imageio, because the firmware does not provide a separate imageio module.

ESP-Vision also inherits a subset of MicroPython modules. The ESP32-S31 documentation indexes the following module groups:

GroupModules
Runtime_thread, asyncio, builtins, gc, micropython, platform, sys, time, weakref
Data structures and serializationarray, btree, collections, heapq, json, marshal, struct, uctypes
Math and textcmath, math, random, re
Binary, compression, and cryptographybinascii, cryptolib, deflate, gzip, hashlib, zlib
Files and streamserrno, io, os, vfs
Hardware and graphicsesp, esp32, framebuf, machine
Networkingnetwork, select, socket, ssl
Important

Module availability depends on the exact ESP-Vision firmware and board configuration. The ESP32-S31 profile disables Bluetooth, ESP-NOW, and machine.ADC; the workshop firmware also does not provide the neopixel module. Do not assume that a module available in CPython, another MicroPython port, or an online example is present here.

To see the definitive module list for the firmware currently running on your board, enter this command in the REPL:

help("modules")

You can inspect a module’s available classes and functions in the same way:

import machine
help(machine)

The typical loop is:

graph TD
    Script[main.py] --> Sensor[sensor.snapshot]
    Sensor --> Image[Image in memory]
    Image --> Model[ESP-DL inference]
    Model --> Draw[Draw results]
    Draw --> LCD[image.flush]

Why start with ESP-Vision?
#

ESP-Vision and MicroPython shorten the development loop compared with a native ESP-IDF application:

AreaESP-Vision and MicroPythonNative ESP-IDF
Development cycleEdit and run a Python script immediatelyConfigure, compile, link, and flash the firmware after code changes
Interactive testingUse the REPL to inspect the device and try commands one at a timeUse application logs, the serial monitor, and native debugging tools
Vision APIsAccess the camera, images, display, and inference through high-level modulesSelect, configure, and integrate the required components
Model evaluationCopy a compatible model to the device, change thresholds in Python, and quickly repeat testsModel or configuration changes may require rebuilding and flashing the application
VisualizationUse the Web IDE camera preview, logs, and color histogramImplement the required display, logging, or visualization path in the application
Hardware controlUse the features exposed by the firmwareAccess the complete ESP-IDF API and control tasks, memory, peripherals, and performance in detail

The REPL is particularly useful during bring-up because it lets you check an import, inspect a module, capture one frame, or read a value without creating and rebuilding a complete application.

ESP-Vision is also an effective platform for evaluating compatible models. You can replace a model file, adjust score and NMS thresholds, and observe the results with the same camera and target hardware that the final application will use. This makes it easier to compare model behavior before integrating it into a larger native ESP-IDF project.

ESP-Vision does not replace ESP-IDF. Use ESP-IDF when the application needs lower-level peripheral control, custom native components, tighter memory and task management, or production-specific system integration. Assignments 6 and 7 introduce that workflow.

Scripts and model files are separate. Models used in this workshop are stored in the root directory of the internal flash filesystem. A FAT32 microSD card mounted at /sdcard is only needed for models that are too large for the available flash filesystem space.

Step 1: Flash ESP-Vision
#

Warning

The USB Type-C UART port is not available for the ESP-Vision development workflow. Connect the computer to the board’s USB Type-A USB CDC/JTAG/Debug port with a data-capable USB Type-A to Type-A cable. The native USB connection is required because transferring the live camera preview over UART is too slow.

Important

Power supplied through the USB Type-A connection bypasses the board’s power switch. Moving the switch to OFF does not turn the board off while the Type-A cable is connected. Disconnect the Type-A to Type-A cable to fully remove power.

  1. Connect a data-capable USB Type-A to Type-A cable between your computer and the board’s USB Type-A USB CDC/JTAG/Debug port.
  2. Open vision.espressif.com in a supported desktop browser.
  3. Select Flash It Now.
ESP-Vision landing page with the Flash It Now button
Open the ESP-Vision website and select Flash It Now.
  1. Choose ESP32-S31-Korvo-1 and the current stable ESP-Vision firmware.
  2. Under Flash Mode, select Full Install (blank board / recovery).
ESP-Vision web flasher configured for the ESP32-S31-Korvo-1
Select the ESP32-S31 chip, ESP32-S31-Korvo-1 board, and current firmware.
  1. Select Connect Serial.
  2. Choose the USB CDC/JTAG/Debug device associated with the ESP32-S31-Korvo-1, and then select Connect.
Browser serial-port dialog with the ESP32-S31-Korvo-1 device selected
Select the USB CDC/JTAG/Debug connection for the board.
  1. Start flashing and wait until the operation completes. Do not disconnect or power off the board while firmware is being written.
ESP-Vision web flasher writing firmware to the connected ESP32-S31
The progress bar and serial terminal show the firmware flashing status.

If the browser cannot start the download, put the board into download mode:

  1. Hold Boot.
  2. Press and release Reset.
  3. Release Boot.
  4. Retry the web flasher.
Important

Flashing replaces any native ESP-IDF application currently on the board. You can restore one later with idf.py flash.

After ESP-Vision starts, the host computer detects the board as a removable disk. This disk exposes the files stored in the board’s internal flash filesystem. You can copy scripts, models, and other application files directly to its root directory.

Step 2: Connect to the board
#

Close serial monitors and other applications first; only one application can own the USB CDC/JTAG/Debug device at a time.

Important

ESP-Vision Web IDE 1.3.0 requires firmware with EV-MUX v4. If the board has older ESP-Vision firmware, return to the web flasher and perform a Full Install (blank board / recovery) before connecting to the Web IDE. See the ESP-Vision release notes for compatibility details.

  1. Open the Web IDE from vision.espressif.com.
  2. Select Connect.
  3. Choose the ESP32-S31-Korvo-1 USB CDC/JTAG/Debug device.
ESP-Vision Web IDE serial-port dialog with the ESP32-S31 selected
Connect the Web IDE to the board’s USB CDC/JTAG/Debug device.
  1. Stop any script that starts automatically.
  2. Open the device REPL (Read-Evaluate-Print Loop). The REPL is MicroPython’s interactive console: it reads a command, evaluates it on the ESP32-S31, prints the result, and waits for the next command. It is useful for checking the connection, trying short API calls, and viewing script output or errors.

The connection is ready when the Web IDE reports the device as connected and the REPL displays the MicroPython prompt (>>>).

Tip

The IDE camera preview is especially useful when your development board or setup does not include an LCD. It lets you inspect live camera frames directly on your computer while developing and debugging the application. The preview also includes an RGB color histogram for examining the distribution of red, green, and blue values in each frame.

Connected ESP-Vision Web IDE showing files, source code, camera preview, and logs
The connected Web IDE provides device files, source editing, preview, REPL, and system logs.

Step 3: Explore the development workflow
#

ESP-Vision applications normally follow this cycle:

  1. Edit a script in the Web IDE.
  2. Save it locally or to the device filesystem.
  3. Run it and observe the preview and device output.
  4. Stop it before replacing the file or opening another transport.
  5. Review exceptions from the bottom upward; the final line gives the exception type and message.

Use main.py only when you want a script to run automatically at boot. During development, use a separate filename so a faulty infinite loop does not restart after every reset.

The Web IDE also provides access to bundled examples, the API library reference, and files on the mounted ESP-Vision flash disk.

Common problems
#

SymptomResolution
No ESP-Vision device appearsUse a data-capable USB Type-A to Type-A cable and the board’s USB Type-A USB CDC/JTAG/Debug port
Port is busyDisconnect the other Web IDE session, and close idf.py monitor or any serial terminal
Script cannot import a desktop packageUse only firmware modules or copy a compatible pure-Python module to /lib

What you learned
#

In this section, you:

  • Used ESP-Vision on the ESP32-S31-Korvo-1
  • Learned the difference between device-side MicroPython and desktop Python
  • Flashed the ESP-Vision firmware through the browser
  • Connected to the board with the Web IDE
  • Explored the edit, run, stop, preview, example, and device-file workflow

Next step
#

Tooling: Set up the ESP-Vision MCP server

Return to the workshop main page

ESP32-S31-VISION - This article is part of a series.
Part 3: This Article

Related