Blog 2Smart (EN)

Flashing ESPHome Firmware on ESP32 Microcontroller Windows workflow

Flashing ESPHome Firmware on ESP32 Microcontroller Windows workflow
The following instructions will show vendors how to install the ESPHome firmware on the ESP32 microcontroller using a PC or laptop running Windows. They will be required for the first time during the product testing stage, after installation of the test firmware on the prototype.

Flashing a device using Windows PC

1. To flash a smart device from a Windows PC, you'll need to first install the most recent version of Python, which you can get from the developer's website.

Remember to check the "Add Python.exe to PATH" box when installing Python.

Python installing

2. Open the Windows command line interpreter by pressing Win + R and typing the command "cmd" into the appearing window.

Run command window

Windows command prompt

3. Unzip the firmware that was downloaded to your 2Smart Cloud account. Copy the path from the address bar to the folder with the archive's contents.

Windows Explorer

4. Enter the command "cd" in the command line interpreter, copy the path to the firmware folder (right mouse button or keyboard shortcuts Shift + Insert / Ctrl + V), and press Enter. The interpreter will go to the firmware folder.

Windows command prompt

5. Connect your smart device to a free USB port on your PC or power supply using a USB-micro USB cable.

Device prorotype

6. Paste the following command into the command line interpreter window:

pip install esptool

Press Enter.

Windows command prompt

7. Paste the following after executing the command: --chip esp32 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect 0xd000 boot_app0.bin 0x1000 bootloader_dio_40m.bin 0x10000 firmware.bin 0x8000 partitions.bin

Press Enter.

8. If the flashing process does not start, press the Boot button located next to the micro-USB port on the DevKit body.

Device prototype

9. After a successful flash, you will see the “Leaving… Hard resetting via RTS pin…” notification.

Windows command prompt

10. Return to your 2Smart Cloud account and wait until the device is detected by the platform. If this does not happen within one to two minutes, unplug your device and plug it back to the PC. The device's "Ready" status indicates that the prototype has successfully connected to the 2Smart Cloud platform.

Indicator of device status with the test firmware

After getting confirmation that the prototype with test firmware has been successfully connected to the platform, you can continue working on your product. A similar approach is used to install the production firmware version on finished devices.
Made on