当前位置:网站首页>Anxinco esp32-a1s development board is adapted to Baidu dueros routine to realize online voice function
Anxinco esp32-a1s development board is adapted to Baidu dueros routine to realize online voice function
2022-07-07 23:32:00 【Little river god is tangled】
List of articles
Preface
in the light of ESP32-A1S Development board , I wrote about how to realize offline voice control LED Blog post of Deng , But the audio codec chip in the module used in the previous blog post is AC101, We need to write our own driver . In order to fit Le Xinde SDK, The codec chip in the module has also been replaced ES8388, Lexin has written the driver , As long as we don't need to rewrite the codec program for secondary development . It also makes our transplantation easier .
DuerOS It is Baidu Duer business department in 2017 year 1 month CES The interactive AI operating system launched by the exhibition , It gives hardware devices the ability to communicate with people , The new interactive way of voice dialogue is really integrated into people's lives .
This article will pass on Lexin ESP-ADF-SDK Medium dueros Routine for transplantation , In Anxin Ke SEP32-A1S-Audio-Kit Realize online voice dialog function on the development board , This article is very long , But no gossip .
One 、 preparation
1. Hardware preparation
There is no doubt that the hardware is anxinko ESP32-A1S-Audio-Kit_V2.2 Development board , With memory card , It's best to connect a loudspeaker , There is no speaker to connect 3.5mm Earphones with audio ports also become .
unfortunately : At present, this development board has been removed from the flagship store of Anxin keyibao , however ESP-A1S The module is still there , painting PCB Students can draw a small board of their own , The schematic diagram of the development board above is also provided to you , see The end of this article connects :

2. Software preparation
This secondary development is in Linux In the environment , The software is Lexin esp-adf engineering , In a folder you like clone Project source code , This cloning takes a long time , Please be patient :
git clone --recursive https://github.com/espressif/esp-adf.git
// If you feel slow , You can also use the blogger's warehouse
git clone https://gitee.com/seahi007/esp-adf.git
ESP-ADF Please refer to :espressif esp-adf Audio development framework
Finally, don't forget to pull the sub module :
cd esp-adf
git submodule update --init --recursive
In the process of waiting , You can register a baidu account or do developer verification . After the account is registered, it is verified by the developer ( Verification time 1~2 God ).DuerOS Open platform connectivity :https://dueros.baidu.com/open,
After passing the verification , Enter this connection : Xiaodu intelligent open platform :https://dueros.baidu.com/didp/main/index, Never click directly Console go in , Otherwise, you will never find this interface , You can't get profile file .

The details of the profile Please refer to :http://www.dianzixuexi.com/HTML/zixun/64787.html
Two 、 verification ESP-ADF If there is something wrong
1. Simple code modification
ESP-ADF Inside examples All need development boards , Because of its I2C,I2S And other interfaces are only adapted to the development board produced by Lexin . If we want to use our own board , You need to change the code , Make I2C and I2S The interface matches our board ,ESP32-A1S The development board interface of is as follows :
modify board_pins_config.c, route :esp-adf/components/audio_board/lyrat_v4_3
cd /home/saehi/Desktop/ESP/ESP32-A1S/esp-adf_test/esp-adf/components/audio_board/lyrat_v4_3
vi board_pins_config.c

2. Play MP3 test
Play MP3 This routine is not microSD( Memory card ) Of , You can directly compile, download and play .
To configure Audio HAL—>ESP32-Lyrat V4.3:
idf.py menuconfig

When the configuration is complete , Ready to compile —> download —> verification :
idf.py build flash montior

Now , You should be able to hear a very magical sound , It is proved in ESP-ADF Ready , You can start to do online voice function .
3、 ... and 、dueros Routine adaptation
The adaptation process is a little complicated , Please read... Carefully :
1. Replace the connection file
dueros The connection of requires profile file , It contains client_id、client_secret Wait for verification information .
A top priority : We need to take profile.zip Rename any file in to :duer_profile, Then replace duer_profile:esp-adf_test/esp-adf/components/dueros_service/duer_profile.
2. Memory card preparation
Prepare a memory card , It's better to have an empty memory card , And then put DingDing.wav Copy the file to the memory card root directory ,DingDing.wav The file path is :esp-adf_test/esp-adf/examples/dueros/tone. After that, insert the memory card into the card slot of the development board .
3. Code changes
Code modification is mainly in dueros Routine main In the document dueros_app.c:
(1) Shield touch keys
Anxinco ESP32-A1S There is no touch button in the development board , So we need to shield , Moreover, the circular query by touching the keys takes up a lot of CPU Resources for , It can lead to I2C And ES8388 Your communication is blocked ,dueros_app.c Of 294 Row to 342 All lines are shielded :
(2) Modify the wake-up tone
The file name of the wake-up tone in the source code is wrong , Without modification , The prompt sound cannot be played , Although it does not affect the use of , But reduce the experience .
Locate the :94 That's ok :
4. modify lyrat_v4_3 Medium board.c Code
open board.c:
vi esp-adf_test/esp-adf/components/audio_board/lyrat_v4_3/board.c
Locate the 93 That's ok , hold 93 Row to 99 The content of the line is blocked , as follows :
5. Screenshot of successful connection

