Linux: Installing and Testing "esptool" Utility

Contents

Getting Started

This article describes how to install and test the esptool tool on Linux. This utility provides an easy to use method for installing and updating MicroPython on ESP32 based microcontroller boards.

This article; Windows: Installing and Testing "esptool" Utility describes the Windows install.

ESP32 development boards typically come with the Arduino bootloader or no firmware at all. Most ESP8266 modules, such as the ESP-01 or NodeMCU, are typically shipped with Espressif's AT command firmware or a manufacturer-specific version. This allows the module to function as a Wi-Fi serial bridge out of the box.

The esptool tool is a Python-based, open-source, platform-independent utility used to flash, erase, read, and manage firmware on Espressif ESP32 and ESP8266 microcontrollers.

It communicates with the ROM bootloader to perform low-level operations such as:

  • Flashing firmware: Writing .bin files to the chip's flash memory. This is how MicroPython firmware is flashed to ESP32 and ESP8266 microcontroller.
  • Erasing flash: Clearing all or part of the flash memory.
  • Reading flash: Backing up existing firmware or memory contents.
  • Querying chip information: Retrieving chip type, MAC address, flash size, and more.

NOTE: Previous to Version v5.0.0 the Linux (and Mac) version of this tool was called esptool.py. At the time of writing this article (March 2026) the current version is v5.2.0, with the tool name now simply esptool.

For anyone working with ESP32 and ESP8266 microcontrollers and using MicroPython this is an essential tool to have installed on the computer.

Installing the esptool Utility on Linux

  1. Is Python installed?: In a Terminal enter the following:
    •   Python --version  
    The version number will be returned if Python is installed.
    •   Python 3.14.2  
    If necessary install Python 3 with the distribution's package manager. The executable (python3) is automatically added to the system PATH.
  2. Is esptool is already installed? Enter the following into the Terminal:
    •   esptool version  
    If it isn't installed an error message to that effect will be returned. Continue on to install it.
  3. Install pipx: The utility pipx installs and runs Python applications in isolated virtual environments. It prevents version conflicts between tools.
    1. Install pipx:
      1. Ubuntu/Debian:

        sudo apt update && sudo apt install pipx
      2. Fedora:

          sudo dnf install pipx  
      3. Arch Linux

          sudo pacman -S pipx  
    2. Ensure Path: Run the following and restart the Terminal:

        pipx ensurepath  
  4. Install esptool: Run the following in the Terminal:
    •   pipx install esptool  
  5. Verify the install:
    •   esptool version  
    If the install has been successful then something like this should be returned:
    •   esptool v5.2.0  

Testing the esptool Utility

The following ESP32 chips have native USB support:

  • ESP32-S2
  • ESP32-S3
  • ESP32-C6

The remainder of the ESP32 family require an external chip to supply USB support. The most common support chips found on development boards are:

  • CP2102 / CP2104 (Silicon Labs)
  • CH340G / CH343P (WCH)
  • FT23RL (FTDI)

Linux has driver support for all three of these options.

The esptool tool will generally detect any ESP32 board automatically that is plugged into a computer USB port. On the very odd occasion that the ESP32 is not detected it can be manually put into flash mode:

  1. Hold down the BOOT (or GPIO0) button.
  2. Press and release the EN (or RESET) button.
  3. Release the BOOT button.
  4. After flashing, reset the board.

We tested our installation with a WeAct Studio ESP32-DOWD-V3 board with 8MB of external SPI flash. It has a CH343P chip that provides USB support.

There was no problem in our Linux distribution (Fedora) with the ESP32 appearing on /dev/ttyUSB0.

Run the following command in a Terminal:

esptool flash-id

esptool v5.2.0
Connected to ESP32 on /dev/ttyUSB0:
Chip type:          ESP32-D0WD-V3 (revision v3.1)
Features:           Wi-Fi, BT, Dual Core + LP Core, 
                    240MHz, Vref calibration in eFuse,
                    Coding Scheme None
Crystal frequency:  40MHz
MAC:                4c:c3:82:06:4a:d8

Stub flasher running.

Flash Memory Information:
=========================
Manufacturer: ef
Device: 4017
Detected flash size: 8MB
Flash voltage set by a strapping pin: 3.3V

Hard resetting via RTS pin...
          

The ESP32 board was correctly discovered on /dev/ttyUSB0. Note the following about the manufacturer and device ID:

  • Manufacturer: ef — This corresponds to Winbond, a common manufacturer of flash memory chips used in ESP8266 and ESP32 modules.
  • Device: 4017 — This is the device ID for a 64 Mbit (8 MB) flash chip, typically operating in quad I/O mode.

Checking for esptool Utility Updates

It's a good idea to periodically check for esptool updates. New versions may provide extra functionality to support new ESP32 chips, make the tool easier to use and most importantly, fix bugs.

Enter the following into a Terminal:

  •   pipx upgrade esptool  

Any update available will be installed. If there is no update then the message "esptool is already at latest version" will be given.