DisclaimerPlease, proceed carefully following the tips published in this blog, specially when Main Power is involved. I'm not responsible for any damages caused by what is written in this blog.
IoT - smartHome (181 posts)
Home Automation System - First time with Sonoff Mini - Flashing TASMOTA [Versione in italiano]
by Marco Lamanna
This time it's up to a new entry ... the SONOFF Mini, a Wifi switch similar to Sonoff Basic but with some slight differences that make it more comfortable in some situations.
The main difference is the size ... in fact the mini is sensibly smaller than the basic and can be put directly into the 503 boxes, even if it is not easy as it can seem.
It is also ready to be use with an external button / switch, while for the sonoff basic you have to use the welder.
Last major change is the fact that it can be used in DIY mode (do it yourself), without using the iTead external servers, through the http API inteface to directly control it and for easy integration with the common Home Automation Systems.
Almost all these SMART devices use an external server to manage communication between them and the management app ... that's the main reason I use custom firmware that allow you to take total control of the device and use it without need for external servers and active internet connection. It would be frustrating not to be able to turn off the light just because the internet line is offline.
Even if not necessary (in this case), I prefer to use the legendary firmware TASMOTA because I know it quite well and consider it a high quality software.
So, let's update it.
WARNING! Performing this update you will lose the original firmware with the risk of invalidating the official guarantee
Reading the documentation I realize that the procedure can be different, as the DIY mode enables the loading of the new firmware in OTA (Over the Air) mode, i.e. directly via wifi without the need for serial connection with the PC and without the need to solder the PINs serial interface.
very good...let's try it...
The official guide is here https://tasmota.github.io/docs/Sonoff-DIY
Before flashing you need to pair the Sonoff with eWelink (the official app) following the standard procedure, to make sure everything is officially updated.
Then you have to download the flashing tool from the original github page https://github.com/itead/Sonoff_Devices_DIY_Tools.
To load the device into OTA update mode it is necessary to open the Sonoff (there are no screws, that's all interlocking) and close the jumper you find inside (GPIO16 to the ground).
During the next restart, the sonoff will look for a wifi connection named sonoffDiy with password 20170618sn. So, you have to use the mobile hotspot on your pc setup as described before.
Mandatory using a 2.4Ghz wifi
As soon as the Sonoff is restarted it will connect to the network as can be seen from the hotspot details
At this point we can run the flashing tool tool_01DIY85 which should automatically identify the sonoff
Before going on, you must choose and download your desired version of TASMOTA the official guide suggest to download the tasmota-wifiman release from http://thehackbox.org/tasmota/tasmota-wifiman.bin (TASMOTA is provided in different configurations each of them target to particular use case and based on the memory available on the target device).
After the firmware is downloaded, you must use the "Brush Machine" button to start the flashing job
Wait for 100%, pay attention to not turn off or disconnect the device (the device could became useless)
At the end the Sonoff will restart in standard Access Point mode, ready to be configured through the standard way, connecting the PC to the wifi network (tasmota-xxxx)
Obviously you can flash your desired version of TASMOTA pay attention only at the memory available on the sonoff.
Last step: to use an external switch, Sonoff must be configured with Sonoff Basic module assigning the desired function (switch or button) to the GPIO4 pin.
My new sonoff is ready to be integrated in OpenHAB. It will drive my balcony lights.