Introduction to Chipintelli offline+Tencent IOT scheme¶
1. Scheme introduction¶
1.1 Function Overview¶
CI2305 chip specially customized by Chipintelli for offline+IOT scheme integrates offline ASR+WIFI+Bluetooth BLE function, and 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 IOT scheme based on CI2305 chip+Tencent IOT Cloud.
1.2 Scheme block diagram¶
1.3 Offline+IOT scheme has the following functions and features¶
-
It has local recognition function and local control function, and can control peripherals, broadcast voice and upload instructions after local recognition command.
-
With the cloud remote control function, the cloud can issue instructions to remotely control the equipment, remotely query the equipment status, and perform OTA on the equipment online; At the same time, the device can also receive other cloud customized functions, such as alarm clock and music playing.
-
The device supports Bluetooth BLE network and AP network.
-
The device supports Tencent to connect applets for control. At the same time, the device can synchronize status with cloud and applet in real time.¶
Cloud control and local voice control are summarized as follows:
2. Rapid development of IOT scheme¶
2.1 Operations related to Tencent IOT cloud platform¶
- Sign in to Tencent Cloud Open Platform
Log in Tencent Cloud Open PlatformClick Register Now in the lower left corner to register a developer account of Tencent Cloud Open Platform.
1 |
|
-
Project, Product and Equipment Creation Description¶
- On Tencent Cloud homepage, follow the steps shown below to enter the Internet of Things Development Platform.
- Enter the product console
- Use public instances during development and debugging
- Create a new project or select an existing project for development
- Create a new product. Select the project to enter the development and service center of the project. “Product Development” can create the product and configure the device definition model, topic message, applet panel configuration, distribution network guidance, product introduction, and equipment debugging under the product. Batch production needs to wait for approval. Firmware upgrade can be used for OTA of product equipment under this project.
-
Detailed descriptions of the Internet of Things development platform can be viewed in the Tencent Cloud Document Center¶
2.2 CI230X SDK Access Tencent IOT Code Framework Description¶
2.3 Tencent IOT Cloud Access Process¶
2.4 Enable Tencent IOT¶
Compilation configuration: Enable Tencent IOT 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 1) # Tencent IOT Cloud Enable
Set (CIAS_IOT_TVS_ENABLE 0) # Tencent TVS enable
Set (CIAS_IOT_TUYA_ENABLE 0) # TUYA Cloud Enable
Set (CIAS_IOT_CLOUD_ALI_ENABLE 0) # Alibaba Cloud Enable
2.5 Call Tencent IOT entry function¶
project\ci230x-wifi-sdk-combo\app\usr_ ln\usr_ app.c
......
#if CIAS_ IOT_ TENCENT_ ENABLE
if( cias_qcloud_iot_main() != CIAS_ OK)
{
LOG(LOG_LVL_ERROR, "cias_qcloud_iot_main call error\r\n");
return CIAS_ FAIL;
}
#endif
......
2.6 Modify authentication file (triplet)¶
#define QCLOUD_ IOT_ PRODUCT_ ID "ZDFXXXXX" //
#define QCLOUD_ IOT_ DEV_ NAME "D0XX"
#define QCLOUD_ IOT_ DEV_ SECRET "M72NXXXXXXXXXXXXXXX"
The triplet can be obtained by contacting our fae. Each product must be allocated with different triplet information, otherwise the products of the same triplet will be out of service due to competition.
3. API Description of Main Functions¶
3.1 Tencent IOT physical model initialization, which is matched with the cloud physical model¶
/**_ init_ data_ Template Object Model Initialization
*Inlet parameter: None
*Return value: None
*/
void _ init_ data_ template(void)
3.2 Analyze the data sent from the cloud¶
/** deal_ down_ Stream: Cloud downlink data processing
*/
int deal_ down_ stream(void)
3.3 Upload local data¶
/** deal_ up_ Stream packs and uploads local data
*/
int deal_ up_ stream(void)
3.4 Serial port packaging and sending function¶
/**
* cias_ message_ send_ The interface packages the wifi data and sends it to the audio for processing
*/
void cias_ message_ send_ interface(unsigned short cmd, cias_fill_type_t type, int len, unsigned char *buf)
3.5 Serial port data receiving and processing¶
void cias_ slave_ message_ recv_ Deal (void * parameter)//Serial port data receiving and processing
4. Tencent IOT demo usage¶
4.1 Use Chipintelli IOT development board (note: jumper cap is short circuited according to the figure)¶
4.2 Distribution network¶
- If the routing information is not configured in the SDK for the first time, it will automatically enter the distribution network mode after power on; If the network has been connected and needs to be re distributed, the user needs to voice wake up the device (“smart butler”), say the command word “start distribution”, and then scan the QR code of the device’s distribution network with WeChat or Tencent connected applet (select the corresponding product under “product development” in the project where Tencent cloud platform is located, and configure “distribution guidance” under “interactive development”, as shown in the figure below, and enter the page containing the QR code of the distribution network after saving)
- Enter the applet distribution network interface, check “I have completed the above operation”, click “Next”, enter the name and password of the wifi to be connected, and then follow the steps to connect the device hotspot “CI_network_config” with the password of 12345678. After the connection is successful, return to the applet and wait for the distribution network to complete (note: the device does not support 5G band wifi). To avoid the problem of delayed messages in the applet and cloud platform distribution network, After displaying the failure of distribution timeout, you can also return to Tencent Lianlian applet to add the device to “My Device”, and try to control the device to determine whether the distribution is successful. After the device is powered on again, the wifi name and password of the last distribution network will be connected by default. After the connection timeout, the device will automatically enter the distribution network mode to control the distribution network through the applet again.
4.2 Applet use¶
Click “+” at the bottom of Tencent Lianlian applet interface to scan the QR code of the device (select the corresponding product under “product development” and find the corresponding device in the “device debugging” list), and select the corresponding device to experience applet control. You can also call out the following command words to control the RGB light:
Wake up Words | Smart Housekeeper | |||
---|---|---|---|---|
Distribution network command | Start distribution network | |||
Command word | Turn on the light | I want to turn on the light | Help me turn on the light | Turn on the light for me |
Turn off the light | I want to turn off the light | Turn off the light for me | Turn off the light | Turn it on |
Lighter | Lighter | Highest brightness | Brightest light | Dimmer |
Darker | Lowest brightness | Darkest light | Medium brightness | Orange light |
Green light | Blue light | Medium light | Turn on orange light | Turn on yellow light |
Turn on blue light | purple light | white light | red light | switch light |
Turn on purple light | Turn on white light | Turn on red light | Switch mode | Change mode |
Music Mode | Music Rhythm | Turn on music rhythm | ||