node-red / node-red-nodes

Extra nodes for Node-RED
Other
995 stars 595 forks source link

node-red-node-pi-mcp3008 - Failed to install #953

Open pow4all opened 2 years ago

pow4all commented 2 years ago

Hi,

I tried to install node-red-node-pi-mcp3008, but it failed.

Got following error messages:

pi@xxx:~/.node-red $ npm install mcp-spi-adc

> spi-device@3.1.2 install /home/pi/.node-red/node_modules/spi-device
> node-gyp rebuild

make: Verzeichnis „/home/pi/.node-red/node_modules/spi-device/build“ wird betreten
  CXX(target) Release/obj.target/spi/src/spi.o
cc1plus: error: unrecognized argument in option ‘-mfloat-abi=hard’
cc1plus: note: valid arguments to ‘-mfloat-abi=’ are:   softfp
cc1plus: error: unrecognized argument in option ‘-mfpu=vfp’
cc1plus: note: valid arguments to ‘-mfpu=’ are: auto crypto-neon-fp-armv8 fp-armv8 fpv4-sp-d16 fpv5-d16 fpv5-sp-d16 neon-fp-armv8 neon-fp16 neon-vfpv3 neon-vfpv4  vfp3 vfpv2 vfpv3 vfpv3-d16 vfpv3-d16-fp16 vfpv3-fp16 vfpv3xd vfpv3xd-fp16 vfpv4 vfpv4-d16; did you mean ‘vfp3’?
make: *** [spi.target.mk:119: Release/obj.target/spi/src/spi.o] Fehler 1
make: Verzeichnis „/home/pi/.node-red/node_modules/spi-device/build“ wird verlassen
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:285:12)
gyp ERR! System Linux 5.10.103-v7+
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pi/.node-red/node_modules/spi-device
gyp ERR! node -v v14.20.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! spi-device@3.1.2 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the spi-device@3.1.2 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/2022-09-27T21_09_54_305Z-debug.log

On my Raspberry Pi 3B I have installed:

node-red -v
27 Sep 23:30:02 - [info]

Willkommen bei Node-RED!
===================

27 Sep 23:30:02 - [info] Node-RED Version: v2.0.6
27 Sep 23:30:02 - [info] Node.js  Version: v14.20.1
27 Sep 23:30:02 - [info] Linux 5.10.103-v7+ arm LE

Any suggestions how to solve this issue? Thanks.

dceejay commented 2 years ago

You shouldn't need to load mcp-spi-adc separately Which version of the operating system are you using ? The latest Node-RED 2.x branch is 2.2.3 but I don't thin kit should affect this. Can you show the actual error when you try to install the node and not that npm module ?

pow4all commented 2 years ago

Thanks for getting into this.

I am wondering why my system is not on Node-RED 2.2.3, I updated with sudo apt get update and sudo apt upgrade.

My OS is:

pi@xxx:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

If I try to install the node directly in Node-RED I get following error:

-----------------------------------------------------------
2022-09-28T17:40:22.627Z Installieren : node-red-node-pi-mcp3008 0.5.2