After successful connection , You can speak into the microphone of the development board "Hi, Lexin ",” What's the weather like today? “, Under normal circumstances, weather conditions can be broadcast .
Four 、 common problem
1. Function undeclared error
Screenshot of the problem :
reason : dueros_esp_flash.c Not added to the project ;
Modification method : In path :"esp-adf_test/esp-adf/components/dueros_service/ " Open in CMakeLists.txt, Modify the following to compile :
2. Serial port monitoring has wake-up prompt but no prompt tone
reason 1: There is no... In the memory card DingDing.wav Music files ;
terms of settlement : hold esp-adf_test/esp-adf/examples/dueros/tone/DingDing.wav Copy the file to the memory card .
reason 2: The playback file has not been modified :
terms of settlement :
If the above methods are not solved , Please run play first MP3 Routine for , See if it's normal .
3.I2C Bus WriteReg Error
Screenshot of the problem :
reason : No shielding TOUCH Initialization code , Lead to TOUCH Initialization error .
terms of settlement : See : 4. modify lyrat_v4_3 Medium board.c Code
5、 ... and 、 Related connection
Schematic diagram of development board :ESP32-A1S-Audui-Kit-V2.0 Schematic diagram ;
Module purchase connection : Anxinco ESP32-A1S A treasure purchase connection ;
Welcome to anxinco's official blog : Welcome to anxinco Technology ;
Source code address :https://github.com/SeaHi-Mo/esp-adf
边栏推荐
- USB (XV) 2022-04-14
- 经纬度PLT文件格式说明
- Lm12 rolling heikin Ashi double K-line filter
- 1. Sum of two numbers
- B_QuRT_User_Guide(40)
- 在软件工程领域,搞科研的这十年!
- POJ2392 SpaceElevator [DP]
- Tree background data storage (using webmethod) [easy to understand]
- As a new force, chenglian premium products was initially injected, and the shares of relevant listed companies rose 150% in response
- RE1 attack and defense world reverse
猜你喜欢

SAP HR 劳动合同信息 0016

ROS2专题(03):ROS1和ROS2的区别【02】
![Ros2 topic (03): the difference between ros1 and ros2 [02]](/img/12/244ea30b5b141a0f47a54c08f4fe9f.png)
Ros2 topic (03): the difference between ros1 and ros2 [02]

LDO voltage stabilizing chip - internal block diagram and selection parameters

MySQL Index Optimization Practice I

B_ QuRT_ User_ Guide(37)

LeeCode -- 6. Zigzag transformation

Senior programmers must know and master. This article explains in detail the principle of MySQL master-slave synchronization, and recommends collecting

B_ QuRT_ User_ Guide(38)

Map operation execution process
随机推荐
13、 System optimization
The 19th Zhejiang Provincial Collegiate Programming Contest 2022浙江省赛 F.EasyFix 主席树
Caip2021 preliminary VP
B_QuRT_User_Guide(39)
FreeLink开源呼叫中心设计思想
云原生正在吞噬一切,开发者该如何应对?
B_ QuRT_ User_ Guide(36)
S2b2b mall solution of intelligent supply chain in packaging industry: opening up a new ecosystem of e-commerce consumption
UE4_ Ue5 combined with Logitech handle (F710) use record
The efficient s2b2c e-commerce system helps electronic material enterprises improve their adaptability in this way
Solution: prompt "unsupported video format" when inserting avi format video into the message
Explain
树后台数据存储(採用webmethod)[通俗易懂]
One week learning summary of STL Standard Template Library
深入理解Mysql锁与事务隔离级别
How to generate unique file names
Mobile heterogeneous computing technology - GPU OpenCL programming (basic)
Home appliance industry channel business collaboration system solution: help home appliance enterprises quickly realize the Internet of channels
Coreseek: the second step is index building and testing
MATLAB signal processing [Q & A essays · 2]