[Anxinke ESP32-A1S Audio Development Board①] Build a Linux development environment to get you started quickly

I. Introduction

ESP32-A1S module is a WiFi+BT+BLE+ audio module developed by Anxinke. The audio codec chip is ES8388, and the corresponding development board is ESP32-Audio-Kit audio development board. It can realize functions such as recording, audio playback, and offline speech recognition. Common application scenarios are:

  1. Play the audio in sd card and flash, and upgrade the audio in sd card and flash online;
  2. Connect with the mobile phone via bluetooth to play the music in the mobile phone;
  3. Play the audio delivered by the server;
  4. Module recording, upload to server via WiFi;
  5. Voice control lights, sockets and other electrical appliances

2. Environment Construction

2.1 Get sdk

Baidu network disk link: https://pan.baidu.com/s/1KjAa0AP7XE5XBchsWhh2Eg
Extraction code: f9mq
Download it and put the sdk in linux.

2.2 Download Toolchain

Install a bunch of dependencies first

sudo apt-get install git wget flex bison gperf python3 python3-pip python3-setuptools cmake ninja-build ccache libffi-dev libssl-dev

set python default version to python3

sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 150

Enter the sdk folder esp-adf/esp-idf
and run the toolchain installation command in the terminal

./install.sh

When this appears, the installation is successful!
insert image description here

2.3 Set the variables of SDK path and compilation environment

Open a terminal inside the esp-adf folder and run the command

. ./path.sh  

注意
1. 上面命令2个小数点中间有一个空格!
2. 每次打开终端进入esp-adf文件夹都要运行一次此命令

After success, it will prompt like this:
insert image description here

2.4 Compile and download

Take compiling esp-adf/examples/get-started/play_mp3_control as an example

cd $ADF_PATH/examples/get-started/play_mp3_control

The development board selects ESP32-AiThinker-audio V2.3:

idf.py menuconfig

Go to Audio HAL->Audio board, select ESP32-AiThinker-audio V2.3 to
insert image description here
compile

idf.py build

insert image description here
Burn the firmware and open the serial port monitoring

idf.py flash monitor

注意
The Failed to open port /dev/ttyUSB0 error message may appear when flashing firmware with some Linux distributions. At this point, the current user can be added to the :ref:Linux Dialout group. Because by default, only the root user and users belonging to the dialout group have read and write permissions, so you can directly add your own users to the dialout group. After the command is completed, restart it, and it will take effect permanently.

 sudo usermod -a -G dialout $USER   //$USER为您的用户名

The development board is connected to speakers or headphones, and after restarting, you can hear audio playback
insert image description here

At this point, our development environment has been set up!

3. Introduction to SDK directory structure

insert image description here
Let's take a look at what routines are in the example folder.
insert image description here
Each routine has a README file. The README file contains a detailed introduction to this routine. You must read it before using it!

4. Development Information

API for audio:
https://docs.espressif.com/projects/esp-adf/zh_CN/latest/api-reference/index.html
Programming guide for ESP32 development:
https://docs.espressif.com/projects /espidf/zh_CN/latest/esp32/index.html Anxinke
official website:
https://docs.ai-thinker.com
Official forum: http://bbs.ai-thinker.com
Technical support: [email protected]

Guess you like

Origin blog.csdn.net/Boantong_/article/details/122110353