Flashing an IoT Device with Tasmota via over the air Tuya Convert

Home Assistant Logo

Flashing an IoT Device with Tasmota via over the air Tuya Convert.
In this example we will be flashing a Medion (Aldi) Smart Plug. However this applies to any Supported ESP Chips

Supported ESP Chips

At time of writing Tuya Convert supports the following ESP chips

  • ESP866
    • TYWE1S
    • TYWES3
    • TYWE3L
    • TYLC4
    • TYWE5P
  • ESP8285
    • TYWE2S
    • TYWE2L
    • TYLC5
    • TYWE3SE

Prerequisites

Have a running instance of Tuya Conver

SSH into the Tuya Convert Computer

ssh pi@10.0.0.2

Start Tuya Convert Software

cd ./tuya-convert
sudo ./start_flash.sh
tuya-convert v9.9.9
TUYA-CONVERT
https://github.com/ct-Open-Source/tuya-convert
TUYA-CONVERT was developed by Michael Steigerwald from the IT security company VTRUST (https://www.vtrust.de/) in collaboration with the techjournalists Merlin Schumacher, Pina Merkert, Andrijan Moecker and Jan Mahn at c't Magazine. (https://www.ct.de/)
======================================================
PLEASE READ THIS CAREFULLY!
TUYA-CONVERT creates a fake update server environment for ESP8266/85 based tuya devices. It enables you to backup your devices firmware and upload an alternative one (e.g. ESPEasy, Tasmota, Espurna) without the need to open the device and solder a serial connection (OTA, Over-the-air).
Please make sure that you understand the consequences of flashing an alternative firmware, since you might lose functionality!
Flashing an alternative firmware can cause unexpected device behavior and/or render the device unusable. Be aware that you do use this software at YOUR OWN RISK! Please acknowledge that VTRUST and c't Magazine (or Heise Medien GmbH & Co. KG) CAN NOT be held accountable for ANY DAMAGE or LOSS OF FUNCTIONALITY by typing yes + Enter
yes

yes
Checking for network interface wlan0… Found.
Checking UDP port 53… Occupied by dnsmasq with PID 2065.
Port 53 is needed to resolve DNS queries
Do you wish to terminate dnsmasq? [y/N]

y
Attempting to stop dnsmasq.service
Checking UDP port 67… Available.
Checking TCP port 80… Available.
Checking TCP port 443… Available.
Checking UDP port 6666… Available.
Checking UDP port 6667… Available.
Checking TCP port 1883… Occupied by mosquitto with PID 2448.
Port 1883 is needed to run MQTT
Do you wish to terminate mosquitto? [y/N] 
y
Attempting to stop mosquitto.service
Checking TCP port 8886… Available.
Starting AP in a screen.
   Starting web server in a screen
   Starting Mosquitto in a screen
   Starting PSK frontend in a screen
   Starting Tuya Discovery in a screen
======================================================
IMPORTANT
Connect any other device (a smartphone or something) to the WIFI vtrust-flash
This step is IMPORTANT otherwise the smartconfig may not work!
Put your IoT device in autoconfig/smartconfig/pairing mode (LED will blink fast). This is usually done by pressing and holding the primary button of the device
Make sure nothing else is plugged into your IoT device while attempting to flash.
Press ENTER to continue 
ENTER

Set Iot Device into EZ Pairing Mode

Put your IoT device in autoconfig/smartconfig/pairing mode (LED will blink fast). This is usually done by pressing and holding the primary button of the device
Make sure nothing else is plugged into your IoT device while attempting to flash.

  1. On
  2. Off
  3. On
  4. Off
  5. On

Connect Another Device to vtrust-flash WiFi

Connect any other device (a smartphone or something) to the WIFI vtrust-flash
This step is IMPORTANT otherwise the smartconfig may not work!

You may get a warning message about internet not available tap [Keep Wi-Fi connection]

[Keep Wi-Fi connection]

Flash IoT Device

The IoT device in EZ mode should now be automatically detected.

Starting smart config pairing procedure
 Waiting for the device to install the intermediate firmware
 Put device in EZ config mode (blinking fast)
 Sending SSID                  vtrust-flash
 Sending wifiPassword          
 Sending token                 00000000
 Sending secret                0101
 …………….
 SmartConfig complete.
 Resending SmartConfig Packets
 ……………………………….
 IoT-device is online with ip 10.42.42.42
 Fetching firmware backup
   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                  Dload  Upload   Total   Spent    Left  Speed
 100 1024k  100 1024k    0     0  62515      0  0:00:16  0:00:16 --:--:-- 28963
 curl: Saved to filename 'firmware-4954f9.bin'
 Getting Info from IoT-device
 VTRUST-FLASH 1.5
 (c) VTRUST GMBH https://www.vtrust.de/35c3/
 READ FLASH: http://10.42.42.42/backup
 ChipID: 4954f9
 MAC: 84:0D:8E:FF:FF:FF
 BootVersion: 4
 BootMode: normal
 FlashMode: 1M DOUT @ 40MHz
 FlashChipId: 144051
 FlashChipRealSize: 1024K
 Active Userspace: user2 0x81000
 Ready to flash third party firmware!
 For your convenience, the following firmware images are already included in this repository:
   Tasmota v8.1.0.2 (wifiman)
   ESPurna 1.13.5 (base)
 You can also provide your own image by placing it in the /files directory
 Please ensure the firmware fits the device and includes the bootloader
 MAXIMUM SIZE IS 512KB
 Available options:
   0) return to stock
   1) flash espurna.bin
   2) flash tasmota.bin
   q) quit; do nothing
 Please select 0-2: 
2
y
Attempting to flash tasmota.bin, this may take a few seconds…
 Flashed http://10.42.42.1/files/tasmota.bin successfully in 17829ms, rebooting…
 Look for a tasmota-xxxx SSID to which you can connect and configure
 Be sure to configure your device for proper function!
 HAVE FUN!
 Do you want to flash another device? [y/N] 

Post Flash Configuration

Firmware Upgrade

Enter the IP address of your smart plug into a browser and click on [Firmware Upgrade]

Sonoff Basic Module
Tasmota
OFF
[Toggle]
[Configuration]
[Information]
***[Firmware Upgrade]***
[Console]
[Restart]
Tasmota 9.2.0 by Theo Arends

[Start Upgrade]

The device will automatically reboot

Configure Device

Enter the IP address of your smart plug into a browser and click on [Configuration]

Sonoff Basic Module
Tasmota
OFF
[Toggle]
***[Configuration]***
[Information]
[Firmware Upgrade]
[Console]
[Restart]
Tasmota 9.2.0 by Theo Arends

[Configuration]

  • https://templates.blakadder.com/
,