分类 技术代码类 下的文章

Keil MDK-Arm 最新版,我这里用的是MDK529
官方最新版下载链接 https://www.keil.com/demo/eval/arm.htm
Keil Keygen Generator 注册机你懂的
nRF5 SDK最新版,我这里用的是17.0.2
官方最新版下载链接 https://www.nordicsemi.com/Products/Development-software/nRF5-SDK/Download#infotabs
ARM CMSIS pack,需要和SDK版本对应,我这里用的是4.5.0
官方最新版下载链接 https://github.com/ARM-software/CMSIS/releases
nRF_DeviceFamilyPack,需要和SDK版本对应,我这里用的是8.35.0
官方最新版下载链接 https://developer.nordicsemi.com/nRF5_SDK/pieces/nRF_DeviceFamilyPack/
S132 Softdevice,需要和芯片型号和SDK版本对应,我这里用的是 7.2.0
官方最新版下载链接 https://www.nordicsemi.com/Products/Development-software/S132/Download
nRF Connect for Desktop 最新版
官方最新版下载链接 https://www.nordicsemi.com/Products/Development-tools/nRF-Connect-for-desktop/Download#infotabs
安装顺序

安装Keil并使用注册机破解
教程 https://blog.csdn.net/qq_42748213/article/details/90485750
双击安装 CMSIS 和 DeviceFamilyPack
将nRF5 SDK压缩包解压到一个固定的位置,比如解压到D盘
打开解压后的文件夹,新建两个文件夹,分别是user_applications,user_drivers,分别存放自己写的程序和驱动
然后将Softdevice hex放进来备用

https://blog.embeddedexpert.io/?p=1671
https://blog.csdn.net/qq_39549182/article/details/132409273

----------------RONS SETUP

  1. ARMCompiler_506_Windows_x86_b960
    下载,然后在C:\Keil_v5\ARM 建个C:\Keil_v5\ARM\ARMCC, armcc506安装在这个目录下
    2.
    NordicSemiconductor.nRF_DeviceFamilyPack.8.40.3
    nRF5_SDK_17.1.0_ddde560
    ARM.CMSIS.4.5.0
    打开这个目录
    nrf5_sdk_1710_ddde560\examples\peripheral\uart\pca10056\blank\arm5_no_packs
    打开其中的项目
    然后keil5 -file extension-folder- tick use arm complier --... --add aother-C:\Keil_v5\ARM\ARMCC
    然后target options-target-code generation-arm compiler-V5.06

  1. 下载KEIL5 C51 破解下
    https://www.keil.com/download/product/
  2. 下载 STC ISP下载软件 比如v6.95d
    https://www.stcmicro.com.cn/rjxz.html?i=1
    3.安装STC仿真驱动
    点击Keil仿真设置,选择单片机型号,点击添加型号和头文件到keil中添加STC仿真器驱动到Keil中
    2025-12-30T13:38:01.png

选择安装的Keil目录,点击确定
2025-12-30T13:38:19.png

参考bbs
https://www.stcaimcu.com/
https://www.stcaimcu.com/thread-10224-1-1.html
https://blog.csdn.net/m0_74025063/article/details/147672906


Execution failed for task ':asb:compileDebugJavaWithJavac'.

Could not resolve all files for configuration ':asb:androidJdkImage'.
。。。。。。
Caused by: org.gradle.api.internal.artifacts.transform.TransformException: Execution failed for JdkImageTransform: C
。。。。。。

-file-settings-build, execution,deployment-build tools
-gradle-JDK
21.0.4->17.0.12
换个版本

  1. mkdir /xiaozhi-server
    put data models in
    mkdir codes

ronz@AISERVER:/xiaozhi-server/codes$ sudo apt install git
git clone https://github.com/xinnan-tech/xiaozhi-esp32-server.git

ronz@AISERVER:/xiaozhi-server/codes/xiaozhi-esp32-server$ ls
Dockerfile-server Dockerfile-web docker-setup.sh docs LICENSE main README_en.md README.md
ronz@AISERVER:/xiaozhi-server/codes/xiaozhi-esp32-server$ mv ../../
codes/ data/ models/
ronz@AISERVER:/xiaozhi-server/codes/xiaozhi-esp32-server$ mv ../../data ./
ronz@AISERVER:/xiaozhi-server/codes/xiaozhi-esp32-server$ mv ../../models ./

  1. database setup
    2.1 mysql
    xiaozhi_esp32_server
    CREATE DATABASE xiaozhi_esp32_server CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    docker:docker run --name xiaozhi-esp32-server-db -e MYSQL_ROOT_PASSWORD=123456 -p 3306:3306 -e MYSQL_DATABASE=xiaozhi_esp32_server -e MYSQL_INITDB_ARGS="--character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci" -e TZ=Asia/Shanghai -d mysql:latest

