Backup & Restore Official Firmware of Sonoff WiFi Smart Switches

Contents:

Controlling Sonoff Smart Switches without internet over Local Area Network is hot topic for Sonoff enthusiasts. After loading any custom firmware to Sonoff, you cannot go back to the official firmware but now you can!!. Just backup your official firmware by following the instructions below and you can restore it later if you want. So Let’s get started..

Hardware Requirements:

Software Requirements:

Step-by-Step Procedure:

Step A:

Download and install Python 2.x or 3.x from https://www.python.org/downloads. Download Esptool from https://github.com/espressif/esptool/releases. Extract the contents of esptool compressed file to C:\. All the contents of esptool should be under  c:\esptool.

Step B:

  • Open Command Prompt (Start > Run > cmd) and navigate to esptool folder.
  • Install the esptool by issuing the command below.
It takes few seconds to upload firmware and output will be shown as follows.

Step C:

Now We are just one step behind to download / upload any firmware to our Sonoff Smart Switch. Connect FTDI to Sonoff Smart Switch (For detailed information about each Sonoff Switch, visit Sonoff Smart Switch LAN Control without Internet) and start Sonoff device in programming mode. Now find the port under Control Panel > System > Device Manager > Ports at which Sonoff device is connected.

Backup / Download Official Firmware:

  • Change COM5 to your own Port.
  • Wait a minute and firmware binary file will be downloaded and saved in to  c:\esptool

It takes few seconds to upload firmware and output will be shown as follows.

Step D:

Erase Flash Memory:

Erase the custom firmware from flash memory before uploading any new firmware.

  • Change COM5 to your own Port.

It takes few seconds to erase firmware and output will be shown as follows.

Upload Official / Third Party Firmware:

Copy the official / any third party firmware binary file to  c:\esptool folder if it is not already there and upload it by issuing the command below.

  • Change COM5 to your own Port.
  • Change sonoff.bin to the name of your firmware file inside  c:\esptool folder.

It takes few seconds to upload firmware and output will be shown as follows.

Troubleshooting:

  • Choosing Wrong COM Port will cause the following error.

  • If following output is shown, Sonoff is not correctly connected to FTDI, Check wire configuration or terminals.

 

 

14 thoughts on “Backup & Restore Official Firmware of Sonoff WiFi Smart Switches

  1. zweistein says:

    Hi,
    Great article. Thanks for it.
    But I have a problem in reading flash:
    “A fatal error occured: Corrupt data, expected 0x1000 bytes but received 0xffd bytes”
    Do you have any idea about this error?

    Thanks

  2. Smax says:

    Hello dear i have bakup but not working? I have replaced new flash , uploaded my backup and not work. I have error boot @1000 or boot @81000
    Help for backup?
    Oter firmware working fine.

  3. Smax says:

    I have dump for my original sonoff pow i have dumped 1mb and 4mb . My fflash type original is 25q32.
    I have burned original switch in the sonoff pow. And have replaced with 4.5V power supply. And have changed many time to original and espurna.Working fine for 60 day. If reprogramming flash a this day not work. Error md5.
    A this time have replaced flash with qh32bhig brand xmd, recovered by old lolin board. New test with new flash i have uploaded espurna and work fine. Router ap and work fine. If reinstall original sonoff pow firmware not work. Reply is 2nd boot version boot @1000 If upload firmware at 0x0. If upload firmware ad 0x7e000 have reply ets_main.c ??
    Is possible upload picture?

  4. Martin Hardoy says:

    If you keep getting this:
    esptool.py v2.3.1
    Connecting…….._____….._____….._____….._____….._____….._____….._____….._____….._____….._____

    A fatal error occurred: Failed to connect to Espressif device: Timed out waiting for packet header

    Try to disconnect the esp from the PC and start Sonoff device in programming mode again

  5. Smax says:

    Programmatiin working. I change firmware ok . Test espurna and espeasy work. Revert original with new flash not work . Old flash is burned..
    I have double backup. One 1mb and one 4mb. Memory flash is 4mbyte this is Pow sonoff.
    Tedted ftdi and board ch340

  6. Smax says:

    For Martin do you need press button to your sonoff pow and connect power for programming and read.
    This is error cpu not in programming mode.9

Leave a Reply

Your email address will not be published. Required fields are marked *

For better user experience, please clear your browser cookies and cache at least for once. Dismiss