Tuya Convert Walk Through – February 2019
February 20, 2019
1. Before you begin you’ll need:
- One of the Linux machines listed below:
- A raspberry pi model B with the latest version of Raspbian Stretch Lite (Recommended Method).
- A raspberry pi model B+ with a USB wifi dongle and Kali Linux.
- A micro SD Card for your raspberry pi (at least 2gb, 8+ recommended).
- A wifi device that can connect to the SSID that will be generated by the raspberry pi and eventually the flashed tuya device. This cannot be an iOS device, android devices will work.
2, Installing the OS on raspberry pi:
- Download and install Etcher
- Plug your microSD card into your PC using a microSD adapter
- Start Etcher.
- Select the disk image you downloaded and your microSD card from the etcher interface.
- Press Flash and wait.
- Add a blank file called “ssh” to the root of the raspberry pi to enable the SSH service on raspbian.
- Plug the SD card into your raspberry pi, connect power and ethernet and boot it up.
3. Connecting to your raspberry pi via SSH:
- Download and install Putty
- Start Putty.
- Enter the IP address of your raspberry pi in the box that says “Host Name”. I recommend using an app like Fing to find the IP address of your raspberry pi.
- In the “Saved Sessions” input box, name your raspberry pi connection and then press “save”.
- Select your new saved session.
- Press “Open”
4. Setting up your Pi and updating the OS
- In the putty window login with user “pi” and password “raspberry”
- Expand the file system by typing “sudo raspi-config” then selecting “Advanced Options” and then “Expand Filesystem”, select “Finish” and then select “Yes” when it asks to reboot.
- Reconnect via putty using your saved session and login with username “pi” and password “raspberry” again.
- Type “sudo apt-get update” and wait for the updates to install
- Type “sudo apt-get dist-upgrade” and wait for the upgrades to install
- You may get a prompt for permission, just type “y” and press enter.
- Type “sudo apt-get install network-manager” and wait for it to install.
- Type “sudo apt install git” and wait for it to install.
5. Setup and Install Tuya-Convert
- In the putty window type “git clone https://github.com/ct-Open-Source/tuya-convert” press enter and wait.
- Type “cd tuya-convert” and press enter.
- Type “./install_prereq.sh” and wait.
6. Use Tuya-Convert to install Tasmota
- Type “cd tuya-convert” and press enter.
- Type “./start_flash.sh”.
- Types “yes” and press enter.
- Connect your separate WiFi device to the “vtrust-flash” SSID that is being broadcast by your Raspberry Pi. The Password is “flashmeifyoucan”.
- Plug in your Tuya plug, switch, dimmer, or bulb and put into pairing mode.
- Different models are put into pairing mode via different methods, check the curated product pages for information for putting your device in pairing mode. The LED should flash rapidly if done successfully.
- Press enter on your putty window to start the flash process and wait.
- Once the process completes you can type ” curl http://10.42.42.42/flash3″ to install tasmota, or look at the other options available.
7. Setup Tasmota
- On your secondary device, disconnect from vtrust-flash and connect to the new SSID called “sonoff-XXXX”
- Open 192.168.4.1 in your browser and enter your WiFi’s SSID and password.
- Use Fing to find your new device on your WiFi network, it should be called “Sonoff-XXXX”
- Open the IP address of your new device in a browser.
- If using MQTT:
- Click “configuration”
- Click “configure MQTT”
- Enter your MQTT information
- If not using MQTT:
- Click “Console”
- Type “setoption3 0”
- To get the best compatability with Tuya products you should update to the most recent version of Tasmota.
- From the main tasmota screen click “Firmware Upgrade”
- In the top box change the URL to “http://thehackbox.org/tasmota/sonoff.bin”
- Press “Start Upgrade”
- Update the name of your device under “Configure Other” and then “Friendly Name”
7. Configure your specific device
- On the main tasmota screen click “Configuration”.
- Click “Configure Module”
- Consult the list of known devices to input the correct GPIO pins and chips for your device.
- Press “Save” and enjoy!