Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to use v1.1.0.1 SDK #20

Merged
merged 4 commits into from
Jun 30, 2023
Merged

Conversation

MonicaisHer
Copy link
Contributor

@MonicaisHer MonicaisHer commented Jun 15, 2023

This PR might resolve #19

Testing

I have tested the matter-pi-gpio-commander snap built from this PR locally, with the chip-tool snap built from this PR, and they both work as expected using the same version of Matter SDK v1.1.0.1. The matter-pi-gpio-commander snap could be commissioned and controlled by chip-tool snap.

build:

snapcraft -v --debug

install and setup matter-pi-gpio-commander:

sudo snap install ./matter-pi-gpio-commander_0.3.0_arm64.snap --dangerous
sudo snap set matter-pi-gpio-commander gpio=26

sudo snap connect matter-pi-gpio-commander:avahi-control
sudo snap connect matter-pi-gpio-commander:gpio-memory-control
sudo snap start matter-pi-gpio-commander

install and setup chip-tool:

sudo snap install ./chip-tool_v1.1.0.1+snap_arm64.snap --dangerous
sudo snap connect chip-tool:avahi-observe
sudo snap connect chip-tool:bluez

commison and control:

sudo chip-tool pairing onnetwork 110 20202021
sudo chip-tool onoff toggle 110 1

Upon successful execution, the LED on the Pi should be controlled by Chip Tool, turning it on or off.

@farshidtz
Copy link
Member

Remote build fails for arm64:

:: + [[ arm64 == \a\r\m\6\4 ]]
:: + ZAP_VERSION=v2023.05.04
:: + set -x
:: + mkdir -p /opt/zap-v2023.05.04
:: + git clone https://github.com/project-chip/zap.git /opt/zap-v2023.05.04
:: Cloning into '/opt/zap-v2023.05.04'...
:: + cd /opt/zap-v2023.05.04
:: + git checkout -b v2023.05.04
:: Switched to a new branch 'v2023.05.04'
:: + npm ci
:: npm WARN tarball tarball data for [email protected] (sha512-ql93vEUq6WsstGXD+SBLSIQw6SNnhbDEM0swzgugytMxLp3rT24Ag/jcC80ZHxiPRTdew1niuR7P3/FCrDqIjw==) seems to be corrupted. Trying one more time.
:: npm WARN lifecycle The node binary used for scripts is /snap/bin/node but npm is using /snap/node/6202/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
::
:: > [email protected] install /opt/zap-v2023.05.04/node_modules/utf-8-validate
:: > node-gyp-build
::
:: make: Entering directory '/opt/zap-v2023.05.04/node_modules/utf-8-validate/build'
::   CC(target) Release/obj.target/validation/src/validation.o
::   SOLINK_MODULE(target) Release/obj.target/validation.node
::   COPY Release/validation.node
:: make: Leaving directory '/opt/zap-v2023.05.04/node_modules/utf-8-validate/build'
::
:: > [email protected] install /opt/zap-v2023.05.04/node_modules/sqlite3
:: > node-pre-gyp install --fallback-to-build
::
:: [sqlite3] Success: "/opt/zap-v2023.05.04/node_modules/sqlite3/lib/binding/napi-v6-linux-glibc-arm64/node_sqlite3.node" is installed via remote
::
:: > [email protected] postinstall /opt/zap-v2023.05.04/node_modules/core-js
:: > node -e "try{require('./postinstall')}catch(e){}"
::
[16/Jun/2023:09:36:48 +0000] "CONNECT github.com:443 HTTP/1.1" 200 3772 "-" "-"
:: �[96mThank you for using core-js (�[94m https://github.com/zloirock/core-js �[96m) for polyfilling JavaScript standard library!�[0m
::
:: �[96mThe project needs your help! Please consider supporting of core-js:�[0m
:: �[96m>�[94m https://opencollective.com/core-js �[0m
:: �[96m>�[94m https://patreon.com/zloirock �[0m
:: �[96m>�[94m bitcoin: bc1qlea7544qtsmj2rayg0lthvza9fau63ux0fstcz �[0m
::
:: �[96mAlso, the author of core-js (�[94m https://github.com/zloirock �[96m) is looking for a good job -)�[0m
::
::
:: > [email protected] install /opt/zap-v2023.05.04/node_modules/canvas
:: > node-pre-gyp install --fallback-to-build --update-binary
::
:: node-pre-gyp ERR! install response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v72-linux-glibc-arm64.tar.gz
:: node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v72 ABI, glibc) (falling back to source compile with node-gyp)
:: node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.11.2/canvas-v2.11.2-node-v72-linux-glibc-arm64.tar.gz
:: Package pangocairo was not found in the pkg-config search path.
:: Perhaps you should add the directory containing `pangocairo.pc'
:: to the PKG_CONFIG_PATH environment variable
:: No package 'pangocairo' found
:: gyp: Call to 'pkg-config pangocairo --libs' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
:: gyp ERR! configure error
:: gyp ERR! stack Error: `gyp` failed with exit code: 1
:: gyp ERR! stack     at ChildProcess.onCpExit (/snap/node/6202/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
:: gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
:: gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
:: gyp ERR! System Linux 5.4.0-149-generic
:: gyp ERR! command "/snap/node/6202/bin/node" "/snap/node/6202/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--update-binary" "--module=/opt/zap-v2023.05.04/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/opt/zap-v2023.05.04/node_modules/canvas/build/Release" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72"
:: gyp ERR! cwd /opt/zap-v2023.05.04/node_modules/canvas
:: gyp ERR! node -v v12.22.12
:: gyp ERR! node-gyp -v v5.1.0
:: gyp ERR! not ok
:: node-pre-gyp ERR! build error
:: node-pre-gyp ERR! stack Error: Failed to execute '/snap/node/6202/bin/node /snap/node/6202/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --update-binary --module=/opt/zap-v2023.05.04/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/opt/zap-v2023.05.04/node_modules/canvas/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
:: node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/opt/zap-v2023.05.04/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
:: node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
:: node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1022:16)
:: node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
:: node-pre-gyp ERR! System Linux 5.4.0-149-generic
:: node-pre-gyp ERR! command "/snap/node/6202/bin/node" "/opt/zap-v2023.05.04/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--update-binary"
:: node-pre-gyp ERR! cwd /opt/zap-v2023.05.04/node_modules/canvas
:: node-pre-gyp ERR! node -v v12.22.12
:: node-pre-gyp ERR! node-pre-gyp -v v1.0.10
:: node-pre-gyp ERR! not ok
:: Failed to execute '/snap/node/6202/bin/node /snap/node/6202/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --update-binary --module=/opt/zap-v2023.05.04/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/opt/zap-v2023.05.04/node_modules/canvas/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
:: npm ERR! code ELIFECYCLE
:: npm ERR! errno 1
:: npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build --update-binary`
:: npm ERR! Exit status 1
:: npm ERR!
:: npm ERR! Failed at the [email protected] install script.
:: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
::
:: npm ERR! A complete log of this run can be found in:
:: npm ERR!     /root/.npm/_logs/2023-06-16T09_36_50_920Z-debug.log
'override-build' in part 'lighting' failed with code 1.

@farshidtz farshidtz changed the title Install ZAP for arm builds Upgrade to use v1.1.0.1 SDK Jun 30, 2023
@MonicaisHer
Copy link
Contributor Author

The changes on separate parts have been reverted due to building failure on arm64. Node.js and Zap installations need to be separated into a standalone part for better caching and clarity. I have created an issue for this purpose, which can be found #21.

Copy link
Member

@farshidtz farshidtz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes. At the same time with moving the zap build into a separate part, the new code should be refactored.

@farshidtz farshidtz merged commit af921e9 into canonical:main Jun 30, 2023
Comment on lines +88 to +90
wget https://nodejs.org/dist/v12.22.12/node-v12.22.12-linux-x64.tar.xz
tar xfvJ node-v12.22.12-linux-x64.tar.xz
cp -rn node-v12.22.12-linux-x64/. /opt/node-v12.22.12-linux-x64/
Copy link
Member

@farshidtz farshidtz Jul 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was overlooked during my code review. This installs an x64 distribution of Nodejs on arm64.

Fix: #22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing zap-cli fails arm64 builds
2 participants