Skip to content

Sonoff DIY

Some new Sonoff devices support the new Itead DIY architecture which allows OTA firmware upload. With Sonoff DIY, a user has more control over the hardware features of the device and also allows for upgrading the firmware without additional hardware. The following procedure upgrades Sonoff eWelink firmware to Tasmota.

There are many reports this procedure has changed with newer versions of Sonoff DIY

Tasmota does not provide any kind of support for flashing using this method. Please contact Sonoff Support for help.

IMPORTANT: There are some reports suggesting that the Windows version of Sonoff DIY Tool contains a trojan. It is not clear if it actually contains the malicious code or these are just false positives due to the way Python code was converted to native executables. Nevertheless, proceed with care.

Compatible devices~

Currently the following devices officially support Sonoff DIY: - Sonoff Basic R3 - Sonoff RF R3 - Sonoff Mini

As Sonoff DIY is enabled by connecting GPIO16 to GND it may well be possible that other Sonoff devices running eWelink will support it.

Note

The OTA process Sonoff provides through the Sonoff DIY procedure does not create a backup of the Itead firmware on the device. If you use this OTA method to flash Tasmota on the Sonoff device, you will not be able to revert to the original factory firmware. ⚠️

Flash procedure~

Guide originally from @Brunas

  1. Follow instructions how to enter DIY mode from Sonoff. This is the excerpt from it:

    1. Power on;
    2. Long press the button for 5 seconds for entering Compatible Pairing Mode (AP) User tips: If the device has been paired with eWeLink APP, reset the device is necessary by long press the pairing button for 5 seconds, then press another 5 seconds for entering Compatible Pairing Mode (AP)
    3. The LED indicator will blink continuously;
    4. From mobile phone or PC WiFi setting, an Access Point of the device named ITEAD-XXXXXXXX will be found, connect it with default password 12345678
    5. Open the browser and access http://10.10.7.1/
    6. Next, Fill in WiFi SSID and password that the device would have connected with
    7. Succeed, Now the device is in DIY mode.

Note: I needed to manually change IP address to 10.10.7.2, 255.0.0.0 with gateway 10.10.7.1 in adapter TCP/IPv4 settings to access that IP address.

  1. Use Fing or any similar local network scanning app on your smartphone or PC to find IP address of your Sonoff Mini device. MAC Vendor most likely is Espressif and the device has 8081 port open.
  2. Install Rester extension in Chrome or Firefox or any other preferred tool to perform REST API operations.
  3. To test your device DIY mode create new request in Rester:
    1. Method: POST
    2. URL: http://<IP of your device>:8081/zeroconf/info
    3. Body: {"data": {}}
    4. You might need to add Header Content-Type with value application/json
    5. Press SEND
    6. If all is OK, status code 200 should be returned with bunch of data:
{
    "seq": 1,
    "error": 0,
    "data": {
        "switch": "off",
        "startup": "off",
        "pulse": "off",
        "pulseWidth": 2000,
        "ssid": "YourWiFi",
        "otaUnlock": false,
        "fwVersion": "3.6.0",
        "deviceid": "YourDeviceId",
        "bssid": "YourBSSId",
        "signalStrength": -52
    }
}
7. If that doesn't return *200*, try going back to 5s+5s reset above.
  1. If all above works, let's unlock OTA:
    1. Method: POST
    2. URL: http://<IP of your device>:8081/zeroconf/ota_unlock
    3. Body: {"data": {}}
    4. You might need to add Header Content-Type with value application/json
    5. Press SEND
    6. You should get status code 200
    7. Optionally for curiousity you could retry info query to check if otaUnlock value now is true
  2. Sonoff's flashing tool should see your device now!
  3. Download Tasmota-lite.bin from https://github.com/arendst/Tasmota/releases and flash it according to instructions everywhere on the Internet. Just the WiFi AP name is TASMOTA_XXXX and not sonoff_XXX.

Video tutorials~

More info:~