CI230X TUYA IoT Scheme Introduction¶
1. Scheme introduction¶
1.1 Function Overview¶
CI2305 chip specially customized by Chipintelli for offline+IoT scheme. This chip has the characteristics of high performance, high scalability and low cost. It integrates offline ASR+WIFI+Bluetooth BLE function. Users can use this chip to quickly develop offline+IoT scheme; Combined with the advantages of fast offline speech recognition and high recognition rate, and combined with the online control function of cloud and mobile phone APP (applet), it brings users a new end cloud integration product experience. The solution SDK uses the ci230x released by Chipintelli_ audio_ IoT_ sdk_ Release and ci230x_ wifi_ combo_ sdk_ Release. Next, we will introduce the solution based on CI2305 chip+TUYA IoT cloud.
1.2 Scheme block diagram¶
1.3 Offline+IoT scheme has the following functions and features¶
- The device supports the local recognition function and local control function. After the local recognition command, the device can be controlled to broadcast voice and upload the command to the cloud to synchronize the device status.
- The device supports the cloud remote control function, remotely queries the device status, and upgrades the OTA of the device online; At the same time, the device side can also receive other cloud customized functions, such as alarm clock, timing control, etc. The device side supports online access to the cloud infrared code library, and the cloud’s rich infrared code library supports most of the infrared devices on the market (such as air conditioners, washing machines, fans, etc.).
- The device settings support Bluetooth BLE distribution network.
- The device supports TUYA APP for control, and the device can synchronize status with cloud and applet in real time.
1.4 Offline+TUYA IoT infrared remote control scheme¶
This scheme is an offline+IoT scheme of infrared remote controller (users can also apply it to other products, such as infrared light control and fan, as required). The scheme integrates single MIC/dual MIC+AEC echo cancellation algorithm, blind source separation algorithm, dereverb de reverberation algorithm, beamforming algorithm, Denoise algorithm. The algorithm can be configured and customized according to needs, and has good noise resistance, The local basic command words provided in the demo are as follows (you can customize 100+command words):
2. Rapid development of offline+TUYA IoT scheme¶
2.1 Operation related to TUYA IoT cloud platform¶
-
Sign in to TUYA intelligent global intelligent platform¶
Log in TUYA intelligent global intelligent platform, click Register Now in the lower left corner to register a developer account of the TUYA cloud open platform.
-
Create products according to requirements. The TUYA platform supports a wide range of product types. The following is an example of creating sockets¶
-
Define DP points. The TUYA platform manages device functions through dp. It can use the standard functions supported by the platform and also support user-defined functions¶
-
Description of TUYA IoT related project development:¶
TUYA platform access needs the support of TUYA business and FAE. If you need to develop TUYA projects, please contact Chipintelli Business to coordinate relevant resources, and TUYA development access documents “TUYA intelligent global intelligent platform.
2.2 Enable TUYA IoT cloud¶
Compilation configuration: enable TUYA cloud: project ci230x wifi sdk combo CMakeLists.txt
Set (CIAS_IoT_CLOUD_HUAWEI 0) # Huawei Cloud Enable
Set (CIAS_IoT_CLOUD_XIAOMI_ENABLE 0) # Xiaomi Cloud Enable
Set (CIAS_IoT_CLOUD_CI_ENABLE 0) # Enable Chipintelli Cloud
Set (CIAS_IoT_TENCENT_ENABLE 0) # Tencent IoT Cloud Enable
Set (CIAS_IoT_TVS_ENABLE 0) # Tencent TVS enable
Set (CIAS_IoT_TUYA_ENABLE 1) # TUYA Cloud Enable
Set (CIAS_IoT_CLOUD_ALI_ENABLE 0) # Alibaba Cloud Enable
2.3 Call the entry function of the TUYA IoT cloud¶
project\ci230x-wifi-sdk-combo\app\usr_ TUYA\main.c
//Creat usr app task.
if( creat_usr_app_task() != CIAS_ OK)
{
LOG(LOG_LVL_ERROR, "creat_usr_app_task call error\r\n");
return CIAS_ FAIL;
}
2.4 Modifying Authentication Files and Product IDs¶
project\ci230x-wifi-sdk-combo\app\cias_ aIoT_ wifi\cias_ cloud\cloud_ TUYA\apps\include\TUYA_ device_ auth.h
#define PRODUCT_ ID "k8j4zo1061upmkbl"
#define PROD_ UUID "TUYA544a3243ca246fa3"
#define PROD_ AUTH_ KEY "AQo131PftCynG1uRTLTVpJXEpu4z9AX0"
3. API Description of Main Functions¶
3.1 TUYA application entry file TUYA_ Main. c, key interface function call process¶
- main()->user_ main()->pre_ app_ init()->TUYA_ IoT_ init()->app_ init()->pre_ deivce_ init()->device_ init()
3.2 Description of core interface¶
-
pre_ app_ Init() - used for the initial pre preparation of the system. At this time, the TUYA Device OS has not been started¶
-
app_ init() - used for application initialization. At this time, the TUYA Device OS has been initialized¶
-
pre_ device_ Init () - Prepare for device function startup. At this time, the device function has not been started¶
-
device_ Init () - The device function is started. After that, the device enters the normal working state. The device authentication connection to the cloud is in this function.¶
4. Use of TUYA infrared remote control demo¶
4.1 Use Chipintelli IoT development board (note: jumper cap is short circuited according to the figure)¶
4.2 Equipment distribution network and infrared code library downloading¶
The distribution network of this scheme adopts TUYA intelligent APP Bluetooth for distribution network. First, add equipment. Wake up the equipment (intelligent butler) and call “start distribution network” to make the equipment enter the distribution network state. Later, add infrared remote control equipment and download the corresponding code library. Please refer to ☞Instructions for TUYA infrared remote control
4.3 Online control equipment of TUYA APP¶
After the successful addition of the infrared remote control device to the TUYA APP, there is a dedicated control panel, and the status of offline voice control and online APP control devices can be quickly synchronized. The air conditioning control panel is shown in the following figure
4.4 Local voice offline control equipment¶
The offline local recognition of this scheme is based on the third generation voice chip of Chipintelli, and the local basic command words provided are as follows (users can customize 200+command words)
Wake up Words | Smart Housekeeper | ||||
---|---|---|---|---|---|
Distribution network command | Start distribution network | I want distribution network | Close distribution network | ||
Command word | Turn on the air conditioner | Turn on the air conditioner | Turn off the air conditioner | Turn off the air conditioner | High speed air |
High speed air | medium speed air | medium speed air | low speed air | low speed air | automatic air |
Automatic wind speed | 16 degrees | 17 degrees | 18 degrees | 19 degrees | 20 degrees |
Twenty one | Twenty two | Twenty three | Twenty four | Twenty five | Twenty six |
Twenty seven degrees | Twenty eight degrees | Twenty nine degrees | Thirty degrees | Turn on cooling mode | Cooling mode |
Open heating mode | Heating mode | Open heating mode | Heating mode | Open air supply mode | Air supply mode |
Turn on dehumidification mode | Dehumidification mode | Turn on automatic mode | Automatic mode | Raise temperature | Lower temperature |
Increase wind speed | Increase wind speed | Decrease wind speed | Reduce wind speed | Timed 30 minutes | Timed one hour |
Timed two hours | Timed two hours | Timed three hours | Timed four hours | Timed five hours | Timed six hours |
Timed seven hours | Timed eight hours | Timed nine hours | Timed ten hours | Timed eleven hours | Timed twelve hours |