Error installing HX711 node

Hi,
I am quite inexperienced in working with Node-RED.
I want to build a scale with a Raspberry Pi.
The installation of a HX711 node is stopped by an error.

Error log

2023-03-12T18:53:49.224Z Installieren : node-red-contrib-hx711 1.0.7

2023-03-12T18:53:49.338Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-hx711@1.0.7
2023-03-12T18:53:50.557Z [err] npm
2023-03-12T18:53:50.559Z [err] WARN config
2023-03-12T18:53:50.559Z [err] production Use --omit=dev instead.
2023-03-12T18:54:05.640Z [err] npm
2023-03-12T18:54:05.640Z [err]
2023-03-12T18:54:05.641Z [err] ERR! code 1
2023-03-12T18:54:05.641Z [err] npm ERR! path
2023-03-12T18:54:05.642Z [err] /data/node_modules/@shroudedcode/hx711
2023-03-12T18:54:05.646Z [err] npm ERR! command failed
2023-03-12T18:54:05.647Z [err] npm ERR! command sh -c node-gyp rebuild
2023-03-12T18:54:05.647Z [err] npm ERR!
2023-03-12T18:54:05.647Z [err] make: Entering directory '/data/node_modules/@shroudedcode/hx711/build'
2023-03-12T18:54:05.647Z [err] npm ERR! CC(target) Release/obj.target/nothing/../../node-addon-api/src/nothing.o
2023-03-12T18:54:05.647Z [err] npm ERR! AR(target) Release/obj.target/../../node-addon-api/src/nothing.a
2023-03-12T18:54:05.647Z [err] npm ERR! COPY Release/nothing.a
2023-03-12T18:54:05.647Z [err] npm ERR!
2023-03-12T18:54:05.647Z [err] CXX(target) Release/obj.target/hx711/source/binding.o
2023-03-12T18:54:05.647Z [err] npm ERR! CXX(target) Release/obj.target/hx711/source/hx711.o
2023-03-12T18:54:05.647Z [err] npm ERR! make: Leaving directory '/data/node_modules/@shroudedcode/hx711/build'
2023-03-12T18:54:05.648Z [err] npm ERR! gyp info it worked if it ends with ok
2023-03-12T18:54:05.648Z [err] npm
2023-03-12T18:54:05.648Z [err] ERR! gyp info using node-gyp@9.0.0
2023-03-12T18:54:05.648Z [err] npm ERR! gyp info using node@16.16.0 | linux | arm
2023-03-12T18:54:05.648Z [err] npm ERR! gyp info find Python using Python version 3.10.5 found at "/usr/bin/python3"
2023-03-12T18:54:05.648Z [err] npm ERR!
2023-03-12T18:54:05.648Z [err] gyp info spawn /usr/bin/python3
2023-03-12T18:54:05.648Z [err] npm ERR! gyp info spawn args [
2023-03-12T18:54:05.648Z [err] npm ERR! gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
2023-03-12T18:54:05.648Z [err] npm ERR! gyp info spawn args 'binding.gyp',
2023-03-12T18:54:05.648Z [err] npm
2023-03-12T18:54:05.649Z [err] ERR! gyp info spawn args '-f',
2023-03-12T18:54:05.649Z [err] npm ERR! gyp info spawn args 'make',
2023-03-12T18:54:05.649Z [err] npm ERR! gyp info spawn args '-I',
2023-03-12T18:54:05.649Z [err] npm
2023-03-12T18:54:05.649Z [err] ERR! gyp info spawn args '/data/node_modules/@shroudedcode/hx711/build/config.gypi',
2023-03-12T18:54:05.649Z [err] npm ERR! gyp info spawn args '-I',
2023-03-12T18:54:05.649Z [err] npm ERR! gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
2023-03-12T18:54:05.649Z [err] npm ERR!
2023-03-12T18:54:05.649Z [err] gyp info spawn args '-I',
2023-03-12T18:54:05.649Z [err] npm ERR! gyp info spawn args '/root/.cache/node-gyp/16.16.0/include/node/common.gypi',
2023-03-12T18:54:05.649Z [err] npm ERR! gyp info spawn args '-Dlibrary=shared_library',
2023-03-12T18:54:05.649Z [err] npm ERR! gyp info spawn args '-Dvisibility=default',
2023-03-12T18:54:05.649Z [err] npm
2023-03-12T18:54:05.649Z [err] ERR! gyp info spawn args '-Dnode_root_dir=/root/.cache/node-gyp/16.16.0',
2023-03-12T18:54:05.649Z [err] npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
2023-03-12T18:54:05.649Z [err] npm ERR! gyp info spawn args '-Dnode_lib_file=/root/.cache/node-gyp/16.16.0/<(target_arch)/node.lib',
2023-03-12T18:54:05.649Z [err] npm ERR!
2023-03-12T18:54:05.650Z [err] gyp info spawn args '-Dmodule_root_dir=/data/node_modules/@shroudedcode/hx711',
2023-03-12T18:54:05.650Z [err] npm ERR! gyp info spawn args '-Dnode_engine=v8',
2023-03-12T18:54:05.650Z [err] npm ERR! gyp info spawn args '--depth=.',
2023-03-12T18:54:05.650Z [err] npm
2023-03-12T18:54:05.650Z [err] ERR! gyp info spawn args '--no-parallel',
2023-03-12T18:54:05.650Z [err] npm ERR! gyp info spawn args '--generator-output',
2023-03-12T18:54:05.650Z [err] npm ERR! gyp info spawn args 'build',
2023-03-12T18:54:05.650Z [err] npm
2023-03-12T18:54:05.650Z [err] ERR! gyp info spawn args '-Goutput_dir=.'
2023-03-12T18:54:05.650Z [err] npm ERR! gyp info spawn args ]
2023-03-12T18:54:05.650Z [err] npm ERR!
2023-03-12T18:54:05.650Z [err] gyp info spawn make
2023-03-12T18:54:05.650Z [err] npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
2023-03-12T18:54:05.650Z [err] npm ERR! ../source/hx711.cpp:4:10: fatal error: wiringPi.h: No such file or directory
2023-03-12T18:54:05.650Z [err] npm ERR!
2023-03-12T18:54:05.651Z [err] 4 | #include <wiringPi.h>
2023-03-12T18:54:05.651Z [err] npm ERR! | ^~~~~~~~~~~~
2023-03-12T18:54:05.651Z [err] npm ERR! compilation terminated.
2023-03-12T18:54:05.651Z [err] npm ERR!
2023-03-12T18:54:05.651Z [err] make: *** [hx711.target.mk:117: Release/obj.target/hx711/source/hx711.o] Error 1
2023-03-12T18:54:05.651Z [err] npm ERR! gyp ERR! build error
2023-03-12T18:54:05.651Z [err] npm ERR! gyp ERR! stack Error: make failed with exit code: 2
2023-03-12T18:54:05.651Z [err] npm
2023-03-12T18:54:05.651Z [err] ERR! gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
2023-03-12T18:54:05.651Z [err] npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:527:28)
2023-03-12T18:54:05.651Z [err] npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
2023-03-12T18:54:05.651Z [err] npm
2023-03-12T18:54:05.651Z [err] ERR! gyp ERR! System Linux 5.15.84-v7l+
2023-03-12T18:54:05.651Z [err] npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
2023-03-12T18:54:05.651Z [err] npm ERR! gyp ERR! cwd /data/node_modules/@shroudedcode/hx711
2023-03-12T18:54:05.652Z [err] npm ERR! gyp ERR! node -v v16.16.0
2023-03-12T18:54:05.652Z [err] npm ERR! gyp ERR! node-gyp -v v9.0.0
2023-03-12T18:54:05.652Z [err] npm ERR!
2023-03-12T18:54:05.652Z [err] gyp ERR! not ok
2023-03-12T18:54:05.658Z [err]
2023-03-12T18:54:05.658Z [err] npm ERR! A complete log of this run can be found in:
2023-03-12T18:54:05.658Z [err] npm
2023-03-12T18:54:05.658Z [err] ERR! /data/.npm/_logs/2023-03-12T18_53_50_483Z-debug-0.log
2023-03-12T18:54:05.673Z rc=1