1panel - 192.168.88.88 3306 xz_user/123456

redis
docker run --name xiaozhi-esp32-server-redis -d -p 6379:6379 redis

1panel -
192.168.88.88 6379 123456

  1. runtime
    sudo apt install openjdk-21-jdk
    sudo apt install curl
    curl -sL https://deb.nodesource.com/setup_22.x | sudo -E bash -
    sudo apt install nodejs
    sudo apt install maven

curl -O https://repo.anaconda.com/archive/Anaconda3-2024.10-1-Linux-x86_64.sh
bash Anaconda3-2024.10-1-Linux-x86_64.sh

--run
ronz@AISERVER:/xiaozhi-server/codes/xiaozhi-esp32-server$ cd ~/anaconda3/bin/
ronz@AISERVER:~/anaconda3/bin$ . ./activate
(base) ronz@AISERVER:~/anaconda3/bin$ cd /xiaozhi-server/codes/xiaozhi-esp32-server
(base) ronz@AISERVER:/xiaozhi-server/codes/xiaozhi-esp32-server$ conda remove -n xiaozhi-esp32-server --all -y

EnvironmentLocationNotFound: Not a conda environment: /home/ronz/anaconda3/envs/xiaozhi-esp32-server

(base) ronz@AISERVER:/xiaozhi-server/codes/xiaozhi-esp32-server$ conda create -n xiaozhi-esp32-server python=3.10 -y

(base) ronz@AISERVER:/xiaozhi-server/codes/xiaozhi-esp32-server$ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
(base) ronz@AISERVER:/xiaozhi-server/codes/xiaozhi-esp32-server$ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
(base) ronz@AISERVER:/xiaozhi-server/codes/xiaozhi-esp32-server$ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
(base) ronz@AISERVER:/xiaozhi-server/codes/xiaozhi-esp32-server$ conda install libopus -y
conda install ffmpeg -y

--- fix ibarchive.so.20: cannot open shared object file: No such file or directory) issue

conda install -n base libarchive -c main --force-reinstall --solver classic

cd /xiaozhi-server/codes
(base) ronz@AISERVER:/xiaozhi-server/codes$ conda activate xiaozhi-esp32-server
(xiaozhi-esp32-server) ronz@AISERVER:/xiaozhi-server/codes$ cd xiaozhi-esp32-server/main/
manager-api/ manager-mobile/ manager-web/ xiaozhi-server/
(xiaozhi-esp32-server) ronz@AISERVER:/xiaozhi-server/codes$ cd xiaozhi-esp32-server/main/xiaozhi-server/
(xiaozhi-esp32-server) ronz@AISERVER:/xiaozhi-server/codes/xiaozhi-esp32-server/main/xiaozhi-server$ pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
Writing to /home/ronz/.config/pip/pip.conf
(xiaozhi-esp32-server) ronz@AISERVER:/xiaozhi-server/codes/xiaozhi-esp32-server/main/xiaozhi-server$ pip install -r requirements.txt

--------WEB
ronz@AISERVER:~$ cd /xiaozhi-server/codes/xiaozhi-esp32-server/main/manager-web/
ronz@AISERVER:/xiaozhi-server/codes/xiaozhi-esp32-server/main/manager-web$ npm install
ronz@AISERVER:/xiaozhi-server/codes/xiaozhi-esp32-server/main/manager-web$ npm run serve

ronz
Password_1

-------API
ronz@AISERVER:/xiaozhi-server/codes/xiaozhi-esp32-server/main$ ls
manager-api manager-web README.md
manager-mobile README_en.md xiaozhi-server
ronz@AISERVER:/xiaozhi-server/codes/xiaozhi-esp32-server/main$ cd manager-api/
ronz@AISERVER:/xiaozhi-server/codes/xiaozhi-esp32-server/main/manager-api$ ls
pom.xml README.md src

ronz@AISERVER:/xiaozhi-server/codes/xiaozhi-esp32-server/main/manager-api$ mvn spring-boot:run

