Perl script for flashing the Sonoff mini in DIY mode based on the tutorial by Andreas Spiess
The Sonoff mini comes with a DIY mode that supports flashing an own firmware (e.g. Tasmota). This mode is somewhat difficult to handle manually and tools are only available for Windows, so I created this little helper script.
You need:
- a Sonoff mini with an original firmware 3.1.x or higher,
- Perl and perl-libwww,
- an access point (e.g. wifi guest network) with SSID
sonoffDiy
and password20170618sn
, - a webserver in your local network with the new firmware,
- the tools
avahi-browse
andcurl
have to be installed.
- The wifi network and the webserver have to be started.
- Open the Sonoff mini, set the OTA jumper.
- Connect power, wait some seconds util the mini connected to the network.
- Execute the script with the firmware URL where you stored your new firmware on your local webserver.
The firmware has to be either tasmota-wifiman.bin, which starts a wifi access point for configuring your wifi credentials or a self compiled binary with those credentials compiled in. I prefere the second method because it saves a step of work and compiling Tasmota is rather easy thanks to platformio.