Skip to content

Instantly share code, notes, and snippets.

@fondberg
Last active September 28, 2020 07:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fondberg/bbd9d691c4134e3eb906175854b3c77b to your computer and use it in GitHub Desktop.
Save fondberg/bbd9d691c4134e3eb906175854b3c77b to your computer and use it in GitHub Desktop.
sonoff mini

These steps are for Mac OS X, a lot of this is copied from https://blog.bilka.sk/how-to-flash-sonoff-mini-in-mac-os/ but added docker and removed the need for adding own AP.

  1. solder or put jumper between OTA and GND

  2. Entering the Compatible Pairing Mode (AP) by long press the paring button for 5 seconds after power on

  3. Connecting the Access Point named ITEAD-XXXXXXXX with default password 12345678 via mobile phone or PC

  4. Browser visits http://10.10.7.1/

  5. Filling in the existing WiFi network SSID and password and hit save

  6. in terminal run sudo dns-sd -B _ewelink._tcp and wait for a response

11:47 $ sudo dns-sd -B _ewelink._tcp
Password:
Browsing for _ewelink._tcp
DATE: ---Sat 26 Sep 2020---
11:47:54.157  ...STARTING...


Timestamp     A/R    Flags  if Domain               Service Type         Instance Name
11:52:24.649  Add        2   6 local.               _ewelink._tcp.       eWeLink_1000e0e000
  1. Not the part after eWeLink_ as your device id.

  2. Use your favourite tool to look for the ipaddress. Port 8081 will be open

  3. run

curl http://<deviceIP>:8081/zeroconf/ota_unlock -XPOST --data '{"deviceid":"<deviceID>","data":{} }'

curl http://<deviceIP>:8081/zeroconf/info -XPOST --data '{"deviceid":"<deviceID>","data":{} }'
# output should be something containing "otaUnlock": true
  1. Download tasmota
curl http://192.168.86.48:8081/zeroconf/ota_flash -XPOST --data '{"deviceid":"1000e9e0f7","data":{"downloadUrl": "http://192.168.86.32/tasmota-lite.bin", "sha256sum": "c4c8347666c4fd1e412a11338fe4a599f8010d5eaa5418bacb43bbc3b5149dbd"} }'
shasum -a 256 tasmota-lite.bin
  1. Start docker nginx
docker run -it --rm -d -p 80:80 --name nginx1 -v ~/<path to your tasmota nin file>:/usr/share/nginx/html nginx
  1. update firmware to tasmota
curl http://<deviceIP>:8081/zeroconf/ota_flash -XPOST --data '{"deviceid":"<deviceID>","data":{"downloadUrl": "http://<HTTPserverIP>/tasmota-lite.bin", "sha256sum": "<SHA256>"} }'
  1. Connect to tasmota AP and set network credentials

  2. Find your tasmota flashed sonoffs ipaddress (probably the same as before) and open it in a webbrowser

  3. Follow the steps in https://esphome.io/guides/migrate_sonoff_tasmota.html

good links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment