29 August 2019
Edit on GitHub
— הפוסט זמין גם בעברית

Flashing Tasmota on Tuya IR bridge

Flashing Tasmota firmware on Tuya IR Trasmitter/Recevier manual

Blog picture

Flashing manual for Tuya IR bridge (model UFO-R1).

Or as an alternative title: The best and cheapest universal remote ever.

Updated on 22/8/2020

The device pictures

Device
Device
Device
Device

Flashing equipment

I must say, this is the tools I used, you can buy from other sellers or similar tools.

Hardware equipment

  1. IR device (transmitter and receiver)
  2. Soldering iron and tin
  3. Board (not must)
  4. Male wires
  5. Female Wires
  6. USB to TTL serial
Hardware

All the equipment cost about 10$ and the device about 11$.

Software to use

  1. PC with Windows 10 OS.
  2. download esptool flashing tool from here or directly from the official repo at GitHub.
  3. Tasmota IR firmware from here (version Tasmota v8.3.1 Fred) or directly from the official repo at GitHub.

Flashing the firmware

THE FLASHING PROCESS IS VERY DANGEROUS! BE AWARE, USING THE MANUAL IS ON YOUR OWN RISK!!!

Software settings

Create a folder and copy to it the downloaded files tasmota-ir.bin and e sptool.exe.

Let assume the folder is C:\flasing

Connect the USB to Serial converter to the PC. wait until drivers automatically installed by Windows. (if its not work automatic go here or here)

In Windows search look for device manager and select the first results, or press Windows Key + R and in the input insert devmgmt.msc.

In the device manager look for the device serial port COMX.

We will need it in the next step. In my case, it was COM6.

Device manager

Open the command line in the directory C:\flasing.

(If you don't know-how, look here)

On the command line write the following command:

  esptool.exe -vv -cb 115200 -cp COM6 -ca 0x00000 -bz 1M -bm dout -cf tasmota-ir.bin

Note that the COM6 should be replaced by your device port from earlier.

Do not press 'Enter' yet, keep the command ready to use for the next step

Disconnect the USB to Serial converter from the PC.

Now move to the next step:

Hardware settings

Opening the device

First of all, unplug the device from the power, and do not connect it until flashing process finished

The device consists of two parts, the bottom to which the chip is attached with screws, and the glossy lid that is not attached with screws.

Device equator

Remove the cover gently, you can use a screwdriver but open it slowly and carefully because it is very fragile.

At the end the device should look like this:

Device opend

Soldering

We need to connect the device (while not connected to power!!!) to the PC via the converter.

The connection diagram is:

  • port 3v3 of the device to the 3v3 of the converter.
  • port TXD of the device to the RXD of the converter.
  • port RXD of the device to the TXD of the converter.
  • port GND of the device to the GND of the converter.
  • port IO0 of the device to the GND of the converter.

the connections need to be like shown in the following pictures:

Full wiring
Converter wiring
Board wiring
Device wiring
Device wiring

Connect to the PC

Make sure again that all wires are well connected.

Now the flashing is ready.

Connect the USB to Serial converter to the PC, then in the command line press 'Enter'.

The command line and the converter shuld look like this:

Assuming all worked properly and flush complete displayed on the command line, remove the converter from the PC, remove the wires from the device, and return the device cover.

The flashing is finished!

Setting the device

Make sure that all wires removed, and the cover is in his place, then connect device to the power.

Wait a few seconds and then should be a new network named sonoff-xxxx (tasmota-xxxx in the new versions) in the WiFi list on PC or smartphone.

networks

Connect to the new network.

Open the browser and open 192.168.4.1.

Enter your home SSID and the password (Tasmota support two networks)

And then press 'Save'

ssid config

The device should reboot and connect to your home network.

Connect back to the home network, enter to the home router to get the new device IP address.

Each router has a different UI but all should have somewhere a table of network devices IPs.

In my router (ASUS RT-xxxxxx) its look like this:

DHCP IPs

After you know the new device IP (in my case 192.168.1.36) Open the browser and press the IP in the URL bar.

Then in the Web interface press Configuration and then Configure Other.

Replace the 'Template' content with:

{"NAME":"YTF IR Bridge","GPIO":[255,255,255,255,56,51,0,0,0,17,8,0,0],"FLAG":0,"BASE":62}

(From the template project, IR Bridge page)

And press on the 'Activate' checkbox to be 'V'.

Then press 'Save'.

The device should reboot again.

And that is it. you finished.

Now you can use the device.

Sending/Receiving IR Commands

When you send an IR signal you can see the IrReceived message on the console. The message should look like:

{"IrReceived":{"Protocol":"GREE","Bits":64,"Data":"0x0x190C6050000000F0","Repeat":0,"IRHVAC":{"Vendor":"GREE"............},"RawData":[9084,4338,740,1622,.........],"RawDataInfo":[139,139,0]}}

Note that if the raw data is too long the only way to get the full list is by using the MQTT interface.

You can sent it using the console/MQTT, by using the IRsend or IRhvac commands. Put the following command on the console input and press enter:

By IRsend

IRsend {"Protocol":"GREE","Bits":64,"Data":"0x0x190C6050000000F0","Repeat":0}

By IRhvac

IRhvac {"Vendor":"GREE", ..... (put here all the properties from the IrReceived.IRHVAC object ) .....}

By RawData

IRsend 0 9084,4338,740,1 ...... (put here all number from the IrReceived.RawData array ) ........

For more information you see the tasmota documentation sending IR commands sending raw IR and to send this commands using MQTT

If you need to convert from the IrRaw format to the Broadlink format you can use my npm package implementation broadlink-ir-converter

If you want to receive the IrRaw payload in the console/mqtt, go to the web-ui console and press SetOption58 1.

I recommend to see the full Tasmota IR documentation here.

Have fun!


Photo by Enisa Abazaj from Burst