-
2Software Setup: Tuya IoT Platform
Login to your Tuya Account or if you don’t have an account then create one using the SignUp option.
Once Logged In, an overview of the platform is visible. Click the Create button to start a new Project.
To develop the application for ESP32 click on ‘Can’t find the category?’. The following custom creation menu should appear.
Fill the required fields as done above and click Create. A pop-up box will appear, just close it to get the following screen.
Here, we’ll add a custom function of the following settings.
Click OK. The function will now be visible.
Tuya Smart Application Graphical User Interface (GUI) now needs to be developed. For that, simply switch to the Device Panel tab and select ‘Create Blank Panel’.
Following are the steps to complete the UI Studio procedure.
You can always test and release the application before moving further.
Note: The testing procedure requires you to install and login to the Tuya Smart Application on your Android and enter the same login email id here.
Once back to the Tuya IoT platform, it’s now time to generate a license for Link SDK.
Select Link SDK Cloud Access Mode from the Hardware Development Tab. Click on the ‘Select’ button provided to place the License order. Click ’Get 2 Free Licenses’ and complete the steps to finally download a .xlsx file with uuid and key.
Now it’s time to install tuyaos-link-sdk to avail connectivity to Tuya Smart Application via Python 3.x. On your Windows PC run the following commands to clone the GitHub repository and install the tuyaos-link-sdk.
git clone https://github.com/tuya/tuyaos-link-sdk-python.git python -m pip install ./tuyaos-link-sdk-python
Open the ledapp.py file from the GitHub repo in the editor. Edit and change the productid, uuid, authkey and the COM port of your connected ESP32 device in the file. We’ll further use this file in the output section of this article.
-
3Software Setup: Tuya Smart Application
Install the Tuya Smart App from the Google Play Store of your Android Device.
Login to your Account or if you don’t have one create one!
Now from the add device section click the scanner button to scan the QR code generated by the ledapp.py file.
Now the ESP Application will be added to the All Devices section of the Tuya Smart App.
-
4Software Setup: Arduino IDE for Configuring Tuya Link SDK
The Arduino IDE here is used to process the serial message from the desktop Python on the ESP32 board similar to the PhysicalPixel Built-in Example.
Add the ESP32 board in the Arduino IDE
Board Manager URL: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json
When the incoming Byte over serial is ‘H’, the program turns the LED on. The LED is turned off when the incoming Byte is ‘L’. Remember to set the proper GPIO Pin to which the LED is connected.
-
5Output
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.