0

使用 github 项目中的 MATTER 协议遵守 ESP32 项目:Connectedhomeip ( https://github.com/project-chip/connectedhomeip/tree/master/examples/all-clusters-app/esp32 )

我使用的是 ubuntu 20.02,尝试使用 python 3.8 和 3.9 没有错误。

我按照上面链接中的以下说明进行操作,该说明粘贴在下面


Building the Example Application

Building the example application requires the use of the Espressif ESP32 IoT Development Framework and the xtensa-esp32-elf toolchain for ESP32 modules or the riscv-esp32-elf toolchain for ESP32C3 modules.

The VSCode devcontainer has these components pre-installed, so you can skip this step. To install these components manually, follow these steps:

    Clone the Espressif ESP-IDF and checkout v4.4 release

      $ mkdir ${HOME}/tools
      $ cd ${HOME}/tools
      $ git clone https://github.com/espressif/esp-idf.git
      $ cd esp-idf
      $ git checkout v4.4
      $ git submodule update --init
      $ ./install.sh

    Install ninja-build

      $ sudo apt-get install ninja-build

Currently building in VSCode and deploying from native is not supported, so make sure the IDF_PATH has been exported(See the manual setup steps above).

    Setting up the environment

    $ cd ${HOME}/tools/esp-idf
    $ ./install.sh
    $ . ./export.sh
    $ cd {path-to-connectedhomeip}

    To download and install packages.

    $ source ./scripts/bootstrap.sh
    $ source ./scripts/activate.sh

    If packages are already installed then simply activate them.

    $ source ./scripts/activate.sh

    Target Set

To set IDF target, run set-target with one of the commands.

      $ idf.py set-target esp32
      $ idf.py set-target esp32c3

    Configuration Options

To build the default configuration (sdkconfig.defaults) skip to building the demo application.

To build a specific configuration (as an example m5stack):

      $ rm sdkconfig
      $ idf.py -D 'SDKCONFIG_DEFAULTS=sdkconfig_m5stack.defaults' build

Note: If using a specific device configuration, it is highly recommended to
start off with one of the defaults and customize on top of that. Certain
configurations have different constraints that are customized within the
device specific configuration (eg: main app stack size).

To customize the configuration, run menuconfig.

      $ idf.py menuconfig

Select ESP32 based Device Type through Demo->Device Type. The device types that are currently supported include ESP32-DevKitC (default), ESP32-WROVER-KIT_V4.1, M5Stack and ESP32C3-DevKitM.

    To build the demo application.

      $ idf.py build

    After building the application, to flash it outside of VSCode, connect your device via USB. Then run the following command to flash the demo application onto the device and then monitor its output. If necessary, replace /dev/tty.SLAB_USBtoUART(MacOS) with the correct USB device name for your system(like /dev/ttyUSB0 on Linux). Note that sometimes you might have to press and hold the boot button on the device while it's trying to connect before flashing. For ESP32-DevKitC devices this is labeled in the functional description diagram.

      $ idf.py -p /dev/tty.SLAB_USBtoUART flash monitor

使用 >>idf.py 构建项目时出现以下错误

>>idf.py build
Executing action: all (aliases: build)
Running ninja in directory /home/csir/connectedhomeip/examples/all-clusters-app/esp32/build
Executing "ninja all"...
ninja: warning: bad deps log signature or version; starting over
[0/1] Re-running CMake...
-- Building ESP-IDF components for target esp32
-- Found Python3: /home/csir/.espressif/python_env/idf5.0_py3.8_env/bin/python3.8 (found version "3.8.10") found components: Interpreter 
-- Project sdkconfig file /home/csir/connectedhomeip/examples/all-clusters-app/esp32/sdkconfig
Loading defaults file /home/csir/connectedhomeip/examples/all-clusters-app/esp32/sdkconfig.defaults...
-- App "chip-all-clusters-app" version: TE8/rc2-7-gf32685f35-dirty
-- Adding linker script /home/csir/connectedhomeip/examples/all-clusters-app/esp32/build/esp-idf/esp_system/ld/memory.ld
-- Adding linker script /home/csir/esp/esp-idf/components/esp_system/ld/esp32/sections.ld.in
-- Adding linker script /home/csir/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.ld
-- Adding linker script /home/csir/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.api.ld
-- Adding linker script /home/csir/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.libgcc.ld
-- Adding linker script /home/csir/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.newlib-data.ld
-- Adding linker script /home/csir/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.syscalls.ld
-- Adding linker script /home/csir/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.newlib-funcs.ld
-- Adding linker script /home/csir/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.newlib-time.ld
-- Adding linker script /home/csir/esp/esp-idf/components/soc/esp32/ld/esp32.peripherals.ld
-- Components: QRCode app_trace app_update asio bootloader bootloader_support bt chip cmock coap console cxx driver efuse esp-tls esp32 esp32_mbedtls esp_adc_cal esp_common esp_eth esp_event esp_gdbstub esp_hid esp_http_client esp_http_server esp_https_ota esp_https_server esp_hw_support esp_lcd esp_local_ctrl esp_netif esp_phy esp_pm esp_ringbuf esp_rom esp_serial_slave_link esp_system esp_timer esp_websocket_client esp_wifi espcoredump esptool_py fatfs freemodbus freertos hal heap http_parser idf_test ieee802154 iperf json led_strip log lwip main mbedtls mdns mqtt newlib nvs_flash openssl openthread partition_table pcap perfmon pid_ctrl protobuf-c protocol_examples_common protocomm pthread qrcode screen-framework sdmmc soc spi_flash spidriver spiffs tcp_transport tcpip_adapter tft tinyusb ulp unity usb vfs wear_levelling wifi_provisioning wpa_supplicant xtensa
-- Component paths: /home/csir/connectedhomeip/examples/common/QRCode /home/csir/esp/esp-idf/components/app_trace /home/csir/esp/esp-idf/components/app_update /home/csir/esp/esp-idf/components/asio /home/csir/esp/esp-idf/components/bootloader /home/csir/esp/esp-idf/components/bootloader_support /home/csir/esp/esp-idf/components/bt /home/csir/connectedhomeip/examples/all-clusters-app/esp32/third_party/connectedhomeip/config/esp32/components/chip /home/csir/esp/esp-idf/components/cmock /home/csir/esp/esp-idf/components/coap /home/csir/esp/esp-idf/components/console /home/csir/esp/esp-idf/components/cxx /home/csir/esp/esp-idf/components/driver /home/csir/esp/esp-idf/components/efuse /home/csir/esp/esp-idf/components/esp-tls /home/csir/esp/esp-idf/components/esp32 /home/csir/connectedhomeip/examples/all-clusters-app/esp32/third_party/connectedhomeip/config/esp32/components/esp32_mbedtls /home/csir/esp/esp-idf/components/esp_adc_cal /home/csir/esp/esp-idf/components/esp_common /home/csir/esp/esp-idf/components/esp_eth /home/csir/esp/esp-idf/components/esp_event /home/csir/esp/esp-idf/components/esp_gdbstub /home/csir/esp/esp-idf/components/esp_hid /home/csir/esp/esp-idf/components/esp_http_client /home/csir/esp/esp-idf/components/esp_http_server /home/csir/esp/esp-idf/components/esp_https_ota /home/csir/esp/esp-idf/components/esp_https_server /home/csir/esp/esp-idf/components/esp_hw_support /home/csir/esp/esp-idf/components/esp_lcd /home/csir/esp/esp-idf/components/esp_local_ctrl /home/csir/esp/esp-idf/components/esp_netif /home/csir/esp/esp-idf/components/esp_phy /home/csir/esp/esp-idf/components/esp_pm /home/csir/esp/esp-idf/components/esp_ringbuf /home/csir/esp/esp-idf/components/esp_rom /home/csir/esp/esp-idf/components/esp_serial_slave_link /home/csir/esp/esp-idf/components/esp_system /home/csir/esp/esp-idf/components/esp_timer /home/csir/esp/esp-idf/components/esp_websocket_client /home/csir/esp/esp-idf/components/esp_wifi /home/csir/esp/esp-idf/components/espcoredump /home/csir/esp/esp-idf/components/esptool_py /home/csir/esp/esp-idf/components/fatfs /home/csir/esp/esp-idf/components/freemodbus /home/csir/esp/esp-idf/components/freertos /home/csir/esp/esp-idf/components/hal /home/csir/esp/esp-idf/components/heap /home/csir/esp/esp-idf/components/http_parser /home/csir/esp/esp-idf/components/idf_test /home/csir/esp/esp-idf/components/ieee802154 /home/csir/esp/esp-idf/examples/common_components/iperf /home/csir/esp/esp-idf/components/json /home/csir/esp/esp-idf/examples/common_components/led_strip /home/csir/esp/esp-idf/components/log /home/csir/esp/esp-idf/components/lwip /home/csir/connectedhomeip/examples/all-clusters-app/esp32/main /home/csir/esp/esp-idf/components/mbedtls /home/csir/esp/esp-idf/components/mdns /home/csir/esp/esp-idf/components/mqtt /home/csir/esp/esp-idf/components/newlib /home/csir/esp/esp-idf/components/nvs_flash /home/csir/esp/esp-idf/components/openssl /home/csir/esp/esp-idf/components/openthread /home/csir/esp/esp-idf/components/partition_table /home/csir/esp/esp-idf/examples/common_components/pcap /home/csir/esp/esp-idf/components/perfmon /home/csir/esp/esp-idf/examples/common_components/pid_ctrl /home/csir/esp/esp-idf/components/protobuf-c /home/csir/esp/esp-idf/examples/common_components/protocol_examples_common /home/csir/esp/esp-idf/components/protocomm /home/csir/esp/esp-idf/components/pthread /home/csir/esp/esp-idf/examples/common_components/qrcode /home/csir/connectedhomeip/examples/common/screen-framework /home/csir/esp/esp-idf/components/sdmmc /home/csir/esp/esp-idf/components/soc /home/csir/esp/esp-idf/components/spi_flash /home/csir/connectedhomeip/examples/common/m5stack-tft/repo/components/spidriver /home/csir/esp/esp-idf/components/spiffs /home/csir/esp/esp-idf/components/tcp_transport /home/csir/esp/esp-idf/components/tcpip_adapter /home/csir/connectedhomeip/examples/common/m5stack-tft/repo/components/tft /home/csir/esp/esp-idf/components/tinyusb /home/csir/esp/esp-idf/components/ulp /home/csir/esp/esp-idf/components/unity /home/csir/esp/esp-idf/components/usb /home/csir/esp/esp-idf/components/vfs /home/csir/esp/esp-idf/components/wear_levelling /home/csir/esp/esp-idf/components/wifi_provisioning /home/csir/esp/esp-idf/components/wpa_supplicant /home/csir/esp/esp-idf/components/xtensa
-- Configuring done
-- Generating done
-- Build files have been written to: /home/csir/connectedhomeip/examples/all-clusters-app/esp32/build
[7/1126] Generating ../../partition_table/partition-table.bin
Partition table binary generated. Contents:
*******************************************************************************
# ESP-IDF Partition Table
# Name, Type, SubType, Offset, Size, Flags
nvs,data,nvs,0x9000,24K,
otadata,data,ota,0xf000,8K,
phy_init,data,phy,0x11000,4K,
ota_0,app,ota_0,0x20000,1500K,
ota_1,app,ota_1,0x1a0000,1500K,
ot_storage,data,58,0x317000,8K,
*******************************************************************************
[261/1126] Performing configure step for 'bootloader'
-- Building ESP-IDF components for target esp32
-- Project sdkconfig file /home/csir/connectedhomeip/examples/all-clusters-app/esp32/sdkconfig
-- Adding linker script /home/csir/esp/esp-idf/components/soc/esp32/ld/esp32.peripherals.ld
-- Adding linker script /home/csir/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.ld
-- Adding linker script /home/csir/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.api.ld
-- Adding linker script /home/csir/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.libgcc.ld
-- Adding linker script /home/csir/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.newlib-funcs.ld
-- Adding linker script /home/csir/esp/esp-idf/components/bootloader/subproject/main/ld/esp32/bootloader.ld
-- Adding linker script /home/csir/esp/esp-idf/components/bootloader/subproject/main/ld/esp32/bootloader.rom.ld
-- Components: bootloader bootloader_support efuse esp32 esp_common esp_hw_support esp_rom esp_system esptool_py freertos hal log main micro-ecc newlib partition_table soc spi_flash xtensa
-- Component paths: /home/csir/esp/esp-idf/components/bootloader /home/csir/esp/esp-idf/components/bootloader_support /home/csir/esp/esp-idf/components/efuse /home/csir/esp/esp-idf/components/esp32 /home/csir/esp/esp-idf/components/esp_common /home/csir/esp/esp-idf/components/esp_hw_support /home/csir/esp/esp-idf/components/esp_rom /home/csir/esp/esp-idf/components/esp_system /home/csir/esp/esp-idf/components/esptool_py /home/csir/esp/esp-idf/components/freertos /home/csir/esp/esp-idf/components/hal /home/csir/esp/esp-idf/components/log /home/csir/esp/esp-idf/components/bootloader/subproject/main /home/csir/esp/esp-idf/components/bootloader/subproject/components/micro-ecc /home/csir/esp/esp-idf/components/newlib /home/csir/esp/esp-idf/components/partition_table /home/csir/esp/esp-idf/components/soc /home/csir/esp/esp-idf/components/spi_flash /home/csir/esp/esp-idf/components/xtensa
-- Configuring done
-- Generating done
-- Build files have been written to: /home/csir/connectedhomeip/examples/all-clusters-app/esp32/build/bootloader
[270/1126] Performing build step for 'bootloader'
[1/1] cd /home/csir/connectedhomeip/examples/all-clusters-app/esp32/build/bootloader/esp-idf/esptool_py && /home/csir/.espressif/python_env/idf5.0_py3.8_env/bin/python /home/csir/esp/esp-idf/components/partition_table/check_sizes.py --offset 0x8000 bootloader 0x1000 /home/csir/connectedhomeip/examples/all-clusters-app/esp32/build/bootloader/bootloader.bin
Bootloader binary size 0x6360 bytes. 0xca0 bytes (11%) free.
[585/1125] Performing configure step for 'chip_gn'
FAILED: esp-idf/chip/chip_gn-prefix/src/chip_gn-stamp/chip_gn-configure 
cd /home/csir/connectedhomeip/examples/all-clusters-app/esp32/build/esp-idf/chip && /home/csir/depot_tools/gn --root=/home/csir/connectedhomeip/config/esp32 gen --check --fail-on-unused-args /home/csir/connectedhomeip/examples/all-clusters-app/esp32/build/esp-idf/chip && /usr/bin/cmake -E touch /home/csir/connectedhomeip/examples/all-clusters-app/esp32/build/esp-idf/chip/chip_gn-prefix/src/chip_gn-stamp/chip_gn-configure
gn.py: Could not find checkout in any parent of the current path.
This must be run inside a checkout.
[586/1125] Building C object esp-idf/esp_serial_slave_link/CMakeFiles/__idf_esp_serial_slave_link.dir/essl_spi.c.obj
ninja: build stopped: subcommand failed.
ninja failed with exit code 1

我可以看到问题出在文件 ~/depot_tools/gn.py 的第 50 行: bin_path = gclient_paths.GetBuildtoolsPlatformBinaryPath()

gclient_paths.GetBuildtoolsPlatformBinaryPath() 返回“无”

价值应该是多少?

4

0 回答 0