Error inquiry when running run_zaptool

Hi

I use the nRF52840 board and am currently working on a Matter project.

I am trying to add a cluster to an existing Matter sample project as per the link guide below.

https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/ug_matter_creating_accessory.html

However, when run_zaptool.sh is executed, the following error occurs.

classic037  ~/Desktop/Matter/ncs/modules/lib/matter  ➦ 0ad8f70d5 ±  ./scripts/tools/zap/run_zaptool.sh ../../../nrf/samples/matter/sensor/src/template.zap
Rocket Executing: git log -1 --format={"hash": "%H","timestamp": %ct}
Mag Git commit: e9277b989f1d128bc881e88ecbf7a3353c841c39 from Wed May 11 2022 23:45:40 GMT+0900 (대한민국 표준시)
Mag Current src hash: aqrjjVB67BD5DC9iha9ORJah5zc=
Mag Current src-shared hash: nOWlRqSeZbEDOkt+AnCdf01DNYM=
Mag Previous src hash: aqrjjVB67BD5DC9iha9ORJah5zc=
Mag Previous src-shared hash: nOWlRqSeZbEDOkt+AnCdf01DNYM=
Thumbsup There were no changes to front-end code, so we don't have to rebuild the SPA.
Rocket Executing: npx tsc --build ./tsconfig.json
Rocket Executing: npx copyfiles -V ./src-electron/**/*.sql ./dist/
unglobed path: ./src-electron/db/zap-schema.sql
copy from: ./src-electron/db/zap-schema.sql
copy to: dist/src-electron/db/zap-schema.sql
Rocket Executing: npx electron /Users/classic037/Desktop/Matter/ncs/modules/lib/matter/third_party/zap/repo/dist/src-electron/ui/main-ui.js --logToStdout --gen /Users/classic037/Desktop/Matter/ncs/modules/lib/matter/src/app/zap-templates/app-templates.json --zcl /Users/classic037/Desktop/Matter/ncs/modules/lib/matter/src/app/zap-templates/zcl/zcl.json -i /Users/classic037/Desktop/Matter/ncs/nrf/samples/matter/sensor/src/template.zap
⇝ Electron failed to install correctly, please delete node_modules/electron and try installing again
Thumbsdown Program npx exited with error code: 1

I use a MacBook Pro M1 and do the above in Mac OS 12.2.1 environment.

Please help and guide

Thank you!

Parents Reply Children
  • Hi

    Thanks to your guide, I succeeded in running zaptool.

    However, after adding and saving the cluster ID in Zigbee Cluster Configurator, the following error occurs when executing the following command.

    ./scripts/tools/zap/generate.py ../../../nrf/samples/matter/sensor/src/template.zap

    ✘ classic037  ~/Desktop/Matter/ncs/modules/lib/matter  ➦ 0ad8f70d5 ±  ./scripts/tools/zap/generate.py ../../../nrf/samples/matter/light_bulb/src/light_bulb.zap
    Rocket Executing: git log -1 --format={"hash": "%H","timestamp": %ct}
    Mag Git commit: e9277b989f1d128bc881e88ecbf7a3353c841c39 from Wed May 11 2022 23:45:40 GMT+0900 (대한민국 표준시)
    Rocket Executing: npx tsc --build ./tsconfig.json
    Rocket Executing: npx copyfiles -V ./src-electron/**/*.sql ./dist/
    unglobed path: ./src-electron/db/zap-schema.sql
    copy from: ./src-electron/db/zap-schema.sql
    copy to: dist/src-electron/db/zap-schema.sql
    Rocket Executing: node /Users/classic037/Desktop/Matter/ncs/modules/lib/matter/third_party/zap/repo/dist/src-electron/main-process/main.js generate --noUi --noServer --stateDirectory ~/.zap --zcl /Users/classic037/Desktop/Matter/ncs/modules/lib/matter/src/app/zap-templates/zcl/zcl.json --generationTemplate /Users/classic037/Desktop/Matter/ncs/modules/lib/matter/src/app/zap-templates/app-templates.json --out /Users/classic037/Desktop/Matter/ncs/modules/lib/matter/../../../nrf/samples/matter/light_bulb/src/zap-generated/ /Users/classic037/Desktop/Matter/ncs/modules/lib/matter/../../../nrf/samples/matter/light_bulb/src/light_bulb.zap
    Robot ZAP generation started:
     Mag input files: /Users/classic037/Desktop/Matter/ncs/modules/lib/matter/../../../nrf/samples/matter/light_bulb/src/light_bulb.zap
     Mag output pattern: /Users/classic037/Desktop/Matter/ncs/modules/lib/matter/../../../nrf/samples/matter/light_bulb/src/zap-generated/
     Mag using templates: /Users/classic037/Desktop/Matter/ncs/modules/lib/matter/src/app/zap-templates/app-templates.json
     Mag using zcl data: /Users/classic037/Desktop/Matter/ncs/modules/lib/matter/src/app/zap-templates/zcl/zcl.json
     Mag zap version: ver. 2022.5.11, featureLevel 70, commit: e9277b989f1d128bc881e88ecbf7a3353c841c39 from 2022-05-11T14:45:40.000Z, mode: source
    Clock1 Setup time: 504ms
    Point right using input file: /Users/classic037/Desktop/Matter/ncs/modules/lib/matter/../../../nrf/samples/matter/light_bulb/src/light_bulb.zap
    Point right using output destination: /Users/classic037/Desktop/Matter/ncs/modules/lib/matter/../../../nrf/samples/matter/light_bulb/src/zap-generated/
    Clock1 File loading time: 67ms
    Robot Generating files:
     Writing hand /Users/classic037/Desktop/Matter/ncs/nrf/samples/matter/light_bulb/src/zap-generated/gen_tokens.h
     Writing hand /Users/classic037/Desktop/Matter/ncs/nrf/samples/matter/light_bulb/src/zap-generated/PluginApplicationCallbacks.h
     Writing hand /Users/classic037/Desktop/Matter/ncs/nrf/samples/matter/light_bulb/src/zap-generated/callback-stub.cpp
     Writing hand /Users/classic037/Desktop/Matter/ncs/nrf/samples/matter/light_bulb/src/zap-generated/gen_config.h
     Writing hand /Users/classic037/Desktop/Matter/ncs/nrf/samples/matter/light_bulb/src/zap-generated/CHIPClusters.h
     Writing hand /Users/classic037/Desktop/Matter/ncs/nrf/samples/matter/light_bulb/src/zap-generated/Clusters.matter
     Writing hand /Users/classic037/Desktop/Matter/ncs/nrf/samples/matter/light_bulb/src/zap-generated/endpoint_config.h
     Writing hand /Users/classic037/Desktop/Matter/ncs/nrf/samples/matter/light_bulb/src/zap-generated/IMClusterCommandHandler.cpp
     Writing hand /Users/classic037/Desktop/Matter/ncs/nrf/samples/matter/light_bulb/src/zap-generated/CHIPClientCallbacks.h
     Writing hand /Users/classic037/Desktop/Matter/ncs/nrf/samples/matter/light_bulb/src/zap-generated/access.h
    Clock1 Generation time: 434ms
    Sunglasses All done: 2s 745ms.
    clang-format error: [Errno 2] No such file or directory: 'clang-format'

    Is there any guide for the above error as well? please.

    thank you

  • Hi,

    I got the same error as you when running generate.py. Installing clang-format should fix the issue.

    I have also asked the development team if this is a bug and if it is something they are aware of, and I am currently waiting on a response.

    Best regards,

    Marte

  • Hi

    I installed clang-format and it was solved! thank you so much
    thank you!!!!!!!!

Related