2022-09-28T17:40:27.030Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-node-pi-mcp3008@0.5.2
2022-09-28T17:40:49.359Z [out] 
2022-09-28T17:40:49.359Z [out] > spi-device@3.1.2 install /home/pi/.node-red/node_modules/spi-device
2022-09-28T17:40:49.359Z [out] > node-gyp rebuild
2022-09-28T17:40:49.359Z [out] 
2022-09-28T17:40:57.333Z [out] make: Verzeichnis „/home/pi/.node-red/node_modules/spi-device/build“ wird betreten
2022-09-28T17:40:57.333Z [out]   CXX(target) Release/obj.target/spi/src/spi.o
2022-09-28T17:40:57.333Z [out] make: Verzeichnis „/home/pi/.node-red/node_modules/spi-device/build“ wird verlassen
2022-09-28T17:40:57.336Z [err] cc1plus: error: unrecognized argument in option ‘-mfloat-abi=hard’
2022-09-28T17:40:57.336Z [err] cc1plus: note: valid arguments to ‘-mfloat-abi=’ are:   softfp
2022-09-28T17:40:57.336Z [err] cc1plus: error: unrecognized argument in option ‘-mfpu=vfp’
2022-09-28T17:40:57.336Z [err] cc1plus: note: valid arguments to ‘-mfpu=’ are: auto crypto-neon-fp-armv8 fp-armv8 fpv4-sp-d16 fpv5-d16 fpv5-sp-d16  neon-fp-armv8 neon-fp16 neon-vfpv3 neon-vfpv4  vfp3 vfpv2 vfpv3 vfpv3-d16 vfpv3-d16-fp16 vfpv3-fp16 vfpv3xd vfpv3xd-fp16 vfpv4 vfpv4-d16; did you mean ‘vfp3’?
2022-09-28T17:40:57.336Z [err] make: *** [spi.target.mk:119: Release/obj.target/spi/src/spi.o] Fehler 1
2022-09-28T17:40:57.336Z [err] gyp ERR! build error 
2022-09-28T17:40:57.336Z [err] gyp ERR! stack Error: `make` failed with exit code: 2
2022-09-28T17:40:57.336Z [err] gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
2022-09-28T17:40:57.336Z [err] gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
2022-09-28T17:40:57.336Z [err] gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:285:12)
2022-09-28T17:40:57.336Z [err] gyp ERR! System Linux 5.10.103-v7+
2022-09-28T17:40:57.336Z [err] gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
2022-09-28T17:40:57.336Z [err] gyp ERR! cwd /home/pi/.node-red/node_modules/spi-device
2022-09-28T17:40:57.336Z [err] gyp ERR! node -v v14.20.1
2022-09-28T17:40:57.336Z [err] gyp ERR! node-gyp -v v5.1.0
2022-09-28T17:40:57.336Z [err] gyp ERR! not ok 
2022-09-28T17:40:57.336Z [err] npm ERR! code ELIFECYCLE
2022-09-28T17:40:57.336Z [err] npm ERR! errno 1
2022-09-28T17:40:57.336Z [err] npm ERR! spi-device@3.1.2 install: `node-gyp rebuild`
2022-09-28T17:40:57.336Z [err] npm ERR! Exit status 1
2022-09-28T17:40:57.336Z [err] npm ERR! 
2022-09-28T17:40:57.336Z [err] npm ERR! Failed at the spi-device@3.1.2 install script.
2022-09-28T17:40:57.336Z [err] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2022-09-28T17:40:57.336Z [err] 
2022-09-28T17:40:57.336Z [err] npm ERR! A complete log of this run can be found in:
2022-09-28T17:40:57.336Z [err] npm ERR!     /home/pi/.npm/_logs/2022-09-28T17_40_57_253Z-debug.log
2022-09-28T17:41:00.064Z rc=1

It is the same error posted in the previous post.

But I recognized that my hardware is Raspberry Pi 2 Model B Rev 1.1. Does it have any effect?

dceejay commented 2 years ago

apt will not update Node-RED for you unless it's a major release - you are better off using our install/upgrade script from the docs if you can. Also the base OS is buster - which should be OK though bullseye is the latest that we support.

The error is a weird one - it seems to be saying it's trying to compile for the wrong architecture. Which hardware do you really have ?

pow4all commented 2 years ago

OK thats my fault, I should read the instructions in detail.

My hardware is:

pi@xxx:~ $ sudo lshw -c system -c processor -sanitize
computer
    description: ARMv7 Processor rev 5 (v7l)
    product: Raspberry Pi 2 Model B Rev 1.1
    serial: [REMOVED]
    width: 32 bits
    capabilities: smp
  *-cpu:0
       description: CPU
       product: cpu
       physical id: 0
       bus info: cpu@0
       size: 900MHz
       capacity: 900MHz
       capabilities: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm cpufreq
  *-cpu:1
       description: CPU
       product: cpu
       physical id: 1
       bus info: cpu@1
       size: 900MHz
       capacity: 900MHz
       capabilities: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm cpufreq
  *-cpu:2
       description: CPU
       product: cpu
       physical id: 2
       bus info: cpu@2
       size: 900MHz
       capacity: 900MHz
       capabilities: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm cpufreq
  *-cpu:3
       description: CPU
       product: cpu
       physical id: 3
       bus info: cpu@3
       size: 900MHz
       capacity: 900MHz
       capabilities: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm cpufreq

Also see at attached picture. IMG_2684

pow4all commented 2 years ago

I updated my Node-RED according this instructions. It is now on Node-RED v3.0.2

I also tried once more to install nore-red-node-mcp3008 once again, it resulted in the same error message.

After some googling I found out that the Raspberry Pi 2 has an other CPU as other Raspi models. It looks like there are special options to build packages for Raspi 2. But I have no plan which module or program is responsible for that.

hardillb commented 2 years ago

It's the spi-device node's native component that is failing to build

fivdi commented 2 years ago

@pow4all as mentioned in issue https://github.com/fivdi/spi-device/issues/26, I would imagine that the problems that you are having are related to your system setup.