I have installed WiringPi, although the official version is no longer available. Where is the problem?
https://github.com/WiringPi/WiringPi/tree/master/wiringPi

Is there an easier way to include a load cell in Node-RED?

Thanks for your help

Hi @Blubber welcome to the forum.

When ever you are opening a thread to ask for help you want to give some basic information

  1. what version of NR and node.js (you can get this from the Node-RED startup log)
  2. what device and os/release are you using?
  3. are you using 'HomeAssistant' or a Docker image?

How did you do the install, via the 'Manager palette' option or from a command line?

When ever I have an issue with a node, I always go to the node's GitHub page to see what issues there may be. You can get to it by clicking the flows tab here on the forum, enter the node's name, clicking on the node and then clicking the 'GitHub' link.

In your case if you go to the GitHub issues you will see two issues about installing the node.

You can open another issue and maybe the author of the node will help you out, but unfortunately the author doesn't seem to be responding to issues so you maybe out of luck with this node.

The node-RED version is 3.0.2 and the node.js version is 16.16.0

I use a RaspberryPi 4B 2GB
PRETTY_NAME=Raspbian GNU/Linux 11 (bullseye)"
NAME="Raspbian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye

I am using a docker image. Installed via IOTStack

First I tried this via Manager Palette and then via command line. Gives the error on both.

It just always says it didn't find WiringPi.h and then aborts. Should I have installed WiringPi directly in the Docker container somehow? I'm not quite through the work with containers yet in most tutorials but it is used so.

How do you install a node that is not available in the manager palette but only via Github? I would try it for example with the GitHub - rtoenniges/node-red-contrib-hx711: Simple NodeRed-Node to get the value from a hx711 attached to RaspberryPis GPIOs..
If I understand correctly I have to do this via docker exec -it.

Normally if you want to install a node without using the ‘Manage palette’ option, you would

  1. shut down node-red
  2. change to the .node-red folder
  3. run ‘npm install node-red-????? Where the ????? Would be the name of the node.

However, having never used Docker, I don’t know if that is the procedure to use.

As it turns out, a Docker container cannot access files outside the container, or only with certain permissions. That's why it can't find WiringPi.h either.
Because this is too complicated for me, I now just installed Node-RED normally on the Pi without Docker. The HX711 module could now be installed without problems.

Thanks zenofmud for your help. The hint if I run it normally or via Docker was good.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.