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

环境要求

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

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

工具链安装准备:

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
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

sudo apt-get install ninja-build

使用 pip 安装以下 python 软件包

pip install --update pip

python -m pip install pyyaml xlrd

python -m pip --version

安装 Python3 的环境

sudo apt-get install python3.8-venv python3.8-dev

安装 curses

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
cd ~

mkdir esp

cd esp

git clone -b v5.1.2 https://github.com/espressif/esp-idf.git
cd esp-idf

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

./install.sh 

. ./export.sh

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

cd ~/esp

git clone https://github.com/espressif/esp-matter.git
cd esp-matter

git submodule update --init --recursive

git submodule update --init --recursive -f

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

./install.sh

cd ./connectedhomeip/connectedhomeip/scripts

source ./activate.sh

cd ../../..

. ./export.sh
  • 对例程进行编译测试
cd examples/light

rm -rf build

idf.py fullclean

idf.py set-target esp32

idf.py build
  • 例程编译测试结果

在这里插入图片描述

相关推荐

  1. Ubuntu环境下SomeIP/CommonAPI环境详细步骤

    2024-02-07 10:16:03       71 阅读
  2. UbuntuRiscV交叉编译环境

    2024-02-07 10:16:03       392 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-02-07 10:16:03       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-02-07 10:16:03       100 阅读
  3. 在Django里面运行非项目文件

    2024-02-07 10:16:03       82 阅读
  4. Python语言-面向对象

    2024-02-07 10:16:03       91 阅读

热门阅读

  1. 【实验2】在Hadoop平台上部署WordCount程序

    2024-02-07 10:16:03       53 阅读
  2. 华为Eth-Trunk级联堆叠接入IPTV网络部署案例

    2024-02-07 10:16:03       41 阅读
  3. Ubuntu修改用户名及密码

    2024-02-07 10:16:03       58 阅读
  4. Docker Compose

    2024-02-07 10:16:03       56 阅读
  5. 边缘计算和云计算的区别

    2024-02-07 10:16:03       49 阅读
  6. uniapp从入门到进阶

    2024-02-07 10:16:03       52 阅读