Loading... # 重要提示 在虚拟机里使用chip-tool调试时必须连接蓝牙。 构建如果报错,尝试更新 cd /home/ooo/ncs/v2.7.0/modules/lib/matter/ source scripts/activate.sh ``` git submodule sync && git submodule update --init git submodule update --init --recursive ``` pip install --upgrade setuptools # VS code安装SDK提示git-remote-https: error while loading shared libraries: libunistring.so.2: 尝试了 sudo apt install libunistring-dev;没有用。我相信我是通过 .deb 安装的。我安装了最新的 v2.7.0 工具链。 机器有二进制文件: /snap/core22/1621/usr/lib/x86_64-linux-gnu/libunistring.so.2 /snap/core22/1663/usr/lib/x86_64-linux-gnu/libunistring.so.2 正在执行: sudo ln -s /snap/core22/1663/usr/lib/x86_64-linux-gnu/libunistring.so.2 /usr/lib/libunistring.so.2 有效。希望这对某些人有帮助。 解决方案:https://devzone.nordicsemi.com/f/nordic-q-a/106982/error-installing-nrf-connect-sdk-in-vscode-linux-libunistring-so-2-cannot-open-shared-object-file-no-such-file-or-directory ``` sudo ln -s /snap/core22/1663/usr/lib/x86_64-linux-gnu/libunistring.so.2 /usr/lib/libunistring.so.2 ``` # 执行“scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/provider chip_config_network_layer_ble=false” 报错 “ImportError: libffi.so.7: cannot open shared object file: No such file or directory” 自 Ubuntu 20.10 起,不再包含 libffi.so.7,而是 libffi.so.8。解决方案是手动查找并安装 libffi.so.7。搜索了一下,在这里找到了: https://devzone.nordicsemi.com/f/nordic-q-a/102682/sidewalk-failed-at-run-device-provisioning-scripts ``` wget http://es.archive.ubuntu.com/ubuntu/pool/main/libf/libffi/libffi7_3.3-4_amd64.deb sudo dpkg -i libffi7_3.3-4_amd64.deb ``` # 22.04 运行环境更新命令“source ./scripts/activate.sh”时遇到错误 ImportError: cannot import name 'OneStyleAndTextTuple' from 'prompt_toolkit.formatted_text' 通过更改 prompt-toolkit 的版本来解决这个问题,该版本位于文件 scripts/setup/constraints.txt 中。搜索 prompt-toolkit 并将版本更改为 3.0.43。 # 22.04安装python3.8 https://www.cnblogs.com/jsxubar/p/17622352.html ``` # 推荐用这个方法,手动添加源,不用 add-apt-repository 命令添加源 sudo echo 'deb https://launchpad.proxy.ustclug.org/deadsnakes/ppa/ubuntu/ jammy main' >>/etc/apt/sources.list sudo apt-get update # 这时会有个报错提示: # W: GPG error: https://launchpad.proxy.ustclug.org/deadsnakes/ppa/ubuntu jammy InRelease: The following signatures couldn't be verified because the public key is not available: # NO_PUBKEY BA6932366A755776 # E: The repository 'https://launchpad.proxy.ustclug.org/deadsnakes/ppa/ubuntu jammy InRelease' is not signed. # 导入这个key,key的id从报错信息里拿 sudo apt install -y gnupg apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA6932366A755776 sudo apt-get update sudo apt-get install -y python3.8 libpython3.8-dev python3.8-dev python3.8-distutils # 安装 pip wget https://bootstrap.pypa.io/get-pip.py python3.8 get-pip.py # 加下软链接 sudo ln -s /usr/bin/python3.8 /usr/bin/python3 sudo ln -s /usr/bin/python3.8 /usr/bin/python # 设置下国内镜像源 sudo pip3 config set global.index-url https://mirrors.aliyun.com/pypi/simple ``` # 没有32.768kHz晶振程序运行不正常 在prj.config加入以下配置: ``` CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y # CONFIG_CLOCK_CONTROL_NRF_K32SRC_500PPM=y CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION=y # CONFIG_CLOCK_CONTROL_NRF_CALIBRATION_LF_ALWAYS_ON=y # CONFIG_MULTITHREADING=y ``` 解决方法参考来源: > https://devzone.nordicsemi.com/f/nordic-q-a/99282/nrf5340-custom-board-not-running-to-main-without-external-lf-crystal?ReplySortBy=CreatedDate&ReplySortOrder=Descending > https://devzone.nordicsemi.com/f/nordic-q-a/93836/using-the-internal-lfrc-oscillator-with-nrf-connect-sdk?ReplyFilter=Answers&ReplySortBy=Answers&ReplySortOrder=Descending # 工厂信息配置 ``` # CONFIG_CHIP_DEVICE_VENDOR_ID=65522 # CONFIG_CHIP_DEVICE_PRODUCT_ID=32769 # CONFIG_CHIP_DEVICE_SERIAL_NUMBER="315s6d41a1d5as" ``` # OTA笔记 scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/provider chip_config_network_layer_ble=false scripts/examples/gn_build_example.sh examples/chip-tool out/chiptool 'chip_mdns="platform"' ./out/provider/chip-ota-provider-app -f matter.ota ./out/chiptool/chip-tool pairing onnetwork 1 20202021 ./out/chiptool/chip-tool pairing ble-thread 2 hex:0e080000000000010000000300000f35060004001fffe0020811111111222222220708fdbb98e2c5b48d83051000112233445566778899aabbccddeeff030f4f70656e5468726561642d30783939010212340410b249158bbefc5b54fb32033e89f034ed0c0402a0f7f8 20202021 3840 ./out/chiptool/chip-tool otasoftwareupdaterequestor write default-otaproviders '[{"fabricIndex": 1, "providerNodeID": 1, "endpoint": 0}]' 2 0 ./out/chiptool/chip-tool accesscontrol write acl '[{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [112233], "targets": null}, {"fabricIndex": 1, "privilege": 3, "authMode": 2, "subjects": null, "targets": null}]' 1 0 ./out/chiptool/chip-tool otasoftwareupdaterequestor announce-otaprovider 1 0 0 0 2 0 Installing pip requirements for all... ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. libusb 1.0.27 requires setuptools>=68.2.2, but you have setuptools 68.0.0 which is incompatible. pkg-about 1.1.5 requires packaging>=23.2.0, but you have packaging 23.0 which is incompatible. pkg-about 1.1.5 requires setuptools>=68.2.2, but you have setuptools 68.0.0 which is incompatible. [notice] A new release of pip is available: 24.0 -> 24.3.1 [notice] To update, run: pip install --upgrade pip # OTA升级 ``` 655604 [DIS]OperationalSessionSetup[1:0000000000000001]: State change 1 --> 5 I: 655605 [EM]<<< [E:46637i S:29419 M:157517633] (S) Msg TX to 1:0000000000000001 [A332] [UDP:[fd11:1111:1122:2222:8583:d6fa:22ad:2bf6]:5540] --- Type 0001:08 (IM:InvokeCommandRequest) D: 655610 [SWU]Downloaded 1042190/1042190 bytes I: 655682 [EM]>>> [E:46637i S:29419 M:96119763 (Ack:157517633)] (S) Msg RX from 1:0000000000000001 [A332] --- Type 0001:09 (IM:InvokeCommandResponse) I: 655683 [DMG]Received Command Response Data, Endpoint=0 Cluster=0x0000_0029 Command=0x0000_0003 D: 655684 [SWU]ApplyUpdateResponse: D: 655684 [SWU] action: 0 D: 655684 [SWU] delayedActionTime: 0 seconds I: 655686 [EM]<<< [E:46637i S:29419 M:157517634 (Ack:96119763)] (S) Msg TX to 1:0000000000000001 [A332] [UDP:[fd11:1111:1122:2222:8583:d6fa:22ad:2bf6]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) I: 655704 [EM]>>> [E:46636i S:29419 M:96119764 (Ack:157517632)] (S) Msg RX from 1:0000000000000001 [A332] --- Type 0000:10 (SecureChannel:StandaloneAck) ``` 00> D: 651685 [DIS]OperationalSessionSetup[1:0000000000000001]: State change 1 --> 5 00> I: 651687 [EM]<<< [E:10485i S:20988 M:213409135] (S) Msg TX to 1:0000000000000001 [88B8] [UDP:[fd11:1111:1122:2222:8583:d6fa:22ad:2bf6]:5540] --- Type 0001:08 (IM:InvokeCommandRequest) 00> D: 651690 [SWU]Downloaded 898754/898754 bytes 00> I: 651691 [EM]>>> [E:10484i S:20988 M:152294436 (Ack:213409134)] (S) Msg RX from 1:0000000000000001 [88B8] --- Type 0000:10 (SecureChannel:StandaloneAck) 00> I: 651767 [EM]>>> [E:10485i S:20988 M:152294437 (Ack:213409135)] (S) Msg RX from 1:0000000000000001 [88B8] --- Type 0001:09 (IM:InvokeCommandResponse) 00> I: 651769 [DMG]Received Command Response Data, Endpoint=0 Cluster=0x0000_0029 Command=0x0000_0003 00> D: 651769 [SWU]ApplyUpdateResponse: 00> D: 651769 [SWU] action: 0 00> D: 651770 [SWU] delayedActionTime: 0 seconds 00> I: 651771 [EM]<<< [E:10485i S:20988 M:213409136 (Ack:152294437)] (S) Msg TX to 1:0000000000000001 [88B8] [UDP:[fd11:1111:1122:2222:8583:d6fa:22ad:2bf6]:5540] --- Type 0000:10 (SecureChannel:StandaloneAck) # ZAP生成代码命令 ``` #cd C:\ncs\v2.7.0\modules\lib\matter #python ./scripts/tools/zap/generate.py C:\ncs\light_power_270\src\light_power.zap -t src/app/zap-templates/app-templates.json -o C:\ncs\light_power_270/src/zap-generated ``` 最后修改:2024 年 12 月 05 日 © 允许规范转载 赞 如果觉得我的文章对你有用,请随意赞赏