Browse the most common questions and expert answers about TuyaOS on the Tuya IoT Platform.
This API is called: tkl_system_reset.
Solution is as follows: 1. Confirm that before the Tuya SDK initialization, the network connection is achieved through Tuya's Wi-Fi connection callback function `tkl_wifi_station_connect`, rather than using your own Wi-Fi network connection logic. 2. After the Tuya SDK initialization, ensure that the Wi-Fi connection is achieved through the `tkl_wifi_station_connect` callback function to ensure that MQTT can go online normally. 3. If you encounter the issue of the device being unable to connect to MQTT after restarting, check whether the device is connected to the network and whether the configuration file partition is missing, causing the inability to actively connect to MQTT. 4. You can use the interface `tuya_ipc_get_register_status` to check the device registration status to help troubleshoot the problem. Reference document:https://developer.tuya.com/en/docs/iot-device-dev/tuyaos-package-ipc-device?id=Kcn1qc5he02rw#title-5-%E5%94%A4%E9%86%92%E6%95%B0%E6%8D%AE.
In TuyaOS development, when using the tuya_iot_get_dp_prop_value interface to obtain DP point data, the returned DP value is usually determined by the device status. If the device supports the low-power DP cache delivery mechanism, this function can obtain the cached DP value. In this case, the device can obtain the cached DP from the cloud, which may not necessarily be the real-time value. You can refer to the link for related API documentation:https://developer.tuya.com/en/docs/iot-device-dev/TuyaOS-iot_abi_query_lowpower_dp_cache?id=Kd1tf8sz0nq73.
In TuyaOS, setting and adjusting the volume of audio devices and microphone gain, as well as solidifying the volume and micgain values obtained from AEC echo cancellation tests, can be done by following these steps: 1. Initialize audio parameters when the device is powered on, using the interface `tkl_ai_alg_para_set` for relevant settings. 2. The settings for volume and microphone gain can be completed through the following interfaces: `tkl_ai_set_vol()`: Used to set microphone gain. `tkl_ao_set_vol()`: Used to set speaker volume. 3. After debugging, you can fix the audio settings by calling these functions and passing specific parameters. For example: `tkl_ai_set_vol(TKL_AUDIO_TYPE_BOARD, 0, 65)` sets the microphone gain. `tkl_ao_set_vol(TKL_AUDIO_TYPE_BOARD, 0, NULL, 67)` sets the speaker volume. 4. These settings are equivalent to the micgain of 65 and volume of 67 in GUI tests and can be solidified as default parameters for the device. 5. It is recommended to place the adjustment of the above parameters before device initialization to ensure audio parameters are set correctly. Reference links: How to obtain audio processed by AEC: https://support.tuya.com/en/help/_detail/Kesi7ctn2cx02 How to perform noise reduction and echo cancellation for microphone pickup: https://support.tuya.com/en/help/_detail/Kel8nkh590a4q.
The issue is caused by the demo in version 3.12.5 adapting to the multi-connection of the slave device for door locks, resulting in errors for other demos that have not yet been adapted. The solution is as follows: 1. If there is no need for multi-connection, you can choose to use the SDK version 3.12.4 or 3.12.3, which will not cause this error. 2. If you need to use version 3.12.5, please confirm whether there is a need for multi-connection and adjust the SDK to adapt to the multi-connection of the slave device for door locks. 3. Subsequent versions will support the multi-connection capability of slave devices for other demos, and it is recommended to pay attention to the updates of the relevant SDK.
To use the Tuya private protocol for video transmission, you need to follow these steps: 1. Ensure that your device supports the Tuya private protocol. 2. Visit the Tuya Developer Platform and review the relevant development documentation. 3. Search for the TuyaOS package or camera-related documentation on the Developer Platform. 4. Specifically refer to the document "TuyaOS Package IPC Device" for detailed instructions on how to communicate with the Tuya private protocol. 5. Configure your device for video transmission via the Tuya private protocol according to the guidance in the documentation. By following the above steps, you can successfully use the Tuya private protocol for video transmission between devices.
To solve this problem, the following steps need to be taken: 1. Check whether the Wi-Fi chip is compatible with the current SDK and hardware in use, and confirm that the correct SDK and configuration have been selected. 2. Adapt in tkl_wifi.c to ensure it matches the network configuration mode of the specific project, such as AP configuration or Bluetooth configuration, etc. This part requires referring to the specific platform development documentation to confirm if there are any missing configurations. 3. Create an appropriate configuration file path for the tuyaos_demo_ipc program, usually ensuring that the path of the tuya_device_cfg.json file is correct and contains necessary fields (such as pid, uuid, authkey, etc.). 4. Determine whether there are issues with the pid file and hostapd configuration file. Solving the problem of Cannot open '/tmp/hostapd-wlan0.pid' may require rechecking and editing the hostapd.conf configuration file. 5. For the device binding application, ensure that the token value passed in is correct. You can obtain the token by scanning with WeChat and then pass it in to ensure the device is bound to the APP. Once it is confirmed that the hardware connection is correct and the driver is loaded properly, and tkl_wifi.c is adapted, after passing in the token generated by the actual Wi-Fi in debug mode, the device should be able to successfully bind to the application. If the problem persists, it is recommended to contact the original manufacturer for further professional technical support.
If you need to develop IPC finished products, it is recommended to refer to the development documentation provided by Tuya, TuyaOS IPC Development Framework https://developer.tuya.com/en/docs/iot-device-dev/IPC-Product-Sofrware-Development-Kit?id=Kbfjuvhlyu2wr.
Modules certified by ISED(IC) include: Wi-Fi Bluetooth modules: WBR1, WBR1-IPEX, WBR3; CB2L, CB3L, CB3S, CB8P, CBU; TCS905-3S; T1-2S-NL, T1-3S, T1-U-HL; T3-U; CR2S, CR3L; WBR1D-IPEX, WBR3D; Bluetooth modules: BT3L, BT7L-IPEX, BTU; BP3L; BDU; Adapter Boards:TYAUX-F2, TYAUX-J2, HEWRQU1, HEWBRCS1, MDWBRCU1, TCWBRCU1, TCLWRQS1; Discontinued modules: WB3L, WB3S, WB3S-IPEX, WB8P; WR1, WR3, WR4, WRD8P; TYLC5, TYWE1S, TYWE2L, TYWE2S, TYWE3L, TYWE3S, TYWE3SE;.
For the issue where the burning process stops at 95%, you can try the following solutions: 1. When the program burning progress reaches 95%, press the SW2 reset button to reset. Since the timing of the reset may be difficult to grasp, you may need to try several times. 2. If multiple attempts still fail, check the error code and refer to the relevant documentation. Use the manufacturer's tools to resolve the issue, then try to re-burn the firmware. Technical references can be accessed at the following links: Wi-Fi & BLE SoC Main Control Board (CBU) CB Series Module Burning Authorization.
To view the device reset reason, you can use the interface provided by TuyaOS: 1. Use the `tkl_system_get_reset_reason(CHAR_T** describe)` interface to obtain the device reset reason. The device reports the reset reason through this interface, and you can view the specific reset information by calling this interface. Regarding the configuration of the watchdog time: 1. The watchdog time is encapsulated at the underlying level and cannot be directly modified. 2. If the watchdog resets, it is recommended to check the application code, as it may be due to improper use of program resources. 3. You can try to shield the newly added code logic and observe whether the device continues to reset, thereby locating the problem.
You can continue to use the old MCU SDK to control the WBR3 module without upgrading. Please refer to the following steps: 1. Modify the protocol.h file in the old SDK to the new Product Key. 2. Update the new DP points in the protocol.c file. Please note that there may be some differences in functions, and data type definitions may have changed. If you are only modifying function points, you can copy the relevant code.
When compiling the TuyaOS project in the Python3.8 environment, if you encounter the error message "python3-venv is not installed", you can try the following steps to resolve it: 1. Ensure that python3-venv is installed. You can usually install it using the following command: ``` sudo apt-get install python3-venv -y ``` 2. After confirming the installation, execute the following command to clean and recompile the project: ``` make clean ``` Then recompile the project. 3. If the issue persists, check whether the versions of python3 and python3-venv are compatible. You can check the installed versions with the following command: ``` apt list --installed | grep python3.*venv ``` 4. Follow the above steps to ensure version compatibility and resolve the compilation error.
This interface can be used; detailed information can be found in this document: https://developer.tuya.com/en/docs/iot-device-dev/TuyaOS-iot_abi_device_reset?id=Kc67srci7m1jk#title-12-%E6%9C%AC%E5%9C%B0%E6%99%AE%E9%80%9A%E9%87%8D%E7%BD%AE%EF%BC%88%E8%A7%A3%E9%99%A4%E7%BB%91%E5%AE%9A%EF%BC%89 /** * @brief Local unactive * * @return OPERATE_RET */OPERATE_RET tuya_iot_wf_gw_unactive(VOID);.
Modules with KC certification include: Wi-Fi Bluetooth modules:WBR1, WBR1-IPEX, WBR2, WBR3;CB2L, CB2S, CB3S, CBU; CR3L; Bluetooth modules:BT3L; Zigbee modules:ZS3L, ZTU,TYZS3; Discontinued modules: WB2L, WB2S, WB3L, WB3S; WRG1; TYWE3L, TYWE3S, TYWE3SE.
Modules with TELEC certification include: Wi-Fi Bluetooth modules: WBR1, WBR1-IPEX, WBR3; T1-2S-NL, T1-3S; CB3L, CB3S, CBU; CR2S, CR3L; WBR3D; Bluetooth modules: BT3L; Zigbee modules: ZS2S, ZS3L, TYZS5; Discontinued modules: WB2L, WB3L, WB3S, WBLC5; WR1, WR2, WR3, WR3L, WR3LE; TYWE1S, TYWE1S-IPEX, TYWE2L, TYWE2S, TYWE3L, TYWE3S, TYWE3SE, TYLC5;.
This function can be achieved by enabling the 3-minute timeout anti-mistouch feature of Tuya. Refer to the following specific steps to set up the network configuration mode: 1. Open the Tuya Developer Documentation page:https://developer.tuya.com/en/docs/iot-device-dev/TuyaOS-iot_abi_network_config_mode?id=Kc67tro6mzaz0. 2. Select the network configuration mode with memory reconnection function. 3. Set a 3-minute timeout during the device network configuration process to ensure that if the network configuration times out or there is a power outage, the device is guided to automatically reconnect to the previously successfully connected router.
Currently, it is not possible to view the rate of running threads created by TuyaOS. This feature is not yet supported or provided with relevant interfaces. Please stay tuned for future updates or feature releases.
To understand TuyaOS development, you need to configure and generate the firmware yourself before placing an order to purchase the module, and choose the empty delivery method on the purchase page. If you don't have the firmware temporarily, you can solve it in the following ways: 1. Purchase the module from the MCU SDK solution, this method does not require pre-prepared firmware and is suitable for development. 2. If you are not in a hurry to purchase immediately, it is recommended to configure the TuyaOS firmware before purchasing. When choosing the empty delivery form, there is no need to consider the issues of firmware and development methods, you can directly purchase the empty module.
Please call the interface in the tal_spi.h file to implement the function.
There are architectural differences between TuyaOS and TuyaOpen. Porting TuyaOS to TuyaOpen requires certain modifications. TuyaOpen is open source and can directly call underlying interfaces. If you want to develop a color-changing light strip, using TuyaOpen requires implementing related functions yourself, whereas TuyaOS already has relevant development packages.
In the new SDK, the API that replaces the `tkl_ble_gatt_evt_chage` function is `tkl_ble_gatt_callback_register`. Additionally, the Tuya product itself already includes the mbedtls library, so there is no need to package this library separately during adaptation.
Currently, the TuyaOS SDK does not support multi-level brightness adjustment functionality, only screen backlight switch control. This feature may need to be added, and related products can be set through the screen brightness DP function point.
Modules with NCC certification are: Wi-Fi Bluetooth modules: WBR1, WBR3, WBRU; CR3L; Bluetooth modules: None; Zigbee modules: None; Discontinued modules: WR1, WR3, WR6; TYWE1S, TYWE3SE;.
This is caused by environmental issues. The solution is as follows: 1. Delete the directory of the current virtual environment, the path is: T5_TuyaOS-xxx/software/TuyaOS/vendor/T5/t5_os/projects/tuya_app/tuya_build_env. 2. Rebuild. The script will automatically determine whether the directory exists, and if not, it will create a new virtual environment. You can delete the virtual environment directory in the following two ways: - Use the file manager: Find the corresponding directory according to the provided path, then right-click to delete. - Use the command line: You can execute the command `rm -r directory_path`, where `directory_path` is the path to the virtual environment directory. Additionally, you can refer to the relevant environment installation issue documentation:https://doc.weixin.qq.com/doc/w3_AHUA7wbHALEDnfEn6bjQnig4gHVB1?scode=AGQAugfWAAkF4MXDcbAHUA7wbHALE&version=5.0.0.8506&platform=win.
Log print error 2, printtkl_ota_get_crc32_in_flash,sg_data_crc32 and *p_firmware_crc32, foundtkl_ota_get_crc32_in_flash and the other two values are different. Using the original factory tool to read, it was found that there is dirty data in the flash. Reason: First, the normal code upgrades from area A to area B, area B executes, re-burning without fully erasing the firmware executes in area A, the firmware in area B still exists, so there is dirty data. The reason for not fully erasing is that the chip platform is not erase-while-write, so during the debugging phase of OTA, it is recommended that developers use BDT erase before burning each time.
In the Tuyalink device access scenario, there are two main methods to achieve a factory reset: 1. Local reset: Triggered by the device's button or power-on count, it restores the device to the state before network configuration and allows the choice of whether to clear data. After the device is reset, it enters the network configuration state. If the network configuration times out or the device restarts, it will restore the previous network information. 2. Remote reset: This is done through application software to unbind the device from the cloud. A normal reset only unbinds the relationship, while a factory reset clears both the cloud and the device's local data. For Tuyalink access, the device side supports the local normal reset function, which unbinds the device through local buttons or power-on counts, restoring it to the state before network configuration without clearing local or cloud data, allowing for re-binding with the device. Note: For Tuyalink development, the device side does not provide a direct reset interface.
Modules certified by ANATEL include: Wi-Fi Bluetooth modules: WBR1, WBR1-IPEX, WBR3; T1-2S-NL, T1-3S, T1-LC5-HL, T1-U-HL, T1-U-HL-IPEX; T5-E1; CB2L, CB2S, CB3L, CB3S, CBLC5, CBLC9, CBU, CBU-IPEX; WBRG1; WL2H-U; Bluetooth modules: BT3L; Zigbee modules: ZS3L, ZT3L, ZTU; Discontinued modules: WB2S, WB3S, WB3S-IPEX; Note: The validity period of Brazil ANATEL certification is two years.
Tuyalink development does not support scene linkage and message push.
The T1-ADC reference voltage is 0~3.6V. You can use this function to collect the voltage, tkl_adc_read_voltage(TUYA_ADC_NUM_Eport_num, INT32_T*buff, UINT16_Tlen).
According to the solution, the following steps can be taken: 1. For WBR3 devices, enable bit3 of the 0x01 command. 2. After unbinding, you will usually receive a notification of the device reset status. 3. This reset status notification is issued through the data of the 0x25 command. For detailed information, refer to the protocol document:https://developer.tuya.com/en/docs/iot/door-lock-mcu-protocol?id=Kcmktkdx4hovi#title-12-Notify%20status%20of%20module%20reset%20(0x25).
The modules that have obtained RED network security certification include: WBR1,WBR1-IPEX,WBR2,WBR3,WBRU,WBRU-IPEX,JWBR2S-5V,MDWBRCU1,TCWBRCU1,TCLWBR,TYAUX-J2,TYAUX-F2,TYAUX-LM2,TYCH01; CB2L,CB2S,CB2S-J,CB3L,CB3S,CS3S-NL,CB8P,CBLC5,CBLC9,CBU,CBU-IPEX,CBU-NL,T2-U,WT3,TCS905-3S,TCS905-U; T1-2S,T1-2S -NL,T1-3S,T1-LC5,T1-LC5-HL,T1-U,T1-U-IPEX,T1-U-HL,T1-U-HL-IPEX,T1-M,T1-M-IPEX; T3-2S,T3-3S,T3-E2,T3-M,T3-M-IPEX,T3-U,T3-U-IPEX; T5-E1,T5-E1-IPEX; WBR1D,WBR1D-IPEX,WBR2D,WBR3D; CR3L,CR3L-IPEX,CR2S,CRG1; AXY2S,AXY3S,AXYU,AXYU-IPEX.
You can check the certification status of the module used for the corresponding PID on the Tuya developer platform - Purchase - Module Certification: https://iot.tuya.com/purchase/certification. Select the product, the module model will be automatically recognized, and you can view the certification status: If the certification status shows "Certified," you can go to the Product Development interface (https://platform.tuya.com/pmg/list), click the product name, and a product overview page will pop up where you can download the "Module attestation materials", including the certified certificates. Note: If there is no download option for "Module attestation materials" on the current page, you can submit a ticket for induiry or contact Tuya certification support colleagues. If the certification status shows "Certified," but the downloaded data does not contain the certificate, contact Tuya certification support to obtain the certificate. If the certification status shows "Not Certified," please check back later as Tuya will continuously update the status. Note: This position does not show WiFi Alliance and Thread certifications. If you need to know whether the certifications have been done, you can download the module certification materials to check the certificates. For Example: WBR3(SRRC、CE、FCC、IC、TELEC、KC、NCC、ETA、ANATEL、BQB).
tuyaos_wf_t1_lig-tuyaos_t1_light_ty is the product development kit for the T1 bulb lamp.
TuyaOS cloud licenses are universal and have the same price. Note: The universal license is not currently compatible with video products such as smart cameras, video locks, NVRs, and low-power cameras.
Calling the tal_ble_advertising_stop function to stop the broadcast interface will prevent the app from discovering the device.
The Compound Scene Switch PRO is developed based on the latest TuyaOS architecture and offers more functionality. You can try creating a product to see how it works.
Starting from iOS 13, if geolocation permission is not enabled, [[TuyaSmartActivator sharedInstance] currentWifiSSID] will not get the correct SSID (if Wi-Fi permission is enabled), in this case, the system will return WLAN or Wi-Fi by default, and the developer email will receive an official email explanation, as shown below After receiving the email, you need to turn on the access Wi-Fi information permission in Xcode10, you need the certificate to check the Access Wi-Fi Information selection. Path: Set Access WiFi Information to ON at Xcode [Project Name] Targets [Target Name] Capabilities. You can refer to the iOS certificate creation document to recreate the certificate for the specific process.
Confession Letter Hello there, dear friend we've yet to meet! We've created comprehensive documentation and a wealth of Q&A content, but when problems arise, it seems we can't help you quickly find the nanny-level tutorials you need. We've considered creating different documents for different businesses and roles, but with limited resources and an unknown return on investment, this is not realistic. Therefore, we can only meet you in the current way, and we will try to point out the applicable audience and scenarios at the beginning of the text to help you locate more quickly. If you think this format is okay, we hope you can give us positive feedback such as likes, because only with enough positive feedback can we apply for more resources to continue. Main Content Directory I. Applicable Audience and Scenarios II. Preliminary Preparations III. Software Installation IV. Flashing Process I. Applicable Audience and Scenarios Development methods: No-code development, MCU SDK universal solution, TuyaOS development method Development stage: After creating a product on the development platform and ordering networking modules during hardware development, you are in the sample debugging stage Note: If you are in the form of "Authorization Code List Delivery", "Bulk order over 100pcs modules", "Secondary development of finished products", "Reverse development", "no-code development multi-mode gateway/Cat.1 protocol modules and other special categories or chip platforms", you do not need to flash by yourself, and you do not need to read this tutorial. II. Preliminary Preparations 1. Purchase a flashing jig, link: Tuya Smart Developer Center Note: Purchase the flashing jig corresponding to the module, the purchase link contains instructions on the module models that the jig is compatible with, see the link for details 2. Purchase a serial port tool and serial cable, link: Tuya Smart Developer Center Note: Either a 2M high-speed serial board or a 3M high-speed serial board will.
To ensure network configuration stability, the minimum timeout cannot be less than 1 minute. If you do not want to configure the network upon powering on, you can set the configuration mode to GWCM_LOW_POWER (low power on power-up). When network configuration is needed, you can reset and enter the configuration state by calling tuya_iot_wf_gw_unactive() with a button press. For a detailed explanation of configuration modes: Pairing Mode - TuyaOS - Tuya Developer.
Locate the software/TuyaOS/vendor/bk7231n/bk7231n_os/beken378/driver/uart/uart_bk.c file, and then comment out the implementation of the function: void bk_printf(const char *fmt, ...). voidbk_printf(constchar*fmt, ...) { #if 0 ... #endif }.
The mbedtls version is 3.1.0.
To facilitate troubleshooting, it is generally not recommended to disable the log function. You can reduce the number of log outputs by setting the log level. If you must disable it, you can findtkl_log_output, and comment out or delete the internal implementation of the function.
Can be accessed through the interface below 1. Update subsidiary firmware version information OPERATE_RETtuya_iot_dev_update_attachs(UINT_Tattr_num, GW_ATTACH_ATTR_T*attrs); 2. Set subsidiary firmware version information OPERATE_RETtuya_iot_dev_set_attach_attr(GW_PERMIT_DEV_TP_Ttp, GW_ATTACH_ATTR_T*attr); GW_ATTACH_ATTR_TInitialization example is as follows: UINT_T attr_num = 3;
GW_ATTACH_ATTR_T attr[3] = { { .tp = DEV_NM_NOT_ATH_SNGL, // MCU module .ver = "1.0.0" }, { .tp = DEV_BLE_SNGL, // Bluetooth module .ver = "2.0.0" }, { .tp = DEV_ATTACH_MOD_1, // Voice module (custom tp, needs to be consistent with IoT frontend configuration) .ver = "3.0.0" }
};.
There are two ways to authorize the secondary development module for connected products: 1. Serial port authorization (also called module production test), suitable for scenarios: mass production stage. 2. Plain text authorization (also called license list authorization or device authorization), suitable for scenarios: suitable for use during development and debugging stage. Note: Be sure to disable the plain text authorization method in mass production firmware, otherwise the module cannot pass the module production test process during factory production. I. Serial Port Authorization Serial port authorization is the module production test, using the Tuya production solution,Cloud Module tool writes module firmware and authorization information into the module through a serial port method of burning + authorization integration. Prerequisite: The program must callmf_init initialization interface. MF_IMPORT_INTF_S intf = {0}; intf.uart_init= mf_uart_init_callback; intf.uart_free= mf_uart_free_callback; intf.uart_send= mf_uart_send_callback; intf.uart_recv= mf_uart_recv_callback; intf.mf_user_product_test= mf_user_product_test_callback; intf.user_callback= mf_user_callback; intf.user_enter_mf_callback= mf_user_enter_mf_callback; TUYA_CALL_ERR_RETURN(mf_init(&intf, APP_BIN_NAME, USER_SW_VER, TRUE)); TAL_PR_NOTICE("mf_init successfully"); Required tools: production certificate, cloud module tool, USB to serial port board. Possible reasons for failure: module connected to the network for more than 15 minutes, incorrect baud rate selection (default is 9600), wiring issues, etc. II. Plain Text Authorization Plain text authorization is the method of filling in UUID and KEY in the program, and the authorization information is transmitted throughOPERATE_RET tuya_iot_set_wf_gw_prod_info(IN CONST WF_GW_PROD_INFO_S *wf_prod_info) interface. Example is as follows: #define UUID "f998xxxxxxxx2409" #define AUTHKEY "WEHAxxxxxxxxxxxxxxxxxxxxxxxxVVkf" WF_GW_PROD_INFO_Sprod_info= {.
Tuya Wind IDE is a one-stop integrated development environment provided for developers based on TuyaOS EasyGo. Tuya Wind IDE is released as a Visual Studio Code plugin, supports bilingual in Chinese and English, and can be logged in with a Tuya Developer Platform account. Tuya Wind IDE centrally manages, distributes, and updates TuyaOS EasyGo related development materials, providing a consistent development experience under different hosts and development tools. The TuyaOS SDK basic framework has already implemented basic functions such as networking connection to Tuya Cloud, OTA, etc. Developers only need to develop their own applications within the SDK framework. To develop TuyaOS, you need to install Vscode, and then install the Tuya Wind IDE plugin to obtain the TuyaOS SDK: Bluetooth and Zigbee modules can be compiled under Windows, while the Wi-Fi module development environment needs to be deployed and compiled under Linux. If you have not yet set up a Linux system environment, you can use the Ubuntu image adapted by Tuya for the Wind IDE development environment. (The use of the development resource package can refer to the documents in the docs folder within the file package). Tutorial for obtaining SDK and setting up the compilation environment with Tuya Wind IDE: https://developer.tuya.com/en/docs/iot-device-dev/tuyaos-wind-ide?id=Kbfy6kfuuqqu3 Get the Ubuntu development image: https://www.tuyaos.com/viewtopic.php?t=1201 1. VScode Install Tuya WindIDE Integrated Development Environment 2. Log in to WindIDE, create a new development framework and pull the SDK 3. Apply for the SDK in the Resource Center 4. Go to the development framework to get the demo and product development kit.
Device types that can be displayed normally in offline state Devices that can report status themselves: Wi-Fi and cat.1 protocols can directly connect to cloud devices (including gateways). NB-IoT devices, TuyaLink solutions, etc. are reported offline through operators or cloud connection. Devices that report status through the gateway agent: Bluetooth, Bluetooth Mesh (SIG), zigbee and other devices can be displayed in the offline state normally when connected to the gateway (the status is reported by the gateway, and when the gateway is completely disconnected, the gateway will report offline). Devices permanently displayed online Low power consumption devices (enable permanent online capability) For example, products such as low-power door sensors will always be displayed online if the low-power permanent online advanced function is enabled during function definition. (If permanent online is turned off, such products will be reported as online within the low-power heartbeat interval configured for advanced functions, and will not be reported as offline after this time.) Permanently display offline devices Bluetooth single point device (not linked to the gateway) For Bluetooth devices that complete the activation process directly through the mobile phone network (without being linked to the gateway). Permanent display offline. (When this type of device is connected to a mobile phone, the mobile phone can disconnect from the network to complete local control. At this time, the cloud cannot know the offline status of the device. Therefore, such devices are uniformly displayed offline.).
NCC certification is the abbreviation for the National Communications Commission in Taiwan, which is mainly responsible for the certification of communication and information equipment circulated and used in the Taiwan market. NCC certification ensures that telecommunication products comply with relevant regulations and standards to ensure product safety, electromagnetic compatibility, and compliance with wireless spectrum usage. NCC certification applies to various telecommunication products, including wireless communication devices, wired communication devices, and telecommunication terminal equipment. Products requiring certification include low-power radio frequency motor products, such as wireless network (WLAN) products (including IEEE 802.11a/b/g/n Wi-Fi), UMII, Bluetooth products, RFID (125kHz~134kHz, 13.56MHz, 27MHz, 922MHz~928MHz, 2.4GHz, 5.8GHz), Zigbee, wireless keyboards, wireless mice, wireless headset microphones, radio walkie-talkies, radio remote control toys, various radio remote controls, various wireless anti-theft devices, Family Radio Service (FRS), etc.
These modules support Wi-Fi and Bluetooth, so both Wi-Fi and Bluetooth need to be filled in the specification sheet. The following parameters are the same for Wi-Fi and Bluetooth: Module temperature:-20℃ to 85℃; (generally filled according to the whole machine temperature) Module voltage: 3V-3.6V, normal voltage 3.3V; Hardware version: Silk screen on the back of the module. For example, 101, i.e., V1.0.1, fill in according to this rule Software version: Firmware version, orcheck device information in the APP, the software version number is in the device information Antenna type:WBR1, WBR2, WBR3, WBRU: PCB; WBR1-IPEX, WBRU-IPEX: External (or fill in according to the actual type, such as FPC) Antenna gain:WBR1, WBR2, WBR3: 2.54dBi;WBRU: 1.16dBi;WBR1-IPEX, WBRU-IPEX: Fill in according to the maximum gain of the antenna actually used Antenna configuration (port):1TX 1RX;SISO; Single transmit single receive (generally one of these three methods in the table) Maximum operating frequency excluding RF: 40MHz (module crystal oscillator); (mentioned by some organizations) The following are the different RF parameters for Wi-Fi and Bluetooth: Wi-Fi: (Frequency 2400-2483.5MHz, 2.4G, so the 5G part of the Wi-Fi table does not need to be filled) 1. Frequency: Europe, China, Korea, Brazil, etc. certification: 2412-2472MHz; USA, Canada, Taiwan: 2412-2462MHz; Japan: 2412-2472MHz, 2484MHz; 2. Channel:Europe, China, Korea, Brazil, etc. certification: 1-13;USA, Canada, Taiwan: 1-11; Japan: 1-14; 3. Mode (modulation technology):802.11b, 802.11g, 802.11n (HT20) or 802.11n20 4. Modulation type: DSSS (CCK, DQPSK, DBPSK); OFDM (64QAM, 16QAM, QPSK, BPSK) 5. Rate: b: 1/2/5.5/11 (Mbps); g: 6/9/12/18/24/36/48/54 (Mbps); n: MCS0-MCS7 6. Occupied bandwidth: 20MHz 7. Channel spacing: 5MHz 8.Power: 11b: 17dBm; 11g: 14.5dBm; 11n: 13.5dBm (excluding gain) 9. Adaptive: Supported 10. TPC, DFS: Not supported, no need to fill in the table Bluetooth: 1. Frequency: 2402-2480MHz; 2. Channel: 0-39; 40 channe.
rtwpriv wlan0 mp_bandwidth 40M=0,shortGI=0 //20M bandwidth, if testing 40M bandwidth, set 40M=1 rtwpriv wlan0 mp_channel 1 //Channel switch, to test other channels, change 1 to the corresponding channel rtwpriv wlan0 mp_rate 2 //11b 1M=2; 11b 11M=22; 11g 6M=12; 11g 54M=108; 11n MCS0=128; 11n MCS7=135 rtwpriv wlan0 mp_txpower patha=42,pathb=42 //Power Index Setting rtwpriv wlan0 mp_ctx background,pkt //Start packet transmission rtwpriv wlan0 mp_ctx stop //Stop packet transmission If testing single carrier, just change rtwpriv wlan0 mp_ctx background,pkt to rtwpriv wlan0 mp_ctx background,stone.
Address: https://developer.tuya.com/en/miniapp/develop/ray/api/thing-model/publishThingModelMessage type is 0: type is 1:.
/** * @brief [Unsafe function]get sub-device info * * @param dev_id devid: if devid = sub-device_id, then return the sub-dev info * if devid = NULL, then return the gateway info * * @return DEV_DESC_IF_S* Device information pointer (NULL means not found) */ DEV_DESC_IF_S* tuya_iot_get_dev_if(IN CONST CHAR_T* dev_id);.
Currently, TuyaOS only uses the C language.
UART1 is by default the chip's programming, RF calibration, and production test authorization serial port, RX is pulled high waiting for input. It remains high from the bootloader stage, so it cannot be done, and there is no way to solve it.
The interface can be used: VOID_T tuya_ble_set_bind_window(UINT_T time_out), time_out is fully filled with F.
Calling this interface can obtain the wake-up source: OPERATE_RET tkl_wakeup_source_type_get(TUYA_WAKEUP_SOURCE_BASE_CFG_T *param).
You can use this interface: VOID_T tuya_ble_set_bind_window(UINT_T time_out), fill 0 for time_out.
7.
Did not strictly configure the AP name and IP segment according to the cfg provided by tkl_wifi_start_ap, or did not assign an IP in the 192.168.176.x segment to the phone.
During Maximum Transmission Unit negotiation, request MTU through this API, and the final negotiated MTU will be reported to the business end via TAL_BLE_EVT_MTU_RSP: OPERATE_RET tkl_ble_gattc_exchange_mtu_request(USHORT_T conn_handle, USHORT_T client_rx_mtu). Note: MTU does not exceed 247.
First register the tuya_iot_api_pre_handle_register_cb callback, then call the tuya_iot_get_location_info interface to get feedback on the region where the current device is activated, such as China region, Europe region, etc.
Calling tuya_iot_mqtt_disconnect() will report offline to the cloud.
Find the path: software/TuyaOS/vendor/T3/t3_os/armino/include/driver/hal/hal_uart_types.h Modify#defineUART_BAUD_RATE this macro's corresponding size, default 460800.
After the TuyaOS SDK Bluetooth is successfully initialized, the callback event after the completion of the Bluetooth protocol stack (it must be the real callback of the underlying protocol stack of the Bluetooth platform) needs to be sent to the TuyaOS SDK. Only then can the TuyaOS SDK initiate a broadcast update (call the tkl_ble_gap_adv_rsp_data_set) interface.
It is possible to monitor whether the SDK is writing to the DB file through the tkl_fwrite interface. The SDK will call this interface when writing to the DB.
Can use: OPERATE_RET tal_time_set_posix(IN CONST TIME_T time, IN CONST INT_T update_source).
Can use: tuya_iot_wf_timeout_set interface, as shown:.
Supported.
No, it must be awakened at least once within 96 hours, and it needs to be awakened for more than 15 seconds, otherwise it may affect normal use.
Currently, direct retrieval of the day of the week is not supported. Developers need to calculate it based on other time data obtained.
Reserve 10K ~ 15K. If it is less than this range, the SDK will not be able to connect to the network. Please optimize the use of application layer memory.
No need, once the SDK enters the network configuration state, the Bluetooth configuration function will be enabled by default.
OPERATE_RET tkl_wifi_station_get_conn_ap_rssi(SCHAR_T *rssi).
TUYA_RESET_REASON_E tkl_system_get_reset_reason(CHAR_T** describe).
Compile log: Error loading Python lib '/tmp/_MEIJuFg0J/libpython3.8.so.1.0': dlopen: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by /tmp/_MEIJuFg0J/libpython3.8.so.1.0) /home/alientek/tuya/T1-CHL_TuyaOS-3.11.11/software/TuyaOS/scripts/mk/app.mk:190: recipe for target 'app_by_name' failed. This indicates that the glibc version needs to be upgraded.
For TuyaOS3.10.x and below versions, BLE does not require writing the channel code (country code). You need to modify the product firmware configuration to configure it as "Not Supported" for the country code. After modification, you need to repurchase the production certificate or "update" the production certificate. Update production certificate = Split the production certificate from product A to product B, and then split it back from product B to product A.
Manually package and send time request VOID_T user_time_sync_request_send(VOID_T)
{ TAL_ZG_SEND_DATA_T data; tkl_system_memset(&data, 0, sizeof(TAL_ZG_SEND_DATA_T)); data.addr.mode = SEND_MODE_DEV;
data.addr.type.dev.dst_ep = TUYA_PRIMARY_ENDPOINT;
data.addr.type.dev.src_ep = TUYA_PRIMARY_ENDPOINT;
data.addr.type.dev.dst_addr = TUYA_GATEWAY_ADDRESS;
data.addr.type.dev.cluster_id = CLUSTER_TIME_CLUSTER_ID; data.zcl_id = 0xF0;
data.qos = QOS_1;
data.frame_type = ZG_ZCL_FRAME_TYPE_GLOBAL;
data.direction = ZG_ZCL_DATA_CLIENT_TO_SERVER;
data.command_id = CMD_READ_ATTRIBUTES_COMMAND_ID; data.data.zg.attr_sum = 1;
data.data.zg.attr[0].attr_id = ATTR_LOCAL_TIME_ATTRIBUTE_ID; tal_time_sync_debug("gateway time sync.\r\n");
tal_zg_send_data(&data, NULL, 1000);
} After obtaining the time, it will enter the following callback,tal_time_sync_complete_callback isa virtual function that needs to be defined in the program VOID_T tal_time_sync_complete_callback(BOOL_T status, UINT_T time_sec)
{ if(status && time_sec) { return; }
}.
You need to right-click on the demo tuyaos_wf_bk7231n_elp-tuyaos_wf_bk7231n_ir_plug, select config project, and fill in the send and receive pins in the irTuyaOS ir application configuration as follows:.
The channels here are used for OTA upgrades and reporting firmware versions for different device firmware types. For example, the module firmware (direct connection) defaults to 0, and the MCU channel is fixed at 9. If the device has not reported the firmware version on this channel, directly performing OTA will display a "Channel number not reported" prompt. When TuyaLink reports the firmware version, if you use the tuya/tuya-iot-core-sdk to directly call the tuyalink_ota_firmware_report() interface, the reporting format is as follows: tuyalink_ota_firmware_report(context,deviceId,"{\"bizType\":\"INIT\",\"pid\":\"al0fhe2uqyg6pzeb\",\"otaChannel\":[{\"channel\":0,\"version\":\"1.0.0\"},{\"channel\":9,\"version\":\"1.0.0\"}]}"); If using the MQTT protocol, please refer to this link.
When developing for TuyaLink, you can correctly access and configure the Panel MiniApp used by Tuya projects by following these steps: 1. Application Development Selection: During the product creation process, select "Application Development" "Panel Development." Select a panel template to use. 2. TuyaLink Universal Panel: Simple panels generated based on product functionality for testing product capabilities. 3. Custom Panel: Develop using the Panel MiniApp technology framework provided by Tuya, supporting all Tuya apps. See Panel MiniApp for more information. 4. Custom Development: If you do not have development resources, you can contact the Tuya platform for custom development. For more information, see Customizing Panels. Through the above steps, you can choose the appropriate method to configure and develop your Panel MiniApp.
Different development methods require different methods. TuyaOS development reference: https://developer.tuya.com/en/docs/iot-device-dev/bluetooth_product_test_ble?id=Kcy65sk7mybdw MCU SDK development reference: https://support.tuya.com/en/help/_detail/K9hrwgbspj6en.
The function tuya_iot_refuse_upgrade(INCONST FW_UG_S *fw, INCONST CHAR_T *dev_id) can be called for this purpose. The function path is as follows:.
First, check whether the Bluetooth device is a roaming device. Typically, a [ROAMING,,,xxx] message will be displayed during association. Setting the roaming device flag TAL_BLE_BEACON_ROAMING_FLAG=Y/1 indicates roaming is enabled. Bluetooth Roaming Concept: Bluetooth Roaming-TuyaOS-Tuya Developer If it is not a roaming device, please consult your project manager or gateway product manager to inquire whether the sub-device type supports use with the gateway.
Burn the official example provided by the TuyaOS Bluetooth LE SDK. For detailed steps, refer to TuyaOS Quick Start. Check if the development board is working properly, for example, if there is an external low-frequency crystal oscillator. For the requirements of development boards corresponding to different chips, refer to Development Platform. Confirm the version of the Tuya App, and whether this App is the official version downloaded from the official store. Confirm whether the PID and Authorization Information are filled in correctly. For more information, refer to DP Data Communication and TuyaOS Development of Bluetooth Products: Authorization and Production Testing. Confirm whether the device broadcasting is normal and whether the device is in an unbound state. For more information, refer to Device Pairing.
Currently, the full-color bulb product development kit (version 1.0.1) does not support infrared. Porting from other products will result in decoding failures.
That depends. Keepalive Wi-Fi locks support the low power mode, and the current can be less than 200 uA in standby mode. In the active state, the power consumption of the module can reach around 350ua, and in the deep sleep state, the power consumption will be lower by less than 100ua. Non-keepalive Wi-Fi locks do not support the low power mode. You must power off the Wi-Fi modules, such as WBR1, WBR3, and WBRU, to save power.
The new versions of SmartLife App SDK (v4.0 and later) will increasingly support the following features: Configure the Custom Domain Name service and transmit data through dedicated channels. Adapt to new features of iOS and Android platforms. Enable TuyaLink-based connectivity of third-party devices and implement pairing and control of these devices. Pair and control smart devices over Matter. Stay tuned for more features.
You can use the original tool to erase it.
Use serial port 1 as a normal IO. TX1 cannot be pulled low before power on. Pulling TX1 low will enter ate mode.
Call this function OPERATE_RETtkl_pwm_info_set(TUYA_PWM_NUM_Ech_id, CONSTTUYA_PWM_BASE_CFG_T*info) to set it. After the setting is completed, you need to call tkl_pwm_start(TUYA_PWM_NUM_Ech_id) again.
You can call rtos_enter_critical() to enter and rtos_exit_critical() to exit. The function is located in the following directory:.
The log function is implemented through the log output callback function registered by tal_log_create_manage_and_init. TLSR8258 - Telink Micro Platform Use ordinary IO to simulate UART for printing logs. The default baud rate of the log is 115200 and cannot be modified. The default log output pin is C4. The log pin can be modified through the following function. Note that it is recommended to set it to (B1, B7, which are TX and RX pins used for module authorization and general serial port use) BOOL_Tapp_print_get_cfg(UINT8_T*print_type, UINT8_T*disable_irq, GPIO_PORT_PIN_T*gpio) { gpio-port=PORT_C;//Pin port gpio-pin=PIN_4;//Pin number *print_type=0; *disable_irq=1; #ifdefUART_PRINTF_MODE return1; #else return0; #endif } MG21 - Silicon Labs Platform The SDK uses USER_UART0 as the default log output pin, and the baud rate can be customized, defaulting to: 115200.
Refer to the example below: /* *IPC 5.x useshttp_gw_ipc_custom_msg() interface *IPC 6.x usestuya_http_gw_ipc_custom_msg()interface */ OPERATE_RET test_report_mac_api() { ty_cJSON* result = NULL; CHAR_T buffer[32] = {0}; NW_MAC_S buffer_mac; tal_wifi_get_mac(WF_STATION, &buffer_mac); snprintf(buffer, sizeof(buffer), "{\"mac\":\"%02X%02X%02X%02X%02X%02X\"}", buffer_mac.mac[0], buffer_mac.mac[1], buffer_mac.mac[2], buffer_mac.mac[3], buffer_mac.mac[4], buffer_mac.mac[5]); OPERATE_RET ret = tuya_http_gw_ipc_custom_msg("thing.device.mac.report", "1.0", buffer, &result); if(result) { ty_cJSON_Delete(result); } PR_DEBUG("Upload mac %s, ret: %d", buffer, ret); return ret; }.
Yes, please refer to: Key-Value Database.
Find include\tuya_ble_protocol_callback.h to set the following three parameters. *Note: The larger the broadcast interval and connection interval, the lower the power consumption will be, but there are also side effects. The larger the interval, the more the experience of network configuration and App reconnection will change, and adjustments need to be made according to the actual scenario. #defineTY_ADV_INTERVAL20 //Broadcast interval range: 20~10240ms #defineTY_CONN_INTERVAL_MIN15 //Minimum connection interval range: 7.5~4000ms #defineTY_CONN_INTERVAL_MAX15 //Maximum connection interval range: 7.5~4000ms.
If you want to develop products using the TuyaOS development framework, but TuyaOS does not support the chip platform you are using, you can apply to the TuyaOS developer team through the TuyaOS porting method. Once approved, you can obtain the development framework in the TuyaOS SDK mode suitable for the desired chip platform, and then independently adapt, debug, and verify the TuyaOS Kernel interface. After the porting is completed, you can proceed with product development. Specifically, you need to fill out the TuyaOS Porting Application Template and provide the required information to the business line product manager you are in contact with. The business line product manager will apply on your behalf by sending an email, explaining the specific business requirements at the same time. Bluetooth Chip Independent Access - TuyaOS - Tuya Developer.
The SDK obtains the IP address in AP mode through tkl_wifi_get_ip(WF_AP, NW_IP_S *ip), but the IP address returned by this API is invalid, causing the bind to fail. Confirm whether the AP name and IP segment are configured strictly according to the cfg provided by tkl_wifi_start_ap.
The tuya_iot_wf_gw_unactive interface is locally removed, and the device ID remains unchanged. The tuya_iot_wf_gw_reset interface is for restoring the factory device, this interface will change the device ID and clear the cloud data of the previous device ID.
The first reason is the use of hardcoded broadcast data in the demo, which the app cannot recognize. The Tuya SDK will actively call tkl_ble_gap_adv_rsp_data_set to set the broadcast data. The broadcast data is packaged and broadcasted through information such as PID and UUID, and if hardcoded, the app will not recognize it. The second reason is that after the Bluetooth protocol stack is successfully initialized, the SDK is not notified of the successful initialization of the protocol stack (TKL_BLE_EVT_STACK_INIT), at which point the SDK will not call the interface to start broadcasting.
When the SDK is powered on, it will go through the tkl_wifi_station_get_status interface. If it directly returns WSS_GOT_IP, the SDK will assume the device is already connected to the network and proceed with the network configuration process. Therefore, tkl_wifi_station_get_status can directly return other values.
Generally, it is not necessary to directly use lwip internal data. If it is necessary, you can use extern: extern struct netif xnetif[].
Currently using version 1.2.
In the currently released SDK by Tuya, only one peripheral is tested by default. If you need to modify the default pins or add other peripherals, please open CCS, import the Tuya project, and click TuyaOS_CC2340.syscfg for configuration.
The chip reduces power consumption by turning off broadcasts and peripherals, and automatically enters low power mode when no tasks need to be executed, without requiring additional interface calls.
TuyaOS development framework is oriented to vertical product fields and provides low-code product development materials, enabling you to quickly develop application products with distinctive functions in this field. To obtain it, log in to Tuya Wind IDE in Vscode and list it in the development framework. To obtain it for the first time, you need to fill in the business manager's email address to apply.
For more information, see: https://developer.tuya.com/en/docs/iot-device-dev/tuyaos-wind-ide?id=Kbfy6kfuuqqu3.
Removing a device from the app will enter the gw_deset_cb callback. Unbinding, unbinding, and clearing data can be distinguished by resetting the type. The corresponding TYPE for unbinding is: GW_REMOTE_UNACTIVE, Unbind and clear data corresponding to TYPE: GW_REMOTE_RESET_FACTORY. //The complete definition of reset type is as follows /* tuya sdk gateway reset type */ typedefenum { GW_LOCAL_RESET_FACTORY =0,//(cb/event) GW_REMOTE_UNACTIVE,//(cb/event) GW_LOCAL_UNACTIVE,//(cb/event) GW_REMOTE_RESET_FACTORY,//(cb/event) GW_RESET_DATA_FACTORY, //need clear local data when active(cb/event) GW_REMOTE_RESET_DATA_FACTORY, //need clear local data when active(event only) } GW_RESET_TYPE_E;.
Check whether the parameters used for the crystal oscillator are correct; Replace the capacitors at both ends of the crystal oscillator or remove the capacitors. It may be caused by frequency deviation. The capacitors should be adjusted or reserved according to the situation.
There are two methods: 1. You can use OPERATE_RET tkl_timer_start(TUYA_TIMER_NUM_E timer_id, UINT_T us) to delay us 2. You can also use a while loop or a for loop to customize a delay function DELAY_US(); delay a certain number of times to achieve the effect of delaying us, because the clock frequency of different chip platforms is different, the specific number of delays for 1us needs to be determined by actual testing. The routine is as follows: #define TICK_US 7 //Here you need to set it according to your own chip platform, for example, BK7231N is about 7 times 1us #define DELAY_US(us) \
do { \ volatile UINT_T i = us * TICK_US; \ while (i--); \
} while(0).
fiq interrupt and 32k interrupt may affect us delay. You can try to turn off fiq and 32k interrupt, but not more than 40 seconds, fiq (mainly used for network data transmission), 32k timer interrupt (used for thread scheduling) and shield interrupts of some other peripherals. The watchdog in TuyaOS will feed the dog once every 20 seconds, and it will restart if it is not fed for 3 times. If 32k and timer interrupt are turned off, remote scheduling cannot be performed, and the dog cannot be fed, causing the device to restart. The interrupt function is defined as follows: staticvoid__tdd_bk7231n_32k_enable(BK7231N_REG_T*reg_val) { if (0!=reg_val-val_32k) { *(volatileunsignedlong*) (0x00802A00+0x13*4) |=reg_val-val_32k; reg_val-val_32k=0; } } staticvoid__tdd_bk7231n_32k_disable(BK7231N_REG_T*reg_val) { if (0==reg_val-val_32k) { reg_val-val_32k= (*(volatileunsignedlong*) (0x00802A00+0x13*4)) &0x7; *(volatileunsignedlong*) (0x00802A00+0x13*4) &=0xFFFFFFF8; } } staticvoid__tdd_bk7231n_fiq_enable(void) { *(volatileunsignedlong*) (0x00802000+0x11*4) |=0x00000002; return; } /** * @brief bk7231n fiq disable * * @param[in] none: none * * @return none */ staticvoid__tdd_bk7231n_fiq_disable(void) { *(volatileunsignedlong*) (0x00802000+0x11*4) &=0xFFFFFFFD; return; }.
Taking the CBU module as an example, the module order information confirmation page prompts: Manufacturer model and production data are inconsistent Solution, maintain production data, and select the corresponding model according to the requirements. Generally, the default is to select the module model without a suffix. Select CBU, then click to confirm production data.
The ADC resolution of the CBU is 12 bits, which means the maximum value of the collected data is 4096, and the reference voltage is 2.4V. You can use the interface UINT32_T tkl_adc_ref_voltage_get(TUYA_ADC_NUM_E port_num) to obtain the reference voltage.
This issue occurs because pip is not updated. The solution is to execute the command in the red box as shown in the image. Replace the yellow text with the path to your own VScode compilation python exe folder. For example, input the command in the command line: & C:\Users\tuya\.tuya\venv\Scripts\python.exe -m ensurepip --upgrade.
Mode ID: It is an agreement between the Zigbee sub-device and the Zigbee gateway, used for the gateway to quickly identify the type of Zigbee device joining the network. Refer to this document: Zigbee Connectivity Specifications.
You can use the TIME_Ttal_current_time_get(VOID_T) interface to obtain real-time time. Before synchronizing the network time, the system runtime is obtained. After synchronization, it is a timestamp starting from January 1, 2000, 0:00, in seconds, with a difference of 946656000 seconds from the UTC timestamp. VOID_T tal_time_sync_complete_callback(BOOL_T status, UINT_T time_sec){ if(status && time_sec) { return; } } This is the callback function after the time is obtained.
After the application calls mf_init, using the authorized serial port to perform other functions will not affect the authorization status. During the authorization process, the mf_init interface will not exit until the authorization is complete. Module Testing: https://developer.tuya.com/en/docs/iot-device-dev/TuyaOS-iot_abi_module_factory_test?id=Kd098tbqdlkk4.
Wi-Fi Alliance certification is a certification service provided by the Wi-Fi Alliance to ensure that wireless devices meet specific Wi-Fi technical standards, provide a good user experience, and are compatible with other Wi-Fi Alliance certified devices. The Wi-Fi Alliance is a global non-profit organization composed of hundreds of companies, aiming to promote Wi-Fi technology and ensure product interoperability. The certification program includes a series of tests on WLAN products, involving multiple aspects such as performance, security, and interoperability. Products certified by the Wi-Fi Alliance can ensure that users have a consistent wireless network experience worldwide. The Wi-Fi Alliance offers a variety of certification programs, including but not limited to: Wi-Fi CERTIFIED™: Verifies whether the device meets the basic requirements of the 802.11 wireless standard. Wi-Fi CERTIFIED 6™: Specifically certifies the latest 802.11ax standard. Wi-Fi Protected Access® (WPA): Involves security certification for wireless networks. Wi-Fi CERTIFIED EasyMesh™: Used to test the network coordination performance between multiple routers or access points. Devices certified by the Wi-Fi Alliance can display the Wi-Fi Alliance logo on their products, which signals to consumers that the product has undergone rigorous testing and can work well with other Wi-Fi devices. For manufacturers, this certification helps enhance the product's credibility and competitiveness in the market.
Infocomm Development Authority of Singapore (IDA) is the agency that regulates wireless and telecommunications regulations in Singapore. According to the Telecommunications Act cap.323, certain wireless and telecommunications products must obtain IDA approval before entering the market. This basically includes all wireless communication products. The IDA equipment registration scheme includes the following three types of certification, each type of certification includes the following products. 1. Enhanced Simplified Equipment Registration (ESER), applicable to complex multi-line equipment or short-range/low-power ISM band equipment (for a detailed list, see Appendix B, Table B.1 of the Telecommunications Equipment Registration Guide). This includes PABX, TKS, ISDN equipment, DECT phones, WLAN, BT, RFID, wireless microphones, as well as radio monitoring, remote control, and telemetry equipment. 2. Simplified Equipment Registration (SER): Cellular (2G/3G/GMPCS), mobile terminals, broadband access equipment (ADSL and cable modems). 3. General Equipment Registration (GER) involves any equipment type mentioned in Appendix B, Table B.1 of the Telecommunications Equipment Registration Guide, as well as land mobile radio receiving devices, mobile base stations, UWB and WBA equipment, and short-range devices that mandatorily require an IDA license.
Locate and modify the UART_BAUD_RATE parameter in /software/TuyaOS/vendor/bk7231n/bk7231n_os/beken378/driver/uart/uart.h. The default baud rate is 921600.
Modules using the BK7231N platform can directly use the API functions in TuyaOS for Flash operations. Specific code examples can be found in the os_uf and os_kv examples included with TuyaOS. If you want to encrypt your data for storage, you can use the storage interface wd_common_write of kv. Detailed interface descriptions can be found in the tuya_ws_db.h header file. If you want to store data faster, you can use the storage interface of uf. First, use ufopen to open the file, then use ufwrite to write the file content, and after completing the file operation, use ufclose to close the file. Detailed interface descriptions can be found in the tuya_uf_db.h header file. Note that the content stored in uf may be lost. Note: Wi-Fi&BLE dual-mode modules that support tuyaos support these interfaces.
The maximum voltage that the BK7231N ADC can directly measure is 2.4V. For voltages exceeding 2.4V, a voltage divider circuit can be used.
Supports three methods: production certificate, production certificate authorization only, and authorization code list.
Confirm whether the device Wi-Fi AP mode is effective. Confirm whether the AP name and IP subnet are configured strictly according to tkl_wifi_start_ap provided cfg.
This is because the TuyaOS framework has a rapid power-off fallback restart function. For example, if PWM output is enabled and not turned off for more than 2 minutes, it will trigger a fallback restart to prevent rapid power consumption. If you need to disable the fallback restart logic, you can redefine the function as follows: BOOL_T tal_abnormal_wakeup_callback(VOID_T){ return FALSE; } This is risky and generally not recommended. In this case, the SDK will no longer have a fallback restart for abnormal power consumption. If you do not care about power consumption, you can define the power consumption type as: standard power consumption—(device_role: "router").
Please check one by one if the following issues exist: Check the SSID and password of the router input on the mobile app. Check if the pairing mode and connection mode are set correctly. The recommended pairing mode and connection mode are PARING_MODE_WIFI_AP and TUYA_IPC_LINK_WIFI respectively. Check if all the requiredtkl_wifi.cAPIs are adapted. Verify if tkl_wifi_init(WIFI_EVENT_CB cb) proactively notifies the SDK of the current network status when the network changes.
Set the pairing mode to PARING_MODE_WIFI_AP. Set the connection mode to TUYA_IPC_LINK_WIFI | TUYA_IPC_LINK_WIRE | TUYA_IPC_LINK_BT. Adapt tkl_wifi.ctkl_wired.c, and tkl_bluetooth.h.
Call mqc_set_connection_switch(TRUE)aftertuya_ipc_start_sdk. When the network changes, call tkl_wifi_init(WIFI_EVENT_CB cb) or tkl_wired_set_status_cb(TKL_WIRED_STATUS_CHANGE_CB cb) to notify the SDK of the current network status.
Check if tuya_ipc_init_sdk and tuya_ipc_start_sdk return relevant errors. Check if the pairing mode (TUYA_IPC_PARING_MODE_E) and connection mode (TUYA_IPC_LINK_TYPE_E) align with the product definition. Check the adaptation of tkl_wifi.c or tkl_wired.c. tkl_wifi_init(WIFI_EVENT_CB cb) or tkl_wired_set_status_cb(TKL_WIRED_STATUS_CHANGE_CB cb) notifies the SDK of the current network status when the network changes.
Set the pairing mode to PARING_MODE_WIFI_AP. Set the connection mode to TUYA_IPC_LINK_WIFI | TUYA_IPC_LINK_WIRE. Adapt tkl_wifi.c and tkl_wired.c.
Check if tkl_mutex_create_init supports recursion. If it does not, enable recursion. Review TKL adaptation.
When you compile the demo program, the binary audio and video files will be automatically included in the executable. Seetuyaos-ipc/vendor/x86_64/tuyaos/tuyaos_adapter/include/media/tkl_media_demo_source.h. Check if you have removed the unnecessary media files before encapsulating the TKL API for audio and video. Check if you are using the strippedlibtuyaos.a.strippedinstead oflibtuyaos.
Proprietary firmware development is based on various SDK developments, and each SDK is based on TuyaOS development. TuyaOS includes SDKs, and SDKs include proprietary firmware.
When initializing the audio and video services, you can set the maximum number of connections supported and the amount of memory allocated for audio and video services based on your hardware specifications. It is generally recommended to support 3-5 connections concurrently. If the limits are exceeded, new connections will be forcibly closed. Setting the Maximum Number of Connections: When calling the initialization interface tuya_ipc_media_stream_init, set the parameter MEDIA_STREAM_VAR_T:max_client_num. Setting the Maximum Memory Resources: When calling the initialization interface tuya_ipc_media_adapter_init, set the parameter TUYA_IPC_MEDIA_ADAPTER_VAR_T:available_media_memory. For more details, please refer to:https://developer.tuya.com/en/docs/iot-device-dev/tuyaos-package-ipc-device?id=Kcn1px33iptn2.
It is possible to use tal_pwm_start(0xFF) to output on multiple channels simultaneously. OPERATE_RET v_ret = OPRT_COM_ERROR; tkl_pwm_mapping_to_gpio(TUYA_PWM_NUM_0, TUYA_GPIO_NUM_18); // PC2 tkl_pwm_mapping_to_gpio(TUYA_PWM_NUM_1, TUYA_GPIO_NUM_19); // PC3 TUYA_PWM_BASE_CFG_T v_cfg = { .duty = 300, .frequency = pwm_frequency, .polarity = pwm_polarity, }; tkl_pwm_idle_level_set(TUYA_PWM_NUM_0, 0); tkl_pwm_idle_level_set(TUYA_PWM_NUM_1, 1); v_ret = tal_pwm_init(TUYA_PWM_NUM_0, &v_cfg); v_cfg.polarity = TUYA_PWM_NEGATIVE; v_ret = tal_pwm_init(TUYA_PWM_NUM_1, &v_cfg); tal_pwm_start(0xFF);.
A device that becomes unbound when the internet is disconnected cannot be bound again.Do not calltuya_iot_gw_resetwhen the internet is disconnected. Make sure to check the network status before calling this API. Otherwise, the device is only unbound locally but remains in a bound state in the cloud. In this case, the device cannot be bound by scanning a QR code, but can only be discovered over LAN. Alternatively, you can unbind the device using the app and then bind it again. The recommended logic: The interface for real-time active acquisition of network disconnection judgment: * @brief Get MQTT broker connection status * * @return TRUE on connected, FALSE on disconnected */ BOOL_T get_mqc_conn_stat(VOID);.
To change the SDK type, it is necessary to re-download the SDK agreement. It is recommended to install the Tuya Wind IDE (https://developer.tuya.com/en/docs/iot-device-dev/tuyaos-wind-ide?id=Kbfy6kfuuqqu3), which is available for download there.
Tuyaos networking single product development method DP point requires developers to parse in the SDK, the steps are as follows: 1. Register DP data issue callback function Tuya OS divides DP (Data Point) into object and RAW types, except for RAW type, all will enter the object type callback dev_obj_dp_cb: Notifies the developer of the issuance of obj type DP command. dev_raw_dp_cb: Notifies the developer of the issuance of raw type DP command. Object Type (Object) Boolean: bool Binary variable that is either true or false. For example, the switch function, on/off. Numeric: value Suitable for linearly adjustable data types. For example, temperature adjustment, temperature range 20-40°C. Enumeration: enum Customized finite set of values. For example, work gears, low/middle/high. Fault: bitmap Used for the display of multiple states, generally dedicated to the display and statistics of faults. String: string Function transmitted in the form of a string, generally used for more complex functions, up to 255 bytes. Transparent Type (Raw) Function transmitted in Hex format (hexadecimal), generally used for more complex functions. 2. Process DP data The data structure of the DP point is as follows: typedefstruct { /** dp id */ BYTE_T dpid; /** dp type, see DP_PROP_TP_E */ DP_PROP_TP_E type; /** dp value, see TY_OBJ_DP_VALUE_U */ TY_OBJ_DP_VALUE_U value; /** dp happen time. if 0, mean now */ UINT_T time_stamp; } TY_OBJ_DP_S; The value further divides the data into 5 types, corresponding to value type, enumeration type, string type, boolean type, and bitmap (fault) type. Different combinations of data take the corresponding data type, tuyaos_demo_quickstart has made an example.
CB Series Module Production Test Failure Solutions 1. Download the official firmware burning tool https://developer.tuya.com/en/docs/iot/CB-series-module?id=Kbruyciad6154#title-4-%E4%B8%8B%E8%BD%BD%E5%8E%9F%E5%8E%82%E7%83%A7%E5%BD%95%E5%B7%A5%E5%85%B7 📎 bk_writer_gui_V1.6.3.rar 2. Refer to the attached diagram for settings CB Series Modules, 7231N Development Board: Select BK7231N as the burning target Starting address: 0x001EE000, Operation length: 0x00012000.
If the chip you have chosen is a Bluetooth chip model that has been imported by Tuya, then the documentation provided by Tuya includes a Bootloader example, located at .\software\TuyaOS\vendor\xxxx_ble\sdk\original SDK. If the chip you have chosen is not a Bluetooth chip model that has been imported by Tuya, you will need to port the Tuya Bluetooth SDK yourself and write the Bootloader and firmware OTA related code. The writing of the Bootloader should consider firmware verification to prevent illegal firmware from being written and executed.
For instructions on usage, please refer to Custom Beacon Remote Control.
If you are a developer and your device needs to support 5G routers, please select the WBR1D, WBR2D, WBR3D or WBR1D-IPEX module of the Wi-Fi module W701D chip. If you are a consumer, please check the manual or contact the merchant to check whether 5G is supported. If it supports 5G but cannot be connected to the network, it is recommended that you contact the merchant for after-sales support to further troubleshoot the problem.
You can use tkl_pwm_idle_level_set() to configure the level. OPERATE_RET v_ret = OPRT_COM_ERROR; tkl_pwm_mapping_to_gpio(TUYA_PWM_NUM_0, TUYA_GPIO_NUM_18); // PC2 tkl_pwm_mapping_to_gpio(TUYA_PWM_NUM_1, TUYA_GPIO_NUM_19); // PC3 TUYA_PWM_BASE_CFG_T v_cfg = { .duty = 300, .frequency = pwm_frequency, .polarity = pwm_polarity, }; tkl_pwm_idle_level_set(TUYA_PWM_NUM_0, 0); tkl_pwm_idle_level_set(TUYA_PWM_NUM_1, 1); v_ret = tal_pwm_init(TUYA_PWM_NUM_0, &v_cfg); v_cfg.polarity = TUYA_PWM_NEGATIVE; v_ret = tal_pwm_init(TUYA_PWM_NUM_1, &v_cfg); tal_pwm_start(0xFF);.
Issue Cause:When the IDE builds the project, the compilation script copies templates from \TuyaOS\tools\templates and scans the source files in the application folder to rebuild the IAR project. If the IAR project is already open at this time, an error will be reported. Solution:Close the corresponding IAR project and rebuild.
When debugging with IAR, the PC pointer address always stays at all FF. Problem cause: Zigbee devices developed based on the Tuya SDK must support OTA upgrades, and this situation is most likely due to the absence of a bootloader being burned. Solution: After the IDE build, the following target files will be generated in the directoryTuyaOS\apps\tuyaos_demo_xx\output: tuyaos_demo_xx_DIFF[version].bin: The upgrade file for differential OTA. tuyaos_demo_xx_QIO[version].bin: The complete target file that includes the bootloader. tuyaos_demo_xx_UG_[version].bin: The OTA upgrade firmware package file. After burning the QIO file or the bootloader file separately, normal debugging can be resumed. The bootloader files are located in the directoryTuyaOS\tools\bootloader, and it is necessary to distinguish the target platform. The burning software is located in the directoryTuyaOS\tools\commander, and the burning method can refer to the relevant guidance documents in thedocsdirectory of the development framework.
Check if the service is effectively registered, you can connect to the device through nrf-connect and confirm the service, it is necessary to confirm the existence of service, characteristic value, and descriptor CCCD. Analyze whether the host has performed effective first packet transmission through packet capture. Check for any behavior that blocks the device from normal Notify operation, a common method is to confirm through logs at the Notify interface. If packet capture confirms there is no Notify data, it is necessary to confirm whether there is a CCCD enabled method controlling the Notify data.
Collect as much log information as possible for all compatible interfaces. If hardware conditions permit, capture air packets with Ellisys and provide matching process log information. Provide log information uploaded by the App side.
CBU module IO port corresponding silkscreen photo reference see attached figure.
This topic describes the common issues with Matter over Thread development and solutions to them. Module resources and usage Timer: The module does not have a hardware timer. You can create software timers using the same method as with FreeRTOS. RAM: 192 KB. Flash: 1.5 MB. Approximately 50 KB is available for application development. Device pairing Before pairing a device over Bluetooth, the system Bluetooth must be turned on. A device remains in pairing mode for a specified time period. To pair a device again after a failure, it is recommended to restart the device and then activate the pairing mode. Online and offline The gateway regularly sends heartbeat packets to mains-powered devices. If a device fails to respond to the heartbeat check multiple times consecutively, it will be shown as offline on the mobile app. Manufacturers have their specific implementations of heartbeat policies. Therefore, the heartbeat interval and the number of retries before declaring a device offline vary by manufacturer. For mains-power devices, the offline time typically ranges from a few seconds to several minutes. For low power devices, their offline status is determined by the occurrence of proactive data reporting. If the gateway does not receive a data reporting message from a device within the specified period consecutively, it will declare it offline. The offline time for a low power device typically ranges from tens of minutes to several hours. For example, the offline time specified for Tuya-enabled devices is 12 hours. Network capacity The test results indicate that a stable Thread network can support up to 64 connected devices. Module consumption in low power Test item Average measurement Static power consumption in sleep mode(not connected) 3.28 μA Static power consumption in sleep mode(connected) 3.16 μA Power consumption in network scan 2.36 mA (quick scan), 1.02 mA (slow scan) Data reporting peak 30.95 mA Power consumption for a poll request - Power consumption for dat.
Currently, only static libraries are available. The code is compiled with the -fPIC option, allowing you to generate a dynamic library from the static one. The command below packages all static libraries into a single dynamic library. gcc -shared -o libtuyaos.so -L./libs -Wl,--whole-archive -lty_iot_sdk -lty_module_gw_base -lty_module_gw_app -lty_module_zigbee -ltuyaos_adapter -Wl,--no-whole-archive.
tuya_iot_gw_unactive: Only unbinds a device while retaining its data. When the device is reactivated, it returns to the same state as before being unbound. tuya_iot_gw_reset: Unbinds a device and clears all of its data.
The definition and examples of the TuyaOS Kernel Layer (TKL) APIs are included in the development environment. They are downloaded to the local device during the initial compilation. The error message indicates that the TKL API file is missing. This could be because your compilation environment has no internet access to download the file or does not have a compression utility to unzip it. You can verify this by checking if the development environment content in the vendor directory is empty.
The standard development kit supports bothwired and wireless connectionsby default.tuya_iot_wr_wf_sdk_initshould be called for initialization. Do not calltuya_iot_wf_sdk_initandtuya_iot_sdk_initunless you are using a custom development kit.
The EN and RST of the module are both reset pins, Pulling down EN or RST can reset it.
No. The LED strip light uses a serial peripheral interface (SPI), which is provided by a CBU module.
Make sure that Python is installed. For more information, see https://developer.tuya.com/en/docs/iot-device-dev/tuyaos-wind-ide?id=Kbfy6kfuuqqu3#title-4-%E5%AE%89%E8%A3%85%20IDE.
For more information about the gateway development in TuyaOS development mode, see https://www.tuyaos.com/viewtopic.php?t=95.
Tuya Wind IDE is a one-stop integrated development environment provided for TuyaOS EasyGo developers. Tuya Wind IDE is provided as an extension of Visual Studio Code (VS Code) and is available in both Chinese and English. You can log in to this IDE with the account of the Development Platform. Tuya Wind IDE manages, distributes, and updates the TuyaOS EasyGo development kits, enabling a consistent development experience across hosts and programming tools. For more information, visit TuyaOS Development Framework and Tuya Wind IDE.
The current sweeping robot products, for MCU docking solution, choose dual-band module, support 5g Wi-Fi (also supports 2.4g Wi-Fi). It is recommended to use the WBR3D module.
They are different, wireless communication can be understood as the use of wireless transmission for information transmission. Wireless communication includes many different methods, such as GSM, WLAN, walkie-talkie, satellite TV, Bluetooth, infrared, radio, etc. GPRS is the abbreviation of General Packet Radio Service, which is just a mobile data service available to GSM mobile users.
No. Switch DPs interact through opcode in Generic OnOff Model, and custom DPs interact through opcode in Tuya Vendor Model. For more information, see the development document in the SDK.
You need to select "Bluetooth Firmware" for the firmware type.
Currently not supported.
Using a complete module with FCC certification, the finished product can reference the module's FCC ID. Using a restrictive module (without a shielding case, external antenna, etc.), the finished product cannot reference it and requires full testing. The FCC ID is composed of a "Grantee Code" and a "Product Code." The Tuya code is 2ANDL, and the general format for Tuya FCC ID is 2ANDL-X (X is the module model). For example, if the product uses the CBU module, the finished product references as follows: When purchasing the module, select the US label, and the final product should have a label or manual in a visible area stating: Contains Transmitter Module FCC ID: 2ANDL-CBU; the module by default does not perform the EMC (Part B) section, and the finished product needs to be tested.
CBU module supports Wi-Fi and Bluetooth, so both Wi-Fi and Bluetooth need to be filled in the specification sheet. The following parameters for Wi-Fi and Bluetooth are the same: Module temperature: -40℃ - 105℃; (generally filled according to the whole machine temperature) Module voltage: 3V-3.6V, normal voltage 3.3V Hardware version: silk screen on the back of the module. For example, 101, i.e., V1.0.1; or silk screen on the finished motherboard Software version: firmware version; or check device information through the APP on the finished product, where the software version number is available Antenna type:PCB Antenna gain:2.2dBi Antenna configuration (port):1TX 1RX;SISO; single transmit single receive (generally one of three expressions) Maximum operating frequency excluding RF: 26MHz (module crystal oscillator); (mentioned by some organizations) The following are different RF parameters for Wi-Fi and Bluetooth: Wi-Fi: (frequency 2400-2483.5MHz, 2.4G, so the 5G part of the Wi-Fi table does not need to be filled) 1. Frequency: Europe, China, Korea, Brazil, etc. certification: 2412-2472MHz; USA, Canada, Taiwan: 2412-2462MHz; Japan: 2412-2472MHz, 2484MHz; 2. Channel: Europe, China, Korea, Brazil, etc. certification: 1-13; USA, Canada, Taiwan: 1-11; Japan: 1-14; 3. Mode (modulation technology):802.11b, 802.11g, 802.11n (HT20) or 802.11n20 4. Modulation type: DSSS(CCK,DQPSK,DBPSK); OFDM(64QAM, 16QAM, QPSK, BPSK) 5. Rate: b: 1/2/5.5/11 (Mbps); g: 6/9/12/18/24/36/48/54 (Mbps); n: MCS0-MCS7 6. Occupied bandwidth: 20MHz 7. Channel spacing: 5MHz 8.Power: 11b: 16dBm; 11g: 15dBm; 11n: 14dBm (excluding gain) 9. Adaptive: supported 10. TPC, DFS: not supported, no need to fill in the table Bluetooth: 1. Frequency: 2402-2480MHz; 2. Channel: 0-39; 40 channels; 3.Bluetooth version: 5.2, only supports BLE; 4.Rate: 1Mbps 5.Modulation type: GFSK 6. Occupied bandwidth: 2MHz 7. Channel spacing: 2MHz 8.Power: 6dBm (excluding gain).
Cloud licenses are security encryption certificates that Tuya issues to devices. They are credentials for smart devices to connect to Tuya IoT Cloud. Each device shall have a unique cloud license. The TuyaOS cloud license is flashed into the network module manufactured by Tuya. You do not need to purchase additional licenses. If you need to flash authorized information on your own, you may purchase the "hardware+TuyaOS license" service plan or purchase a generic license.
When the device is connected to the network, call tuya_iot_gw_reset to reset the device. Then, call __gw_reset_cb to clear Tuya data and restart the device. The overall process is as follows: Tap Restore Factory Settings. Determine the network status. Call tuya_iot_gw_reset. Call __gw_reset_cb to delete data. Restart the device. The device is unbound.
64-bits Linux environment. Wi-Fi Please refer to the documentation: https://developer.tuya.com/en/docs/iot-device-dev/TuyaOS-course?id=Kbxa3zfh6ovn8.
Currently, only flash write protection is supported, not flash read protection.The bk7231n firmware is encrypted,For the device authorization activation part, we also have a mechanism to prevent single activation on our cloud end.
TuyaOS is a distributed platform-agnostic operating system that is designed based on kernels such as real-time operating system (RTOS), Linux, and Non-OS. TuyaOS applies to the IoT field and is oriented for all connections and scenarios. With TuyaOS Kernel and various TuyaOS development components, developers are able to stay fully focused on business innovation and development without worrying chip platforms, systems, connection protocols, and applications. Once a product is developed, it can be deployed on multiple types of devices across the world and meet security compliance requirements. TuyaOS is layered and uses pluggable components. Developers can build a custom development framework as needed based on the chip resources and application scenarios. Tuya's unique Things Data Model (TDM) and proprietary soft bus allow all products developed with TuyaOS to communicate with each other, regardless of their communication protocols. For more information about TuyaOS, see TuyaOS Development Documents. To download the TuyaOS development framework, you need to install Tuya Wind IDE .
As one of the most frequently-used solutions to connect to the Tuya Platform, the module SDK solution applies to building smart products that use modules as the master control. Tuya provides hardware modules, apps, and cloud services. You only need to focus on product function R&D and develop smart products efficiently and quickly with Tuya TuyaOS SDK, all-in-one apps, and panels. Please click to view related instruction manuals.
Three authorization methods are available: License list: In the development and debugging phase, this method can be used. You need to purchase the following device information: product key, device name, and device secret, enter it into the code, and compile and flash the firmware. Credential: After you develop the firmware and upload it to Tuya IoT Platform, purchase a credential and then use the network module in the production solution for authorization. Credential (authorization only): After you create the firmware key on Tuya IoT Platform, purchase the credential (authorization only) and then use independent authorization in the production solution for authorization.
Each switch channel corresponds to an element. You can identify the working channel based on the element address.
The steps of the PC side are as follows: Click the network icon in the bottom right corner on the system desktop. Click [Network and Internet settings] in the pop-up box. Click WLAN on the left handside. Click [Hardware Properties] under [WLAN]. Then you will see the information of network band. The steps for viewing on the mobile side are as follows: Android: Different brands of Android phones are different. Take Huawei mobile phone as an example. You can click on the connected Wi-Fi name in the Wi-Fi list, and the corresponding information will be displayed, including the frequency. iOS: Download AirPort tool in the App Store Turn on the Wi-Fi Scanner in "Settings - Airport Tools" Open the App and click on “Wi-Fi Scan” in the upper right corner. Channel 1-13 band is 2.4G, and larger than 13 is 5G. Note: How to configure separate Wi-Fi SSIDs for 2.4 GHz and 5 GHz bands?
Dear user, we are sorry for your inconvenience. When your Apple system is upgraded to iOS 13, the following issues will occur: Issue 1: WLAN or Wi-Fi is specified automatically or the Wi-Fi name is left blank Solution to issue 1: Step1:Tap Settings, and tap Privacy, then open Location Services. Step 2:Tap Settings, locate and tap the App, tap Location, and select While Using the App, as shown in the following figures. The App can then obtain the correct Wi-Fi name. Issue 2:After the user has upgraded to iOS 13, the Wi-Fi name still cannot be obtained in App according to the previous instruction. Solution to Issue 2 : Turn device off, then turn it on. The App can then obtain the Wi-Fi name. Issue 3: The following issues may occur when you use a Bluetooth product: "Enable Bluetooth" is displayed during device pairing. After the operating system is upgraded to iOS 13, the Bluetooth device goes offline and become unavailable. Solution to issue 3: Step 1: Enable Bluetooth. Step 2: Tap Settings, locate and tap the App, and enable Bluetooth. You can then use the Bluetooth device.
Dear user, we are sorry for your inconvenience. Widget status is consistent with App but uncontrollable and without state change.
The Tuya Link device cannot enable voice plans.
EasyGo is a collective term for TuyaOS-based development kits. It is oriented for all developers and helps them quickly develop IoT products. TuyaOS EasyGo consists of the development framework (the type development kit and development platform) and product development kit. Development framework: consists of the type development kit and development platform. Type development kit: comprises the SDK for the development of networking products, cellular products, gateways, control products, IPCs, NVRs, and sub-devices. It can be used to develop various types of products. Examples: development framework 1 (RTL8197-based gateway development kit) and development framework 2 (PHY6252-based Bluetooth Beacon development kit) Product development kit: contains vertical-specific low-code development kits built on top of development frameworks, helping developers quickly develop products for a specific niche. Examples: electrical product development kit, lighting product development kit, and sensor product development kit. Developers can view and obtain the product development kit after a project of the corresponding development framework is created.
No, we use FreeRTOS.
Call this interface tuya_IoT_dev_upgd_progress_rept at the application layer to control the progress report of the upgrade. Each time the App receives a progress update, and the timeout period will start to time again, and then the entire timeout period will be prolonged (Note: Before calling this, use the tuya_IoT_upgrade_gw_notify interface first to close the report the upgrade progress of the tuya_SDK ).
TuyaOS: Tuya modules are used for product access development. For more information, visit https://developer.tuya.com/en/docs/iot/configure-in-platforms?id=Ka5k7v9absls7. TuyaLink: Tuya modules are not used for device access development. For more information, visit https://developer.tuya.com/en/docs/iot/device-connection?id=Kb46bqq71kwtd.
Dear user, we are sorry for your inconvenience. The App widget status alignment is usually within 1s, without the longest timeout limit in WLAN with internet connectivity.
Use Tuya Wind IDE to get the TuyaOS OS development package: https://developer.tuya.com/en/docs/iot-device-dev/Gateway-Product-Software-Development-Kit?id=Kbfjuqtma64w4.
Please check whether the firmware type and the channel number reported by the device are correct and consistent when creating the firmware. MCU SDK Solution The default channel number for MCU firmware is 9, and it does not need to be modified when replying to product information; if there is extended firmware, the MCU needs to reply with the channel number corresponding to the extended firmware when replying to product information, and create the firmware key for the corresponding channel when creating the firmware on the developer platform. TuyaOS Solution When creating firmware for the Wi-Fi protocol, the firmware type should be selected as "Module Firmware". For BLE protocol and Mesh protocol, the firmware type should be selected as "Bluetooth Firmware". For Zigbee protocol, the firmware type should be selected as "Zigbee Firmware". If there is extended firmware, the firmware type should be selected as "Extended Firmware", and the channel number starts from 10.
You can directly use the interface for reading voltage, which has been calibrated, as shown in the figure:.
TuyaOS applies to developers with software and hardware development capabilities.
You can use the tuya_os_adapt_wifi_station_get_conn_ap_rssi API. You can first set a variable, pass the address of the variable to the API, and then read the variable value after calling the function, as shown in the following figure.
The 3-tuple indicates the license used during TuyaOS development of Bluetooth LE products. In the development and debugging phase, you can apply for two free licenses on the hardware configuration page for product development on the Tuya IoT Platform. During application, select License list.
The TuyaOS solution aims to implement development without an MCU but with a module only. Since no external MCU needs to be connected, the TuyaOS solution does not provide a serial port protocol. If you still need to connect to an external MCU, the communication logic between the module and the MCU can be developed based on your requirements and all peripheral drivers of the module are released.
Dear user, we are sorry for your inconvenience. Echo Show can connect to a wireless network automatically. Ensure that your mobile phone and Echo Show are connected to the same WLAN. Log in to your Amazon account on Echo Show and the Amazon Alexa App. Then, Echo Show will be displayed in Amazon Alexa App automatically.
The extension SDK is no longer updated, please switch to the comprehensive SDK,please refer to the guide: https://developer.tuya.com/en/docs/iot-device-dev/tuyaos-package-gateway-gateway?id=Kbfxt2gt14pog.
The wireless gateway does not support this feature, currently, except for RTOS gateways (like wireless Zigbee gateways), Linux gateways (wired Zigbee gateways, dual Zigbee gateways, etc.) have all supported this feature, the App requires version 3.20 and above.
It varies based on the gateway. In general, a Linux gateway can connect to up to 200 sub-devices (up to 400 for a multi-mode gateway), and a FreeRTOS gateway can connect to up to 50/128 sub-devices.
The maximum input level of the ADC port is 3.25V. It is recommended to use MΩ level external voltage divider resistors, and place a 100nF capacitor to ground near the ADC port for filtering.
The GPIO port of CBU is initialized to output low voltage by default on power up.
The official version of TuyaOS that is released to the public consists of three parts: the major version, the minor version, and the revision. For example, 3.5.0, where the major version is 3, the minor version is 5, the revision is 0. Major version: Updated when architectural upgrades are made. Minor version: Updated when new features are added, or existing features are changed. Revision: Updated when bugs are fixed.
Yes . But the networking SDK is no longer updated, please switch to the integrated SDK, please refer to the documentation link:https://developer.tuya.com/en/docs/iot-device-dev/tuyaos-package-gateway-gateway?id=Kbfxt2gt14pog.
According to FCC PART 15.212, a single module transmitter must meet the following requirements: 1. The module must have a shielding case, with physical crystals and adjustable capacitors allowed to be located outside the shielding case. 2. The module needs to have a buffer circuit to ensure that the module meets the requirements of PART 15 in cases of excessive data flow and modulation. 3. The module has its own power supply regulation. 4. The module antenna must be a fixed antenna or a unique connection line as an antenna. 5. The module must be independently configured during testing, i.e., during testing in compliance with Part 15 requirements, the module must not be inside another device. Non-battery powered must comply with the conduction requirements in Section 15.207. The power and data lines connected to the module must not contain ferrite unless they are sold with the module. The line length should be the actual usage length, if unknown, at least 10 cm to ensure no coupling between the module housing and the supporting equipment. Any equipment connected to the module during testing must not be modified and must be available for purchase on the market. 6. The module must be equipped with a permanently affixed label or be able to electronically display the FCC ID. 7. The manufacturer must provide sufficient information to demonstrate that the complete module meets the relevant standard requirements. Include this information when applying for equipment. 8. The module must meet the relevant RF exposure requirements in its final configuration. A single module that does not meet all the above requirements (such as shielding, buffer circuits, power regulation) but meets the applicable PART 15 requirements may be granted a limited module. In summary: Generally, Tuya modules with shielding cases and using onboard antennas are complete single modules, such as CBU, WBR3, etc.; Modules without shielding cases, such as CBLC5, CBLC9, etc., are limited modules. Modules usi.
Complete Definition of Radio Transmitter Module for Non-Independent Operation A radio transmitter module for non-independent operation that meets the following conditions is called a "complete radio transmitter module for non-independent operation." 1. The module should have a data buffering/modulation unit. 2. The module's RF unit should have complete shielding. 3. The module should use an integrated antenna. 4. The module should have clear power supply requirements. 5. The module complies with other relevant national laws and regulations. Definition of Restrictive Radio Transmitter Module for Non-Independent Operation A radio transmitter module for non-independent operation that does not meet any of the items 1 to 4 above is called a "restrictive radio transmitter module for non-independent operation." In summary: Generally, modules with shielding and using onboard antennas, such as CBU, WBR3, are complete modules; those without shielding, such as CBLC5, CBLC9, are restrictive modules; those using external antennas, such as CBU-IPEX, WBR1-IPEX, are restrictive modules.
In the RED Directive 2014/53/EU(https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:32014L0053), Article 10, Point 8 The following information shall also be included in the case of radio equipment intentionally emitting radio waves: (a)frequency band(s) in which the radio equipment operates; (b)maximum radio-frequency power transmitted in the frequency band(s) in which the radio equipment operates. Example: WBR3 Frequency band (Operation frequency or Frequency range) : 2400-2483.5MHz (or 2.4-2.4835GHz) Maximum transmission power (Maximum radio transmission power or Max. transmission power) :18.2dBm Query these two parameters in the WBR3 RED RF report: Frequency band: Maximum transmission power:According to the maximum EIRP data in the test report Note: 1. If the CE certification for the end product references the module data, then the maximum value is the same as the module; if the end product undergoes complete certification, the maximum EIRP value should be based on the end product report. 2. In Wi-Fi & Bluetooth modules, the Bluetooth power is less than the Wi-Fi power, so directly look for the maximum value from the Wi-Fi power tests. 3. If the power requirement is in units of W, you can use a power conversion tool.
No. However, the TuyaLink license is required, which contains the username and password required for device connection.
All services that are developed in an embedded manner will be migrated to TuyaOS.
A new version is released every 6 weeks. Please follow the "TuyaOS Release" public account to get the latest release information.
Please call this function: OPERATE_RET tuya_iot_wf_gw_unactive(VOID).
Dear user, we are sorry for your inconvenience. One device can only be configured for one network in the same time. You cannot realize it now. Thanks for your support and understanding.
You can go to the product development interface (https://platform.tuya.com/pmg/list), click on the product name to pop up the Product Overview page. Click to download Module attestation materials, which includes the antenna gain report (antenna specification, antenna report). Module attestation materials include: Example: WBR3.
CB series modules can refer to: 1. First verify whether the radiation module purchased from the platform can be normally fixed frequency. If CSN needs to be connected to GND to fix frequency, then connect CSN to module GND. 2. First remove the bulk module from the complete machine PCBA. 3. Then stick high-temperature adhesive tape on the corresponding TX1, RX1, VCC, GND pins of the PCBA to prevent the power supply control of the complete machine from causing the module to fail to fix frequency. 4. Solder the fixed frequency radiation module to the PCBA. 5. Lead out the DuPont lines from the module's TX1, RX1, VCC, GND pins and label them to avoid incorrect pin connection to the serial port board after assembling the complete machine. 6. Connect the DuPont lines led out from TX1, RX1, VCC, GND to the serial port board, open the fixed frequency software for verification. 7. After verifying no abnormalities, fix with glue and assemble the complete machine. Drill holes in the complete machine to lead the DuPont lines out to connect to the serial port board outside the machine, and verify again. If there are no issues, the sample can be sent.
Check whether the used SDK and QR code network pairing mode are correct. Check whether DB files are deleted during network repairing. tuya_enckey.db, tuya_user.db, and tuya_user.db_bak need to be deleted. both file not exist In the first network pairing, no DB file is created during SDK initialization. bak file eixst BUT normal file not exist Not all DB files are deleted. both file exist DB files exist. Network pairing is not performed. 3. Check whether the parsed QR code SSID and password are correct and whether they are transferred to tuya_ipc_direct_connect() of the SDK. For more information, see the demo code. 4. Check whether the NIC name is correctly set. It must be set to the NIC name of the device. #define WLAN_DEV "XXX" 5. Check whether the tuya_adapter_wifi_station_get_status interface is implemented based on the actual Wi-Fi link status. The status code must be returned based on the actual situation. The SDK will frequently call the tuya_adapter_wifi_station_get_status interface. If WSS_GOT_IP is returned, the tuya_adapter_wifi_station_connect interface will not be called to establish the network connection. 6. In other cases, collect complete device logs for analysis.
We build white-label Tuya apps, IoT dashboards, and custom integrations for your business.
🚀 Schedule a Call