Here is an updated process that you can use on any PC provided that you have Chrome with RESTer extension installed. No need for the Ewelink app nor your own webserver
Tested on two Sonoff Mini R2 just bought, with firmware 3.7.6.
The only dependency is on the availability of the Tasmota Lite binary on the http://sonoff-ota.aelius.com/ website. I tried also by hosting the binary on my HomeAssistant, using the HTTP component (i.e. placing the binary under the homeassistant/www folder), but it didn’t work, probably because the Sonoff requires a server that supports “range” requests (i.e. download in chunks).
1. Set Sonoff Mini R2 in DYI mode
- Disconnect power.
- Connect the Sonoff Mini R2 to power (N-In, L-In).
- Reconnect power.
- Wait until it boots. Led shows in sequence . . _ (short, short, long)
- Press and hold the button until led shows . . . . . (short, short, short, …)
2. Connect to Sonoff AP, retrieve device ID and configure local network
- On a smartphone/tablet/computer, look for a WIFI network called ITEAD-xxxxxxxxxx
- IMPORTANT: write-down the xxxxxxxxxx digits that follow “ITEAD-”.
These are the “Device ID” that you will need later on - Connect to that network, using password 12345678
- On the same device, open a web browser and go to 10.10.7.1 (i.e. IP if the Sonoff AP).
This will open a webpage where you can go to “WIFI SETTINGS” - Enter the SSID and password of your local network wifi and save settings
- When you get the “successful” on the browser, wait for the device to reboot and connect to your local network wifi
3. Find the IP Address of the Sonoff on your local network
- Connect to your router and go to the DHCP client list.
- Find a device called ESP_xxxxxx and write down its IP address
4. Check Sonoff config and unlock OTA
- Use a Chrome browser on a computer connected to the same home network.
- Ensure the RESTer extension is installed
- Open the page of the RESTer extension (on the top of chrome, next to URL, the “puzzle piece” icon)
- Create a RESTer request:
Method: POST (by default the extension is set to GET)
URL: http://[sonoff_ip_from_step_3]:8101/zeroconf/info
Body (tab):
{
"deviceid": "[id_from_step_2]",
"data": { }
}
- Hit “send” and check the answer
The reply should look like:
{
"seq": 3,
"error": 0,
"data": {
"switch": "off",
"startup": "off",
"pulse": "off",
"pulseWidth": 500,
"ssid": "[home_wifi_SSID]",
"otaUnlock": false,
"fwVersion": "3.7.6",
"deviceid": "[id_from_step_2]",
"bssid": "[mac_address]",
"signalStrength": -75
}
}
If you get an error such as 422, there is a chance that the device_id from step 2 is incorrect.
You can there see that “otaUnlock” is set to false, and check the firmware version (3.7.6 in the example)
5. Unlock OTA
- Still on the Chrome browser and RESTer extension, create a new POST request:
Method: POST
URL: http://[sonoff_ip_from_step_3]:8101/zeroconf/ota_unlock
Body:
{
"deviceid": "[id_from_step_2]",
"data": { }
}
- Hit “send” and check the answer
The reply should look like:
{
"seq": 4,
"error": 0
}
- Repeat the POST method of step 4 and check that “otaUnlock” is now set to “true”
6. Flash Tasmota lite firmware
- Still on the Chrome browser and RESTer extension, create a new POST request:
Method: POST
URL: http://[sonoff_ip_from_step_3]:8101/zeroconf/ota_unlock
Body:
{
"deviceid": "[id_from_step_2]",
"data": {
"downloadUrl": "http://sonoff-ota.aelius.com/tasmota-latest-lite.bin",
"sha256sum": "5c1aecd2a19a49ae1bec0c863f69b83ef40812145c8392eebe5fd2677a6250cc"
}
}
Note: the SHA value for the latest binary should correspond to the one indicated at http://sonoff-ota.aelius.com/ next to filename “tasmota-latest-lite.bin”
- Hit “send” and check the answer
The reply should look like:
{
"seq": 4,
"error": 0
}
This reply is sent immediately. However, the firmware upgrade is still in progress and takes a few minutes.
Once done, the Sonoff device is disconnected from the home network and creates a new WIFI with SSID Tasmota
You can watch the appearance of that new WiFi network on a mobile device.
7. Connect to Tasmota AP and flash ESPhome
- Follow steps seven onwards from the initial post