We will learn how to flash SONOFF mini with Tasmota firmware using USB to TTL converter. The SONOFF mini is using the ITEAD manufacturer cloud solution and requires an online account. The purpose of this project is to release the SONOFF mini from this integration by replacing the original firmware with the Tasmota open source firmware. When you do that, you can easily integrate and control the switch in any open source home automation setup (home assistant or openhub, for example. (Please note when you do this your eWeLink app will not work with your SONOFF mini)
Tag: Project 109e How to flash SONOFF mini with Tasmota firmware using Tasmotizer. Acoptex.lt
- Sketch: None;
- Libraries: None;
- Other attachments: None.
In this project, you needed these parts (Dear visitors. You can support our project buy clicking on the links of parts and buying them or donate us to keep this website alive. Thank you):
1. SONOFF mini 1 pc
2. AC lamp power cord with switch 1 pc
3. Jumper cables F-M 4 pcs
4. USB to TTL /Serial adaptor/converter 1 pc
Understanding the Tasmota
Tasmota is an alternative firmware for ESP8266 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Written for Arduino IDE and PlatformIO.
It was initially written for Sonoff devices, but it supports devices from many other brands like Electrodragon, MagicHome, AriLux, Blitzwolf, and Allterco. You can also install it on development boards like the Wemos D1 mini and the ESP8266 NodeMCU.
You can read more about it here.
Understanding the Tasmotizer
The full-featured flashing tool for Tasmota. With the great ESPtool from Espressif under the hood, and all required settings by default.
- Automatic backup of current ESP image before flashing: in case you want to return to manufacturer firmware
- Flash local .bin images, or simply select from release or development images: it will download them automatically
- Send configuration to flashed device via serial: one-click configure of Wifi (including recovery AP), MQTT, Module and/or Template
- Dark theme: proven to increase flashing speed and reliability
You can install it on Windows, Linux or Mac. Read more about it here.
Understanding the SONOFF mini
This is a mini and compact DIY smart switch used for different kinds of switch boxes, even the smallest EU standard switch box. Convenient to automate your home appliances with eWeLink app through your smartphone or tablet or your voice command. Support to connect an external rocker light switch unable to automatically spring back for easily managing connected devices in your home, both on your phone or directly from the wall. It supports the DIY mode (designed for developers) which allows users to integrate MINI into worldwide third-party open source smart home control system to achieve LAN control without cloud service, such as Home Assistant, openHAB, ioBroker .etc.
- Control your home appliances with the app.
- Ask devices to turn on/off just by a voice command.
- Set a time for devices to make it start or stop running automatically.
- Allow developers to flash the firmware to access more features they want.
- Support the rocker light switch to control devices (self-return switch not included).
- Create smart scenes to trigger groups of SONOFF devices on/off via tapping on your phone.
- Make an action to trigger another or receive a message alert to your phone.
- Share the device with your family to control it together.
- Check the device status change on your phone in real time.
- Run the device on your phone albeit no normal Wi-Fi connection.
- Keep the device in the status before power failure when the electricity system is restored.
- Input: AC 100-240V 50/60Hz 10A Max;
- Output: AC 100-240V 50/60Hz 10A Max;
- Wi-Fi: IEEE 802.11 b/g/n 2.4GHZ;
- Material: PC V0;
- Dimension: 42.6X42.6X20mm;
Tasmota can be flashed on this device via OTA using the Sonoff DIY feature.
Several free GPIOs are available. The OTA jumper pin is the most accessible and very easy to use on a pin header.
Signals and connections of the SONOFF mini
- GPIO0 – Button
- GPIO2- Available
- GPIO3 -RX
- GPIO4 – S2 (external switch input)
- GPIO12 – Relay and red LED
- GPIO13 – Blue LED
- GPIO16 – OTA jumper pin
- GND – S1 (external switch input)
Step by Step instruction
1. Please note that you have several options to download and install the Tasmotizer:
- Option 1: get Windows standalone executable;
- Option 2: pip3 install tasmotizer and then simply run tasmotizer.py from the shell/command line;
- Option 3: Clone the repo, pip3 install PyQt5 pyserial followed by python3 tasmotizer.py and flash away.
2. Go to Github and download the latest release of Tasmotizer. As we are using the Windows 7 64Bits OS version – we download tasmotizer-1.1a.exe.
3.Please note that you do not need to install it.
1. Make sure that your SONOFF mini is not connected to mains power. DISCONNECT MAINS POWER, WHEN MAINS POWER CONNECTED COVER BOX MUST BE CLOSED!
2. Open the white cover.
3.Do wiring. You will need to solder jumper cables.
4.Press and hold the configuration button/manual switch and plug in your USB to TTL converter to your PC USB port.
5.Double click on tasmotizer-1.1a.exe. tasmotizer-1.1a.exe and tasmota-kite.bin should be in the same folder of your PC. Select port (we have COM7, where the USB to TTL attached to) and select image type (bin) and image – tasmota-lite.bin. Click on Tasmotize button.
6.The flashing process starts.
7. When the flashing process completed click on OK button.
1.Close the white cover and prepare your SONOFF mini to connect to mains power. Blue wire (N, neutral) and Brown wire (L, live).
2. Connect your SONOFF mini to the mains power. The tasmota_xxxxxx-xxxx SSID should be available.
3.Connect to the tasmota_xxxxxx-xxxx network. Go to any web browser and type the http://192.168.4.1.
4.Now we can configure the Wifi network. Click Scan for networks and select your own Wifi network.
5.Type your Wifi network password and click on Save button. The SONOFF mini reboots and connects your network.
6.Use a program like Advance IP scanner to find the IP of you SONOFF mini or check your routers DHCP list.
7.Type your SONOFF mini IP address in any web browser (in our case 192.168.1.149). The Tasmota GUI appears.
8.Click on Configuration. Then click on Configure Module.
9.Set these Settings:
Module type: Generic (0)
D3 GPIO0 Button1: Button1 (17)
D2 GPIO04: Switch1 (9)
D6 GPIO12 Relay1: Relay1 (21)
D7 GPIO13 Led1i: Led1 (52)
10.Click on Save and the SONOFF mini will reboot.
11. Congrats. Your SONOFF mini is ready for use.
We have learnt how to flash SONOFF mini with Tasmota firmware using USB to TTL converter.
Check for more DIY projects here.