Flash Tasmota on the Sonoff Mini – Linux user experience

Flash Tasmota on the Sonoff Mini – Linux user experience
Imaginea este preluată automat împreună cu articolul de pe Emil CHERICHEȘ

The module supports the new DIY mode from Itead. This is probably a good ideea poorly implemented. The firmware on itself uses a kind of restfull API which is much slower than MQTT and more important Home Assistant does not yet support it (at leas not natively).

The initial version of the DIY mode needed a tiny jumper to be installed on the board itself, but since version 3.5.0 of the Itead’s software there’s no need for the jumper anymore. In order to flash it we need to install a local web server, a basic one (my choice this time was nginx). Being on Ubuntu the installation is very simple:

sudo apt install nginx

Then copy the tasmota firmware in the web folder.

sudo cd /var/www/html
sudo wget http://thehackbox.org/tasmota/tasmota-lite.bin
sha256sum tasmota-lite.bin

Remember the sha256sum of the file as it’s needed further.

Here are a few steps, on how to flash Tasmota (Open Source firmware that works very well on this device).

Unbox the mini and plug it in. Run the eWelink App on your Android phone to connect to the module.

After the module is connected, update the firmware to the latest version. After you update the firmware just disconnect the device. This will do a factory reset it.

After the device restarts press and hold on the button (on the module itself) until the LED blinks continuously. Few seconds afterwords you should see a wifi network called ITEAD-<deviceid>. Connect to it, the password is “12345678”. Then from your favorite browser open http://10.10.7.1

Set up your Local WIfi password and let the module connect to your wifi network. After the device is connected, try to find it’s IP address. you’ll find that it has port 8081 open, accepting HTTP POST commands. In this example my device has the IP 192.168.3.158

Now we need to query the device for some basic information:

curl http://192.168.3.158:8081/zeroconf/info -XPOST --data '{"deviceid":"","data":{} }'

We can now see that there’s a flag “otaUnlock” that is false, meaning we won’t be able to flash it, so we need to unlock it. To do so we send the following command:

curl http://192.168.3.158:8081/zeroconf/ota_unlock -XPOST --data '{"deviceid":"1000b6b3df","data":{} }'

Don’t forget to put your own deviceid.

The next step is the flashing process itself, yet another command:

curl http://192.168.3.158:8081/zeroconf/ota_flash -XPOST --data '{"deviceid":"1000b6742f","data":{"downloadUrl": "http://192.168.3.104/tasmota-lite.bin", "sha256sum": "fd99857f87f447a77dbb5e2000ef1ffd05373b54f1cc3cc966448a1d2a0a7774"} }'

Check your deviceid and sha256sum. The downloadUrl is actually your own local nginx install with the bin file accessible.

Now if you check your webserver log you’ll get something like this:

When you get the last line you can already check your wireless networks for an “tasmota-id” ssid.

After your device is connected to the network I suggest you do a “Firmware upgrade” in order to get the full firmware.

Enjoy!

Despre ZTB.ro

ZTB.ro este un agregator românesc de bloguri care colectează și afișează articole din diverse domenii, oferind vizibilitate bloggerilor și o platformă centralizată pentru cititori. Articolele sunt preluate prin feed-uri RSS/Atom și direcționează traficul către blogurile originale.

Articole recente