How to Backup & Restore Official Firmware on any Espressif ESP8266 & ESP32

  1. Download and install Python 2.x or 3.x from
  2. Download Esptool from
  3. Extract the contents of esptool compressed file to c:\esptool.
  4. Open Command Prompt ( Start > Run > cmd ) and navigate to esptool folder cd c:/esptool .

Install the esptool by issuing the commands below.

python install

pip install pyserial

Change COM3 to your own Port

For  1M Flash:
python -b 115200 --port COM3 read_flash 0x000000 0x100000 flash_1M.bin 
python -b 115200 --port COM3 write_flash --flash_freq 80m 0x000000 flash_1M.bin 

For  4M Flash:
python -b 115200 --port COM3 read_flash 0x00000 0x400000 flash_4M.bin
python -b 115200 --port COM3 write_flash --flash_freq 80m 0x000000 flash_4M.bin

that is all
you should get something like this for the 4M flash

D:\SONOFF\ESPTool\esptool-2.6\esptool-2.6>python -b 115200 --port COM3 read_flash 0x00000 0x400000 flash_4M.bin v2.6
Serial port COM3
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
MAC: 80:7d:3a:33:xx:xx
Uploading stub...
Running stub...
Stub running...
4194304 (100 %)
4194304 (100 %)
Read 4194304 bytes at 0x0 in 402.0 seconds (83.5 kbit/s)...
Hard resetting via RTS pin...

to write flash you need to erase it first by erase_flash


More information

A Python-based, open source, platform independent, utility to communicate with the ROM bootloader in Espressif ESP8266 & ESP32 chips. was started by Fredrik Ahlberg (@themadinventor) as an unofficial community project. It is now also supported by Espressif. Current primary maintainer is Angus Gratton (@projectgus). is Free Software under a GPLv2 license.

  • Take care when you backup, both Sonoff POW and POW R2 have a 4M flash and not 1M .

  • When restoring your device always use the SAME FILE you backed up from that device otherwise it will not work .

another interesting site

1 Like

Flashing ESP8266 Firmware using, run on “Linux” with Python 2.7.

Another good video for Windows but in “Thai Language”

this person had many interesting videos related to Blynk you can find here

latest video in our forum @pasagame
**** Earned 'Popular Link’

Another good video showing how to Backup Firmware for ESP32 & ESP8266


@Ze_Pico Thank you.

1 Like

Now you can use " TASMOTIZER " to
Automatic backup of current ESP image before flashing: in case you want to return to manufacturer firmware