Node red ncd-red-mcp23008 fails install

Hi all,

I'm trying to install this node but it's failing and I don't see the reason....anyone smarter than me is seeing it?
If so, THANKS!!!!!

Here is the log:


2021-07-11T14:06:21.014Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production ncd-red-mcp23008@1.5.5
2021-07-11T14:06:32.066Z [err] npm
2021-07-11T14:06:32.066Z [err]  ERR! code 1
2021-07-11T14:06:32.066Z [err] npm ERR! path /Users/rob/.node-red/node_modules/@serialport/bindings
2021-07-11T14:06:32.067Z [err] npm ERR! command failed
2021-07-11T14:06:32.067Z [err] npm ERR! 
2021-07-11T14:06:32.067Z [err] command sh -c prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild
2021-07-11T14:06:32.067Z [err] npm ERR! CXX(target) Release/obj.target/bindings/src/serialport.o
2021-07-11T14:06:32.067Z [err] npm ERR! gyp info it worked if it ends with ok
2021-07-11T14:06:32.067Z [err] npm ERR! gyp info using node-gyp@7.1.2
2021-07-11T14:06:32.067Z [err] npm ERR!
2021-07-11T14:06:32.067Z [err]  gyp info using node@14.17.1 | darwin | x64
2021-07-11T14:06:32.067Z [err] npm ERR! gyp info find Python using Python version 3.9.5 found at "/Library/Frameworks/Python.framework/Versions/3.9/bin/python3"
2021-07-11T14:06:32.067Z [err] npm ERR! gyp info spawn /Library/Frameworks/Python.framework/Versions/3.9/bin/python3
2021-07-11T14:06:32.067Z [err] npm ERR!
2021-07-11T14:06:32.067Z [err]  gyp info spawn args [
2021-07-11T14:06:32.067Z [err] npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
2021-07-11T14:06:32.067Z [err] npm ERR! gyp info spawn args   'binding.gyp',
2021-07-11T14:06:32.067Z [err] npm ERR! gyp info spawn args   '-f',
2021-07-11T14:06:32.067Z [err] npm ERR! gyp info spawn args   'make',
2021-07-11T14:06:32.067Z [err] npm 
2021-07-11T14:06:32.067Z [err] ERR! gyp info spawn args   '-I',
2021-07-11T14:06:32.067Z [err] npm ERR!
2021-07-11T14:06:32.067Z [err]  gyp info spawn args   '/Users/rob/.node-red/node_modules/@serialport/bindings/build/config.gypi',
2021-07-11T14:06:32.067Z [err] npm ERR! gyp info spawn args   '-I',
2021-07-11T14:06:32.067Z [err] npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
2021-07-11T14:06:32.067Z [err] npm
2021-07-11T14:06:32.067Z [err]  ERR! gyp info spawn args   '-I',
2021-07-11T14:06:32.067Z [err] npm ERR!
2021-07-11T14:06:32.067Z [err]  gyp info spawn args   '/Users/rob/Library/Caches/node-gyp/14.17.1/include/node/common.gypi',
2021-07-11T14:06:32.067Z [err] npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
2021-07-11T14:06:32.067Z [err] npm
2021-07-11T14:06:32.067Z [err]  ERR! gyp info spawn args   '-Dvisibility=default',
2021-07-11T14:06:32.067Z [err] npm 
2021-07-11T14:06:32.067Z [err] ERR! gyp info spawn args   '-Dnode_root_dir=/Users/rob/Library/Caches/node-gyp/14.17.1',
2021-07-11T14:06:32.067Z [err] npm
2021-07-11T14:06:32.067Z [err]  ERR! gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
2021-07-11T14:06:32.067Z [err] npm
2021-07-11T14:06:32.067Z [err]  ERR! gyp info spawn args   '-Dnode_lib_file=/Users/rob/Library/Caches/node-gyp/14.17.1/<(target_arch)/node.lib',
2021-07-11T14:06:32.067Z [err] npm
2021-07-11T14:06:32.067Z [err]  ERR! gyp info spawn args   '-Dmodule_root_dir=/Users/rob/.node-red/node_modules/@serialport/bindings',
2021-07-11T14:06:32.067Z [err] npm ERR!
2021-07-11T14:06:32.067Z [err]  gyp info spawn args   '-Dnode_engine=v8',
2021-07-11T14:06:32.067Z [err] npm ERR!
2021-07-11T14:06:32.067Z [err]  gyp info spawn args   '--depth=.',
2021-07-11T14:06:32.067Z [err] npm 
2021-07-11T14:06:32.067Z [err] ERR! gyp info spawn args   '--no-parallel',
2021-07-11T14:06:32.067Z [err] npm
2021-07-11T14:06:32.067Z [err]  ERR! gyp info spawn args   '--generator-output',
2021-07-11T14:06:32.067Z [err] npm
2021-07-11T14:06:32.067Z [err]  ERR! gyp info spawn args   'build',
2021-07-11T14:06:32.067Z [err] npm ERR!
2021-07-11T14:06:32.067Z [err]  gyp info spawn args   '-Goutput_dir=.'
2021-07-11T14:06:32.067Z [err] npm 
2021-07-11T14:06:32.067Z [err] ERR! gyp info spawn args ]
2021-07-11T14:06:32.067Z [err] npm
2021-07-11T14:06:32.067Z [err]  ERR! No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.
2021-07-11T14:06:32.067Z [err] npm 
2021-07-11T14:06:32.067Z [err] ERR! 
2021-07-11T14:06:32.067Z [err] npm
2021-07-11T14:06:32.067Z [err]  ERR! No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.
2021-07-11T14:06:32.067Z [err] npm ERR!
2021-07-11T14:06:32.067Z [err]  
2021-07-11T14:06:32.067Z [err] npm ERR!
2021-07-11T14:06:32.067Z [err]  No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.
2021-07-11T14:06:32.067Z [err] npm 
2021-07-11T14:06:32.067Z [err] ERR! 
2021-07-11T14:06:32.067Z [err] npm
2021-07-11T14:06:32.067Z [err]  ERR! gyp info spawn make
2021-07-11T14:06:32.067Z [err] npm ERR!
2021-07-11T14:06:32.067Z [err]  gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
2021-07-11T14:06:32.067Z [err] npm ERR!
2021-07-11T14:06:32.067Z [err]  ../src/serialport.cpp:329:14: error: no matching member function for call to 'Set'
2021-07-11T14:06:32.067Z [err] npm 
2021-07-11T14:06:32.067Z [err] ERR!     results->Set(Nan::New<v8::String>("cts").ToLocalChecked(), Nan::New<v8::Boolean>(data->cts));
2021-07-11T14:06:32.067Z [err] npm
2021-07-11T14:06:32.067Z [err]  ERR!     ~~~~~~~~~^~~
2021-07-11T14:06:32.067Z [err] npm
2021-07-11T14:06:32.067Z [err]  ERR! /Users/rob/Library/Caches/node-gyp/14.17.1/include/node/v8.h:3670:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
2021-07-11T14:06:32.067Z [err] npm ERR!
2021-07-11T14:06:32.068Z [err]    V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
2021-07-11T14:06:32.068Z [err] npm 
2021-07-11T14:06:32.068Z [err] ERR!                                     ^
2021-07-11T14:06:32.068Z [err] npm ERR!
2021-07-11T14:06:32.068Z [err]  /Users/rob/Library/Caches/node-gyp/14.17.1/include/node/v8.h:3673:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
2021-07-11T14:06:32.068Z [err] npm ERR!
2021-07-11T14:06:32.068Z [err]    V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
2021-07-11T14:06:32.068Z [err] npm 
2021-07-11T14:06:32.068Z [err] ERR!                                     ^
2021-07-11T14:06:32.068Z [err] npm 
2021-07-11T14:06:32.068Z [err] ERR! ../src/serialport.cpp:330:14: error: no matching member function for call to 'Set'
2021-07-11T14:06:32.068Z [err] npm
2021-07-11T14:06:32.068Z [err]  ERR!     results->Set(Nan::New<v8::String>("dsr").ToLocalChecked(), Nan::New<v8::Boolean>(data->dsr));
2021-07-11T14:06:32.068Z [err] npm
2021-07-11T14:06:32.068Z [err]  ERR!     ~~~~~~~~~^~~
2021-07-11T14:06:32.068Z [err] npm ERR!
2021-07-11T14:06:32.068Z [err]  /Users/rob/Library/Caches/node-gyp/14.17.1/include/node/v8.h:3670:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
2021-07-11T14:06:32.068Z [err] npm ERR!
2021-07-11T14:06:32.068Z [err]    V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
2021-07-11T14:06:32.068Z [err] npm 
2021-07-11T14:06:32.068Z [err] ERR!                                     ^
2021-07-11T14:06:32.068Z [err] npm
2021-07-11T14:06:32.068Z [err]  ERR! /Users/rob/Library/Caches/node-gyp/14.17.1/include/node/v8.h:3673:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
2021-07-11T14:06:32.068Z [err] npm ERR!
2021-07-11T14:06:32.068Z [err]    V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
2021-07-11T14:06:32.068Z [err] npm ERR!
2021-07-11T14:06:32.068Z [err]                                      ^
2021-07-11T14:06:32.068Z [err] npm 
2021-07-11T14:06:32.068Z [err] ERR! ../src/serialport.cpp:331:14: error: no matching member function for call to 'Set'
2021-07-11T14:06:32.068Z [err] npm ERR!
2021-07-11T14:06:32.068Z [err]      results->Set(Nan::New<v8::String>("dcd").ToLocalChecked(), Nan::New<v8::Boolean>(data->dcd));
2021-07-11T14:06:32.068Z [err] npm ERR!
2021-07-11T14:06:32.068Z [err]      ~~~~~~~~~^~~
2021-07-11T14:06:32.068Z [err] npm ERR!
2021-07-11T14:06:32.068Z [err]  /Users/rob/Library/Caches/node-gyp/14.17.1/include/node/v8.h:3670:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
2021-07-11T14:06:32.068Z [err] npm
2021-07-11T14:06:32.068Z [err]  ERR!   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
2021-07-11T14:06:32.068Z [err] npm
2021-07-11T14:06:32.068Z [err]  ERR!                                     ^
2021-07-11T14:06:32.068Z [err] npm 
2021-07-11T14:06:32.068Z [err] ERR! /Users/rob/Library/Caches/node-gyp/14.17.1/include/node/v8.h:3673:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
2021-07-11T14:06:32.068Z [err] npm
2021-07-11T14:06:32.068Z [err]  ERR!   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
2021-07-11T14:06:32.068Z [err] npm ERR!
2021-07-11T14:06:32.068Z [err]                                      ^
2021-07-11T14:06:32.068Z [err] npm ERR!
2021-07-11T14:06:32.068Z [err]  ../src/serialport.cpp:378:14: error: no matching member function for call to 'Set'
2021-07-11T14:06:32.068Z [err] npm 
2021-07-11T14:06:32.068Z [err] ERR!     results->Set(Nan::New<v8::String>("baudRate").ToLocalChecked(), Nan::New<v8::Integer>(data->baudRate));
2021-07-11T14:06:32.068Z [err] npm ERR!
2021-07-11T14:06:32.068Z [err]      ~~~~~~~~~^~~
2021-07-11T14:06:32.068Z [err] npm ERR!
2021-07-11T14:06:32.068Z [err]  /Users/rob/Library/Caches/node-gyp/14.17.1/include/node/v8.h:3670:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
2021-07-11T14:06:32.068Z [err] npm ERR!
2021-07-11T14:06:32.068Z [err]    V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
2021-07-11T14:06:32.068Z [err] npm
2021-07-11T14:06:32.068Z [err]  ERR!                                     ^
2021-07-11T14:06:32.068Z [err] npm
2021-07-11T14:06:32.068Z [err]  ERR!
2021-07-11T14:06:32.068Z [err]  /Users/rob/Library/Caches/node-gyp/14.17.1/include/node/v8.h:3673:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
2021-07-11T14:06:32.068Z [err] npm ERR!
2021-07-11T14:06:32.068Z [err]    V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
2021-07-11T14:06:32.068Z [err] npm 
2021-07-11T14:06:32.068Z [err] ERR!                                     ^
2021-07-11T14:06:32.068Z [err] npm 
2021-07-11T14:06:32.068Z [err] ERR! 4 errors generated.
2021-07-11T14:06:32.068Z [err] npm
2021-07-11T14:06:32.068Z [err]  ERR! make: *** [Release/obj.target/bindings/src/serialport.o] Error 1
2021-07-11T14:06:32.068Z [err] npm 
2021-07-11T14:06:32.068Z [err] ERR! gyp ERR! build error 
2021-07-11T14:06:32.068Z [err] npm
2021-07-11T14:06:32.068Z [err]  ERR! gyp ERR! stack Error: `make` failed with exit code: 2
2021-07-11T14:06:32.068Z [err] npm ERR!
2021-07-11T14:06:32.068Z [err]  gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
2021-07-11T14:06:32.068Z [err] npm ERR!
2021-07-11T14:06:32.068Z [err]  gyp ERR! stack     at ChildProcess.emit (events.js:375:28)
2021-07-11T14:06:32.068Z [err] npm 
2021-07-11T14:06:32.068Z [err] ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
2021-07-11T14:06:32.068Z [err] npm
2021-07-11T14:06:32.068Z [err]  ERR! gyp ERR! System Darwin 20.5.0
2021-07-11T14:06:32.068Z [err] npm ERR!
2021-07-11T14:06:32.068Z [err]  gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
2021-07-11T14:06:32.068Z [err] npm 
2021-07-11T14:06:32.068Z [err] ERR! gyp ERR! cwd /Users/rob/.node-red/node_modules/@serialport/bindings
2021-07-11T14:06:32.068Z [err] npm
2021-07-11T14:06:32.068Z [err]  ERR! gyp ERR! node -v v14.17.1
2021-07-11T14:06:32.068Z [err] npm
2021-07-11T14:06:32.068Z [err]  ERR!
2021-07-11T14:06:32.068Z [err]  gyp ERR! node-gyp -v v7.1.2
2021-07-11T14:06:32.068Z [err] npm ERR!
2021-07-11T14:06:32.068Z [err]  gyp ERR! not ok
2021-07-11T14:06:32.102Z [err] 
2021-07-11T14:06:32.102Z [err] npm ERR!
2021-07-11T14:06:32.102Z [err]  A complete log of this run can be found in:
2021-07-11T14:06:32.102Z [err] npm ERR!     /Users/rob/.npm/_logs/2021-07-11T14_06_32_069Z-debug.log
2021-07-11T14:06:32.115Z rc=1 ```

Please post the log as if it was code... between the triple backticks.
Edit your post and use the </> icon in the edit screen

  1. what platform are you running NR on (It looks like you are on a Mac but I'd like to verify)
  2. what version of NR and node.js? (you can find these in the NR startup log)

Hi again Zenofmud,

I'm running it on a Pi4 and these are the versions:
Node-RED version: v1.3.5
Node.js version: v14.17.1
Linux 5.10.17-v7l+ arm LE

...and I just tested it on a Mac running latest Node Red -> same node-red & js versions -> same problem.

I was also unable to install it... and since it hasn't been updated in over a year, why not try a newer contrib?

1 Like

Hi Gunner,

yes, I did install this one...but can't figure out how to get it to work :frowning:

Well, I can't help much there... I don't have that hardware.

But looking at the webpage and the node, I say you...

  • Select the i2c address for your hardware
  • Chose input/output mode for the mpc23008 node (one node per GPIO I would guess)
  • Pick a GPIO on the device (defaults to 0 it seems) using address I for input or Q for output
  • Then either add a button/inject node for input (to toggle an LED on the device for example) or some form of indicator node for an output using a button or sensor on the device GPIO

image

Gunner,

I might be completely wrong with my setup here... the idea is to control an i2c 8 channel relay board. As it uses the MCP23008 chip I was thinking this node could help.

To define the address and the busnumber I can understand...but then I was hoping just to give a command to activate a relay (from 1 to 8...in HEX or whatever) And I think this MCP23008 node does this (if I could get it installed :-()

Following my flow, the relays will be triggered by a timerfunction...so I'm confused here with this Mode GP and addresses I and Q

Well, it appears broken and unmaintained, so... option 2 is not any more confusing from what I can see,

If you are using a relay board, then you want to set the (other) mcp23008 node for OUTPUT.

Then as you have 8 channels (presumably one for each relay) you would have 8 nodes, each one set for a different GP using the Q addresses (0-7)

image

And finally send the desired node a 0 or 1 to trigger the desired relay (on the board's GP3 as per image example)

Again, I don't have anything to test with at my end, thus the red init error showing on the node.

Gunner,

if it would be only that simple...I have actually the same testflow as you have. The board is detected as it initializes. Also tested the config you propose but no reaction from any relay.

By running the i2cset command from terminal I can control the relays...so hardware should be ok.
(i2cset -y 1 0x20 for example)

Perhaps you need to install another node for use without PLC ladder logic, as referenced on the web page - node-red-contrib-redplc-module - npm

actually this looks like the updated URL to install via palette - node-red-contrib-redplc-module (node) - Node-RED

Looks like you need all three of these...

image

But I must leave you here... without such a board, I can't even begin to confirm any testing. It looks like this node is really meant for PCL controllers using that (somewhat older) IC, but with a bit of trial I suspect you can figure it out.

You know, I think you can run these commands directly from NR with an exec node. I have a White/IR BrightPi camera light that uses the same form of i2cset control.. been meaning to try it next on my NR side. If I get around to figuring out the best way, I will post it here for you.

OK, that was simple... just put your i2cset command in the exec node and trigger it.

image

image

Hi Gunner,

it was even so simple I already had it working only by reading your email!!! Might be a little bit less elegant, but it works!

A big thank you for this assist!!!!

1 Like

BTW, if you want to trigger multiple relays with a single node action, you can concat commands together with && like this: (guessing at the addresses) i2cset -y 1 0x20 && i2cset -y 1 0x21 && i2cset -y 1 0x22

ok, interesting to know. Thx!

Hey Gunner,

not to sure about your concat command....as if I send relay1 ON followed by relay2 ON it only sets relay1.
Looks like I need to send one command defining the state of all relays at the same time...so if I want to have 1+2 on I need to send 0x03 (luckally I don't need all 8 relays working in different combinations :-))

OK, sounds like your relays are controlled a bit differently then my LEDs... go fig :stuck_out_tongue: Mine have about 6 commands to enable, adjust gain, then turn on each of the 4 white (or IR) LEDs to desired brightness... I was starting to make up separate nodes for each command when I searched and found the node saving &&

When using the exec node to send a concatinated set of commands thry this. Use a change node to put the entire command - i.e.
'i2cset -y 1 0x20 && i2cset -y 1 0x21 && i2cset -y 1 0x22'
in msg.payload.

Next in the exec command leave the 'Comand' feild blank and check the '+Append' box
Screen Shot 2021-07-13 at 5.42.24 AM
and give it a try.

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