ronz@AISERVER:/xiaozhi-server/codes/xiaozhi-esp32-server/main/xiaozhi-server$ cd ~/anaconda3/bin/
ronz@AISERVER:~/anaconda3/bin$ . ./activate
(base) ronz@AISERVER:~/anaconda3/bin$ cd /xiaozhi-server/codes/xiaozhi-esp32-server/main/
(base) ronz@AISERVER:/xiaozhi-server/codes/xiaozhi-esp32-server/main$ conda activate xiaozhi-esp32-server
(xiaozhi-esp32-server) ronz@AISERVER:/xiaozhi-server/codes/xiaozhi-esp32-server/main$ cd xiaozhi-server/

(xiaozhi-esp32-server) ronz@AISERVER:/xiaozhi-server/codes/xiaozhi-esp32-server/main/xiaozhi-server$ python app.py

http://192.168.88.77:8001/
ronz
Password_1
自动启动脚本

#!/bin/bash

# ==============================================================================
#                 XiaoZhi Server Auto-Start Script
# ==============================================================================
# Description: This script starts the API server, the manager web UI,
#              and the main python server in sequence. It ensures they run
#              in the background and logs their output.
#
# Author: Gemini
# Date: $(date +%Y-%m-%d)
# ==============================================================================

# --- Configuration ---
# Set the base directory for your project
PROJECT_BASE_DIR="/xiaozhi-server/codes/xiaozhi-esp32-server/main"

# Set the directory for log files. The script will create it if it doesn't exist.
LOG_DIR="/xiaozhi-server/logs"

# Path to your Anaconda installation
ANACONDA_PATH="$HOME/anaconda3"

# Name of the Conda environment to activate
CONDA_ENV_NAME="xiaozhi-esp32-server"

# --- Script Body ---

# Create log directory if it does not exist
mkdir -p "$LOG_DIR"

echo "Starting all services for XiaoZhi Server..."
echo "--------------------------------------------------"

# 1. Start the API Server (Spring Boot)
echo "[1/3] Starting API Server..."
cd "$PROJECT_BASE_DIR/manager-api" || { echo "ERROR: Directory not found: $PROJECT_BASE_DIR/manager-api"; exit 1; }
nohup mvn spring-boot:run > "$LOG_DIR/api_server.log" 2>&1 &
API_SERVER_PID=$!
echo "API Server started in the background with PID: $API_SERVER_PID. See log at $LOG_DIR/api_server.log"
echo "Waiting for 15 seconds for the API server to initialize..."
sleep 15

echo "--------------------------------------------------"

# 2. Start the Manager Web (Vue/React)
echo "[2/3] Starting Manager Web..."
cd "$PROJECT_BASE_DIR/manager-web" || { echo "ERROR: Directory not found: $PROJECT_BASE_DIR/manager-web"; exit 1; }
nohup npm run serve > "$LOG_DIR/manager_web.log" 2>&1 &
MANAGER_WEB_PID=$!
echo "Manager Web started in the background with PID: $MANAGER_WEB_PID. See log at $LOG_DIR/manager_web.log"
echo "Waiting for 10 seconds..."
sleep 10

echo "--------------------------------------------------"

# 3. Start the Main Python Server (using Conda)
echo "[3/3] Starting Main Python Server..."
# We use 'conda run' which is the recommended way to execute commands
# within a conda environment from a script. It handles the activation.
# Make sure the conda command is available in the path.
PYTHON_APP_PATH="$PROJECT_BASE_DIR/xiaozhi-server/app.py"

if [ ! -f "$PYTHON_APP_PATH" ]; then
    echo "ERROR: Python app not found: $PYTHON_APP_PATH"
    exit 1
fi

# Go to the python app's directory before running it
cd "$PROJECT_BASE_DIR/xiaozhi-server" || { echo "ERROR: Directory not found: $PROJECT_BASE_DIR/xiaozhi-server"; exit 1; }

nohup "$ANACONDA_PATH/bin/conda" run -n "$CONDA_ENV_NAME" python app.py > "$LOG_DIR/python_server.log" 2>&1 &
PYTHON_SERVER_PID=$!
echo "Main Python Server started in the background with PID: $PYTHON_SERVER_PID. See log at $LOG_DIR/python_server.log"

echo "--------------------------------------------------"
echo "All services have been launched."
echo "You can check the log files in $LOG_DIR for status."