【Ubuntu 20.04/22.04 LTS】最新 esp-matter SDK 软件编译环境搭建步骤

环境要求

  • Ubuntu 20.04 或 Ubuntu22.04
  • 网络环境支持访问 Gihub

在安装 esp-matter SDK 软件编译环境之前,需要先安装相关工具链。

工具链安装准备:

bash 复制代码
sudo apt-get install git wget flex bison gperf python3 python3-pip python3-venv cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0
bash 复制代码
sudo apt-get install git gcc g++ pkg-config libssl-dev libdbus-1-dev libglib2.0-dev libavahi-client-dev ninja-build python3-venv python3-dev python3-pip unzip libgirepository1.0-dev libcairo2-dev libreadline-dev	

安装 ninja-build

bash 复制代码
sudo apt-get install ninja-build

使用 pip 安装以下 python 软件包

bash 复制代码
pip install --update pip

python -m pip install pyyaml xlrd

python -m pip --version

安装 Python3 的环境

bash 复制代码
sudo apt-get install python3.8-venv python3.8-dev

安装 curses

bash 复制代码
sudo apt-get install libncurses5-dev

esp-matter SDK 软件编译环境需要依赖 esp-idf SDK 软件编译环境。推荐基于 esp-idf SDK v5.1.2 版本来搭建 esp-matter SDK Master 版本的软件编译环境。

接下来的步骤同样适用于 macOS 10.15 及以上版本的环境。

首先,安装 esp-idf SDK v5.1.2 版本的软件编译环境:

  • 克隆 esp-idf v5.1.2 版本的 SDK
bash 复制代码
cd ~

mkdir esp

cd esp

git clone -b v5.1.2 https://github.com/espressif/esp-idf.git
bash 复制代码
cd esp-idf

git submodule update --init --recursive
  • 设置 esp-idf SDK 环境变量并安装编译工具依赖
bash 复制代码
export IDF_PATH=$(pwd)

./install.sh 

. ./export.sh

然后安装 esp-matter SDK Master 版本的软件编译环境:

bash 复制代码
cd ~/esp

git clone https://github.com/espressif/esp-matter.git
bash 复制代码
cd esp-matter

git submodule update --init --recursive

git submodule update --init --recursive -f

git pull
  • 设置 esp-matter SDK 环境变量并安装编译工具依赖
bash 复制代码
export ESP_MATTER_PATH=$(pwd)

./install.sh

cd ./connectedhomeip/connectedhomeip/scripts

source ./activate.sh

cd ../../..

. ./export.sh
  • 对例程进行编译测试
bash 复制代码
cd examples/light

rm -rf build

idf.py fullclean

idf.py set-target esp32

idf.py build
  • 例程编译测试结果
相关推荐
请叫我阿杰1 小时前
Ubuntu系统安装.NET SDK 7.0
数据库·ubuntu·.net
极小狐1 小时前
比 Cursor 更丝滑的 AI DevOps 编程智能体 - CodeRider-Kilo 正式发布!
运维·人工智能·devops
Sunlightʊə1 小时前
2.登录页测试用例
运维·服务器·前端·功能测试·单元测试
Red丶哞1 小时前
Docker 安装部署Prometheus
linux·云原生·容器·kubernetes
利刃大大2 小时前
【高并发服务器:HTTP应用】十六、HttpContext上下文模块 && HttpServer服务器模块&& 服务器测试
运维·服务器·http·高并发·项目
吃饭最爱2 小时前
Elasticsearch的用法
运维·jenkins
emiya_saber3 小时前
Linux 文件系统基本管理
linux·运维·服务器
夜月yeyue3 小时前
Linux 内核驱动加载机制
linux·服务器·stm32·嵌入式硬件
好记忆不如烂笔头abc3 小时前
Oracle19c rac两节点实例test,在节点1查看监听状态没有test1,但在节点2可以看到test2
运维·服务器
牢七3 小时前
Linux新
linux