Instructions from https://tasmota.github.io/docs/Sonoff-DIY/ , but more unixy. Using additional information from https://github.com/itead/Sonoff_Devices_DIY_Tools/blob/master/other/SONOFF%20DIY%20MODE%20Protocol%20Doc%20v1.4.md , especially for the ota_flash
command.
Prerequesites: httpie (apt install httpie
), docker. curl instead of httpie probably works too.
- plug in device to power
- press button for > 5 seconds (first attempt failed, worked after reconnecting)
- connect to wifi
itead_...
, password12345678
with a phone (remember to turn off cell data) - point browser on phone to
10.10.7.1
and configure your wifi - find IP address from dhcp leases file (or fing or whatever)
echo '{"data": {}}' | http -j post http://192.168.2.238:8081/zeroconf/info
, and take note of thedeviceid
.- (if the command above fails with 'Connection reset by peer', unplug/plug the device and try again)
echo '{"data": {}}' | http -j post http://192.168.2.238:8081/zeroconf/ota_unlock
- download
tasmota-lite.bin
from http://ota.tasmota.com/tasmota/ (image size needs to be < 500K, see itead/Sonoff_Devices_DIY_Tools#102) - calculate sha sum:
sha256sum tasmota-lite.bin
- start a web server:
docker run -it --rm -p 8081:80 --name web -v $(pwd):/usr/share/nginx/html nginx
- edit a file
ota_flash.json
, using thedevicedid
from theinfo
command above:
{
"deviceid": "1001xxx",
"data": {
"downloadUrl": "http://<ip of your web server>:8081/tasmota-lite.bin",
"sha256sum": "5b6bdb20cd1badce1d1a95155e5e72bc92482df65c441fe013399495155fc1a5"
}
}
cat ota_flash.json | http -j post http://192.168.2.238:8081/zeroconf/ota_flash
If you observe the console of your web server you will see tons of GET requests. At the end is a "POST /api/device/otaFlash HTTP/1.1"
which will fail, but that doesn't matter. The device boots into Tasmota. It may recover the WiFi config and connect to it. If not, fnd the AP with your phone, configure like any other new Tasmota device.
This works for the Sonoff Mini. It does not work for the plugs.