Trying to run Z2M on Ornage PI Zero, faling on install

Hi all I have an old orange pi zero
https://www.armbian.com/orange-pi-zero/

small board with ETH ,power and one USB sounds like a dream to only run Z2M
but i am having trouble with install using the DOCS

my setup till now is like this maybe i am missing something

O PI Zero
CC2531 not connected yet… still on my old setup
OS: armbian (buster, and i am not sure what it means there is also bionic version )
maybe i need to install something that is not in the docs?
maybe i need to enable something?

i got to the pioint below after Git clone
when i do npm install
i am getting errors

i tried with every sudo and vodoo method out there please help!!! :slight_smile:

prebuild-install WARN install No prebuilt binaries found (target=12.14.0 runtime=node arch=arm libc= platform=linux)
Traceback (most recent call last):
  File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 47, in <module>
    import gyp
  File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 10, in <module>
    import gyp.input
  File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 7, in <module>
    import ast
ImportError: No module named ast
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Linux 5.3.9-sunxi
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /opt/zigbee2mqtt/node_modules/zigbee-herdsman/node_modules/@serialport/bindings
gyp ERR! node -v v12.14.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm WARN tsutils@3.17.1 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/zigbee-herdsman/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @serialport/bindings@8.0.4 install: `prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @serialport/bindings@8.0.4 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!     /home/pi/.npm/_logs/2020-01-02T20_56_08_587Z-debug.log

when i do sudo npm install

> @serialport/bindings@8.0.4 install /opt/zigbee2mqtt/node_modules/zigbee-herdsman/node_modules/@serialport/bindings
> prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild

prebuild-install WARN install EACCES: permission denied, access '/root/.npm'
gyp WARN EACCES current user ("pi") does not have permission to access the dev dir "/root/.cache/node-gyp/12.14.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/opt/zigbee2mqtt/node_modules/zigbee-herdsman/node_modules/@serialport/bindings/.node-gyp"
Traceback (most recent call last):
  File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 47, in <module>
    import gyp
  File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 10, in <module>
    import gyp.input
  File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 7, in <module>
    import ast
ImportError: No module named ast
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Linux 5.3.9-sunxi
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /opt/zigbee2mqtt/node_modules/zigbee-herdsman/node_modules/@serialport/bindings
gyp ERR! node -v v12.14.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm WARN tsutils@3.17.1 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/zigbee-herdsman/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @serialport/bindings@8.0.4 install: `prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @serialport/bindings@8.0.4 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/2020-01-02T20_03_23_649Z-debug.log

This should be the clue :

yep so did the all the below

  1. sudo chown -R pi:pi /opt/zigbee2mqtt
  2. install with sudo
  3. sudo -i
    3.install as root …
  4. install with --unsafe-perm
  5. sudo npm install -g --allow-root
  6. add pi to souders

nothing works!!!

Did you try su ?
(20 chars minimum)

no can you please explain ??

You enter su on the command line. Then everything after this command is executed as superuser (root)

nothing helps i guess i missing something on this armbian distro
something not installed by docs maybe if anyone has experience with armbian please tell me :slight_smile:

Hi I tryed to run Z2M on orange pi zero and I’m gettin errors.
Linux: Armbian_20.02.0-rc1_Orangepizero_buster_current_5.4.14.img

Do you have any ideas?

orangepi@orangepizero:~$ sudo git clone GitHub - Koenkk/zigbee2mqtt: Zigbee 🐝 to MQTT bridge 🌉, get rid of your proprietary Zigbee bridges 🔨 /opt/zigbee2mqtt

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.

[sudo] password for orangepi:
Cloning into ‘/opt/zigbee2mqtt’…
remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 8624 (delta 0), reused 1 (delta 0), pack-reused 8618
Receiving objects: 100% (8624/8624), 11.88 MiB | 4.27 MiB/s, done.
Resolving deltas: 100% (6181/6181), done.
orangepi@orangepizero:~$ sudo chown -R orangepi:orangepi /opt/zigbee2mqtt
orangepi@orangepizero:~$ cd /opt/zigbee2mqtt/
orangepi@orangepizero:/opt/zigbee2mqtt$ npm install

@serialport/bindings@8.0.6 install /opt/zigbee2mqtt/node_modules/zigbee-herdsman/node_modules/@serialport/bindings
prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild

prebuild-install WARN install No prebuilt binaries found (target=12.14.1 runtime=node arch=arm libc= platform=linux)
Traceback (most recent call last):
File “/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py”, line 47, in
import gyp
File “/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/init.py”, line 10, in
import gyp.input
File “/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py”, line 7, in
import ast
ImportError: No module named ast
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack at ChildProcess.emit (events.js:223:5)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Linux 5.4.14-sunxi
gyp ERR! command “/usr/bin/node” “/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” “rebuild”
gyp ERR! cwd /opt/zigbee2mqtt/node_modules/zigbee-herdsman/node_modules/@serialport/bindings
gyp ERR! node -v v12.14.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules/zigbee-herdsman/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“arm”})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/zigbee-herdsman-converters/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“arm”})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“arm”})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @serialport/bindings@8.0.6 install: prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @serialport/bindings@8.0.6 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! /home/orangepi/.npm/_logs/2020-01-27T10_49_25_422Z-debug.log
orangepi@orangepizero:/opt/zigbee2mqtt$

orangepi@orangepizero:/opt/zigbee2mqtt$ ls -l /dev/ttyACM0
crw-rw---- 1 root dialout 166, 0 Jan 26 00:34 /dev/ttyACM0
orangepi@orangepizero:/opt/zigbee2mqtt$

Have you tried running it in Docker?
It usually takes care of all the dependencies for you and keeps it all containerised.

Something like this although it might not be 100% as I’m reworking a docker-compose file.

  • curl -fsSL https://get.docker.com -o get-docker.sh
  • sh get-docker.sh
  • sudo usermod -aG docker $your_user
  • restart your session to load the group add in
  • finally
 docker run -d \
  --name zigbee2mqtt \
  --restart unless-stopped \
  -v /opt/zigbee2mqtt/data:/app/data \
  --device=/dev/ttyACM0 \
  -e TZ=Europe/London \
  -v /run/udev:/run/udev:ro \
  --privileged=true \
  koenkk/zigbee2mqtt

Thanks,
I’ve tried, but Docher hardware requirementr are to hight, its only Orange Pi Zero H2 Quad Core 256MB RAM:).When I install Docker the system has crushed.