A cross-platform CLI tool to flash EMS-ESP firmware to ESP32-based EMS-ESP devices.
uv is a fast Python package manager.
Follow the official install instructions to get uv on your system.
uv tool install git+https://github.com/emsesp/EMS-ESP-Flasher-CLIThis makes the ems-esp-flasher command available system-wide.
No virtual environment management or pip required.
To upgrade to the latest version:
uv tool upgrade ems-esp-flasher-cliTo access a Windows COM port from WSL2, install usbipd-win:
winget install usbipdThen from a PowerShell admin window: usbipd bind --busid <id> followed by
usbipd attach -a -w -b <id>.
The port will appear as /dev/ttyUSB0 or /dev/ttyACM0 in the WSL2 environment.
ems-esp-flasher flash esp32 auto
ems-esp-flasher flash esp32s3 /dev/ttyUSB0esp32 targets the E32 V2 Gateway; esp32s3 targets the S3 board.
Use auto to let the tool detect the serial port, or supply a path like /dev/ttyUSB0.
ems-esp-flasher flash esp32 auto --version 3.7.0ems-esp-flasher flash esp32s3 auto --dev# Fetch all boards, latest stable
ems-esp-flasher firmware fetch
# Fetch only esp32, specific version
ems-esp-flasher firmware fetch --board esp32 --version 3.7.0
# Force re-download
ems-esp-flasher firmware fetch --forceems-esp-flasher firmware cleanems-esp-flasher flash esp32 auto --yesems-esp-flasher --help
ems-esp-flasher flash --help
ems-esp-flasher firmware --helpBy default the tool uses the GitHub API anonymously (60 requests/hour per IP).
For CI or shared environments, set a GITHUB_TOKEN environment variable to
authenticate and avoid rate limits:
export GITHUB_TOKEN=ghp_...
ems-esp-flasher flash esp32 autoThe test suite uses pytest and runs entirely without a physical device — all serial communication, esptool subprocess calls, and GitHub HTTP requests are mocked.
git clone https://github.com/emsesp/EMS-ESP-Flasher-CLI
cd EMS-ESP-Flasher-CLI
uv syncuv sync installs both the package and its dev dependencies (including pytest) into
an isolated virtual environment.
uv run pytestFor verbose output showing each test name:
uv run pytest -vTo run only a specific test file or test class:
uv run pytest tests/test_flash.py -v
uv run pytest tests/test_firmware.py::TestFirmwareFetch -v| File | What it covers |
|---|---|
tests/test_firmware.py |
firmware fetch and firmware clean subcommands |
tests/test_flash.py |
flash command — happy path, error handling, serial verification |
tests/conftest.py |
Shared fixtures and mock factories |