Skip to content

Instantly share code, notes, and snippets.

@wesleyit
Created January 5, 2022 13:56
Show Gist options
  • Save wesleyit/bd157681b26edcbba101cbeadd8cc1f1 to your computer and use it in GitHub Desktop.
Save wesleyit/bd157681b26edcbba101cbeadd8cc1f1 to your computer and use it in GitHub Desktop.
This code can be used in order to flash Tasmota firmware in Sonoff Mini devices
# Flash Sonoff Mini with Tasmota
#
# Download the file tasmota-lite.bin, get the sha256 hash
# and make it available via HTTP using NGINX
# The device will listen for HTTP Post requests
# on TCP/8081
## Get the device ID and OTA status
curl http://192.168.0.5:8081/zeroconf/info -XPOST \
--data '{"data":{}}'
## Activate OTA
curl http://192.168.0.5:8081/zeroconf/ota_unlock -XPOST \
--data '{"deviceid":"10011aef06", "data":{}}'
## Start NGINX on the current dir
docker run -it --rm -p 8080:80 \
-v $(pwd):/usr/share/nginx/html nginx
## Flash Firmware
curl http://192.168.0.5:8081/zeroconf/ota_flash -XPOST \
--data '{"deviceid":"10011aef06", "data":{"downloadUrl":"http://192.168.0.38:8080/tasmota-lite.bin", "sha256sum":"ce7a5b0b952530cb8de8907169a5ac82590006e205dbcaca24c1cf71e8fea703"}}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment