Cant install node-red-contrib-serial-modbus

Hello,

I try to install 'node-red-contrib-serial-modbus' within the official docker image on a rpi 4b and get the following error messages. I've also read the other topics for this node but this didn't solved my problem.

Maybe someone can help with this problem.

Here are the docker logs with the installed versions and hardware info:

output of 'docker logs nodered'

24 Aug 06:26:02 - [info] 

Welcome to Node-RED
===================

24 Aug 06:26:02 - [info] Node-RED version: v3.0.2
24 Aug 06:26:02 - [info] Node.js  version: v16.20.1
24 Aug 06:26:02 - [info] Linux 6.1.21-v8+ arm64 LE
24 Aug 06:26:04 - [info] Loading palette nodes
24 Aug 06:26:05 - [info] Settings file  : /data/settings.js
24 Aug 06:26:05 - [info] Context store  : 'default' [module=memory]
24 Aug 06:26:05 - [info] User directory : /data
24 Aug 06:26:05 - [warn] Projects disabled : editorTheme.projects.enabled=false
24 Aug 06:26:05 - [info] Flows file     : /data/flows.json
24 Aug 06:26:06 - [info] Server now running at http://127.0.0.1:1880/


The install log for the node is here:
2023-08-24T08:38:23.638Z Install : node-red-contrib-serial-modbus 0.0.11

2023-08-24T08:38:23.720Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-serial-modbus@0.0.11
2023-08-24T08:38:24.893Z [err] npm
2023-08-24T08:38:24.894Z [err]  WARN config
2023-08-24T08:38:24.895Z [err]  production Use `--omit=dev` instead.
2023-08-24T08:38:41.196Z [err] npm
2023-08-24T08:38:41.196Z [err]  ERR! code 1
2023-08-24T08:38:41.197Z [err] npm ERR!
2023-08-24T08:38:41.197Z [err]  path /data/node_modules/node-red-contrib-serial-modbus/node_modules/@serialport/bindings
2023-08-24T08:38:41.202Z [err] npm ERR! command failed
2023-08-24T08:38:41.202Z [err] npm ERR! command
2023-08-24T08:38:41.202Z [err]  sh -c -- prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild
2023-08-24T08:38:41.203Z [err] npm ERR! make: Entering directory '/data/node_modules/node-red-contrib-serial-modbus/node_modules/@serialport/bindings/build'
2023-08-24T08:38:41.203Z [err] npm ERR!
2023-08-24T08:38:41.203Z [err]    CXX(target) Release/obj.target/bindings/src/serialport.o
2023-08-24T08:38:41.203Z [err] npm ERR! make: Leaving directory '/data/node_modules/node-red-contrib-serial-modbus/node_modules/@serialport/bindings/build'
2023-08-24T08:38:41.203Z [err] npm ERR! gyp info it worked if it ends with ok
2023-08-24T08:38:41.203Z [err] npm
2023-08-24T08:38:41.204Z [err]  ERR! gyp info using node-gyp@9.1.0
2023-08-24T08:38:41.204Z [err] npm ERR!
2023-08-24T08:38:41.204Z [err]  gyp info using node@16.20.1 | linux | arm64
2023-08-24T08:38:41.204Z [err] npm ERR!
2023-08-24T08:38:41.204Z [err]  gyp info find Python using Python version 3.11.4 found at "/usr/bin/python3"
2023-08-24T08:38:41.204Z [err] npm ERR! gyp info spawn /usr/bin/python3
2023-08-24T08:38:41.204Z [err] npm ERR! gyp info spawn args [
2023-08-24T08:38:41.204Z [err] npm ERR!
2023-08-24T08:38:41.205Z [err]  gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
2023-08-24T08:38:41.205Z [err] npm ERR! gyp info spawn args   'binding.gyp',
2023-08-24T08:38:41.205Z [err] npm ERR!
2023-08-24T08:38:41.205Z [err]  gyp info spawn args   '-f',
2023-08-24T08:38:41.205Z [err] npm ERR! gyp info spawn args   'make',
2023-08-24T08:38:41.205Z [err] npm ERR! gyp info spawn args   '-I',
2023-08-24T08:38:41.205Z [err] npm ERR! gyp info spawn args   '/data/node_modules/node-red-contrib-serial-modbus/node_modules/@serialport/bindings/build/config.gypi',
2023-08-24T08:38:41.205Z [err] npm ERR! gyp info spawn args   '-I',
2023-08-24T08:38:41.205Z [err] npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
2023-08-24T08:38:41.205Z [err] npm ERR! gyp info spawn args   '-I',
2023-08-24T08:38:41.205Z [err] npm ERR! gyp info spawn args   '/usr/src/node-red/.cache/node-gyp/16.20.1/include/node/common.gypi',
2023-08-24T08:38:41.205Z [err] npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
2023-08-24T08:38:41.205Z [err] npm ERR! gyp info spawn args   '-Dvisibility=default',
2023-08-24T08:38:41.205Z [err] npm ERR! gyp info spawn args   '-Dnode_root_dir=/usr/src/node-red/.cache/node-gyp/16.20.1',
2023-08-24T08:38:41.206Z [err] npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
2023-08-24T08:38:41.206Z [err] npm ERR! gyp info spawn args   '-Dnode_lib_file=/usr/src/node-red/.cache/node-gyp/16.20.1/<(target_arch)/node.lib',
2023-08-24T08:38:41.206Z [err] npm ERR! gyp info spawn args   '-Dmodule_root_dir=/data/node_modules/node-red-contrib-serial-modbus/node_modules/@serialport/bindings',
2023-08-24T08:38:41.206Z [err] npm ERR! gyp info spawn args   '-Dnode_engine=v8',
2023-08-24T08:38:41.206Z [err] npm
2023-08-24T08:38:41.206Z [err]  ERR! gyp info spawn args   '--depth=.',
2023-08-24T08:38:41.206Z [err] npm ERR! gyp info spawn args   '--no-parallel',
2023-08-24T08:38:41.206Z [err] npm
2023-08-24T08:38:41.206Z [err]  ERR! gyp info spawn args   '--generator-output',
2023-08-24T08:38:41.206Z [err] npm ERR! gyp info spawn args   'build',
2023-08-24T08:38:41.207Z [err] npm ERR! gyp info spawn args   '-Goutput_dir=.'
2023-08-24T08:38:41.207Z [err] npm ERR! gyp info spawn args ]
2023-08-24T08:38:41.207Z [err] npm ERR! gyp info spawn make
2023-08-24T08:38:41.207Z [err] npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
2023-08-24T08:38:41.207Z [err] npm ERR!
2023-08-24T08:38:41.207Z [err]  ../src/serialport.cpp: In function 'Nan::NAN_METHOD_RETURN_TYPE Open(Nan::NAN_METHOD_ARGS_TYPE)':
2023-08-24T08:38:41.207Z [err] npm ERR! ../src/serialport.cpp:78:51: warning: cast between incompatible function types from 'void (*)(uv_work_t*)' {aka 'void (*)(uv_work_s*)'} to 'uv_after_work_cb' {aka 'void (*)(uv_work_s*, int)'} [-Wcast-function-type]
2023-08-24T08:38:41.207Z [err] npm ERR!    78 |   uv_queue_work(uv_default_loop(), req, EIO_Open, (uv_after_work_cb)EIO_AfterOpen);
2023-08-24T08:38:41.207Z [err] npm ERR!       |                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2023-08-24T08:38:41.207Z [err] npm 
2023-08-24T08:38:41.207Z [err] ERR! ../src/serialport.cpp: In function 'Nan::NAN_METHOD_RETURN_TYPE Update(Nan::NAN_METHOD_ARGS_TYPE)':
2023-08-24T08:38:41.207Z [err] npm ERR! ../src/serialport.cpp:135:53: warning: cast between incompatible function types from 'void (*)(uv_work_t*)' {aka 'void (*)(uv_work_s*)'} to 'uv_after_work_cb' {aka 'void (*)(uv_work_s*, int)'} [-Wcast-function-type]
2023-08-24T08:38:41.207Z [err] npm ERR!   135 |   uv_queue_work(uv_default_loop(), req, EIO_Update, (uv_after_work_cb)EIO_AfterUpdate);
2023-08-24T08:38:41.207Z [err] npm
2023-08-24T08:38:41.207Z [err]  ERR!       |                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2023-08-24T08:38:41.207Z [err] npm ERR! ../src/serialport.cpp: In function 'Nan::NAN_METHOD_RETURN_TYPE Close(Nan::NAN_METHOD_ARGS_TYPE)':
2023-08-24T08:38:41.207Z [err] npm 
2023-08-24T08:38:41.207Z [err] ERR! ../src/serialport.cpp:175:52: warning: cast between incompatible function types from 'void (*)(uv_work_t*)' {aka 'void (*)(uv_work_s*)'} to 'uv_after_work_cb' {aka 'void (*)(uv_work_s*, int)'} [-Wcast-function-type]
2023-08-24T08:38:41.207Z [err] npm ERR!   175 |   uv_queue_work(uv_default_loop(), req, EIO_Close, (uv_after_work_cb)EIO_AfterClose);
2023-08-24T08:38:41.207Z [err] npm ERR!
2023-08-24T08:38:41.208Z [err]        |                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2023-08-24T08:38:41.208Z [err] npm ERR! ../src/serialport.cpp: In function 'Nan::NAN_METHOD_RETURN_TYPE Flush(Nan::NAN_METHOD_ARGS_TYPE)':
2023-08-24T08:38:41.208Z [err] npm ERR!
2023-08-24T08:38:41.208Z [err]  ../src/serialport.cpp:215:52: warning: cast between incompatible function types from 'void (*)(uv_work_t*)' {aka 'void (*)(uv_work_s*)'} to 'uv_after_work_cb' {aka 'void (*)(uv_work_s*, int)'} [-Wcast-function-type]
2023-08-24T08:38:41.208Z [err] npm ERR!   215 |   uv_queue_work(uv_default_loop(), req, EIO_Flush, (uv_after_work_cb)EIO_AfterFlush);
2023-08-24T08:38:41.208Z [err] npm ERR!
2023-08-24T08:38:41.208Z [err]        |                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2023-08-24T08:38:41.208Z [err] npm ERR! ../src/serialport.cpp: In function 'Nan::NAN_METHOD_RETURN_TYPE Set(Nan::NAN_METHOD_ARGS_TYPE)':
2023-08-24T08:38:41.208Z [err] npm ERR!
2023-08-24T08:38:41.208Z [err]  ../src/serialport.cpp:270:50: warning: cast between incompatible function types from 'void (*)(uv_work_t*)' {aka 'void (*)(uv_work_s*)'} to 'uv_after_work_cb' {aka 'void (*)(uv_work_s*, int)'} [-Wcast-function-type]
2023-08-24T08:38:41.208Z [err] npm ERR!   270 |   uv_queue_work(uv_default_loop(), req, EIO_Set, (uv_after_work_cb)EIO_AfterSet);
2023-08-24T08:38:41.208Z [err] npm ERR!       |                                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2023-08-24T08:38:41.208Z [err] npm ERR! ../src/serialport.cpp: In function 'Nan::NAN_METHOD_RETURN_TYPE Get(Nan::NAN_METHOD_ARGS_TYPE)':
2023-08-24T08:38:41.208Z [err] npm ERR! ../src/serialport.cpp:314:50: warning: cast between incompatible function types from 'void (*)(uv_work_t*)' {aka 'void (*)(uv_work_s*)'} to 'uv_after_work_cb' {aka 'void (*)(uv_work_s*, int)'} [-Wcast-function-type]
2023-08-24T08:38:41.208Z [err] npm
2023-08-24T08:38:41.208Z [err]  ERR!   314 |   uv_queue_work(uv_default_loop(), req, EIO_Get, (uv_after_work_cb)EIO_AfterGet);
2023-08-24T08:38:41.208Z [err] npm ERR!       |                                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2023-08-24T08:38:41.208Z [err] npm
2023-08-24T08:38:41.209Z [err]  ERR! ../src/serialport.cpp: In function 'void EIO_AfterGet(uv_work_t*)':
2023-08-24T08:38:41.209Z [err] npm ERR! ../src/serialport.cpp:329:17: error: no matching function for call to 'v8::Object::Set(v8::Local<v8::String>, Nan::imp::FactoryBase<v8::Boolean>::return_t)'
2023-08-24T08:38:41.209Z [err] npm
2023-08-24T08:38:41.209Z [err]  ERR!   329 |     results->Set(Nan::New<v8::String>("cts").ToLocalChecked(), Nan::New<v8::Boolean>(data->cts));
2023-08-24T08:38:41.209Z [err] npm ERR!       |     ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2023-08-24T08:38:41.209Z [err] npm
2023-08-24T08:38:41.209Z [err]  ERR! In file included from /usr/src/node-red/.cache/node-gyp/16.20.1/include/node/node.h:73,
2023-08-24T08:38:41.209Z [err] npm ERR!                  from ../../../../../nan/nan.h:60,
2023-08-24T08:38:41.209Z [err] npm ERR!                  from ../src/./serialport.h:6,
2023-08-24T08:38:41.209Z [err] npm ERR!                  from ../src/serialport.cpp:1:
2023-08-24T08:38:41.209Z [err] npm ERR! /usr/src/node-red/.cache/node-gyp/16.20.1/include/node/v8.h:3961:37: note: candidate: 'v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)'
2023-08-24T08:38:41.209Z [err] npm ERR!  3961 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
2023-08-24T08:38:41.209Z [err] npm 
2023-08-24T08:38:41.209Z [err] ERR!       |                                     ^~~
2023-08-24T08:38:41.209Z [err] npm ERR! /usr/src/node-red/.cache/node-gyp/16.20.1/include/node/v8.h:3961:37: note:   candidate expects 3 arguments, 2 provided
2023-08-24T08:38:41.209Z [err] npm
2023-08-24T08:38:41.210Z [err]  ERR! /usr/src/node-red/.cache/node-gyp/16.20.1/include/node/v8.h:3964:37: note: candidate: 'v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, uint32_t, v8::Local<v8::Value>)'
2023-08-24T08:38:41.210Z [err] npm ERR!  3964 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
2023-08-24T08:38:41.210Z [err] npm
2023-08-24T08:38:41.210Z [err]  ERR!       |                                     ^~~
2023-08-24T08:38:41.210Z [err] npm ERR! /usr/src/node-red/.cache/node-gyp/16.20.1/include/node/v8.h:3964:37: note:   candidate expects 3 arguments, 2 provided
2023-08-24T08:38:41.210Z [err] npm 
2023-08-24T08:38:41.210Z [err] ERR! ../src/serialport.cpp:330:17: error: no matching function for call to 'v8::Object::Set(v8::Local<v8::String>, Nan::imp::FactoryBase<v8::Boolean>::return_t)'
2023-08-24T08:38:41.210Z [err] npm ERR!   330 |     results->Set(Nan::New<v8::String>("dsr").ToLocalChecked(), Nan::New<v8::Boolean>(data->dsr));
2023-08-24T08:38:41.210Z [err] npm 
2023-08-24T08:38:41.210Z [err] ERR!       |     ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2023-08-24T08:38:41.210Z [err] npm ERR! /usr/src/node-red/.cache/node-gyp/16.20.1/include/node/v8.h:3961:37: note: candidate: 'v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)'
2023-08-24T08:38:41.210Z [err] npm ERR!  3961 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
2023-08-24T08:38:41.210Z [err] npm ERR!       |                                     ^~~
2023-08-24T08:38:41.210Z [err] npm ERR! /usr/src/node-red/.cache/node-gyp/16.20.1/include/node/v8.h:3961:37: note:   candidate expects 3 arguments, 2 provided
2023-08-24T08:38:41.210Z [err] npm ERR! /usr/src/node-red/.cache/node-gyp/16.20.1/include/node/v8.h:3964:37: note: candidate: 'v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, uint32_t, v8::Local<v8::Value>)'
2023-08-24T08:38:41.211Z [err] npm ERR!  3964 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
2023-08-24T08:38:41.211Z [err] npm ERR!       |                                     ^~~
2023-08-24T08:38:41.211Z [err] npm ERR!
2023-08-24T08:38:41.211Z [err]  /usr/src/node-red/.cache/node-gyp/16.20.1/include/node/v8.h:3964:37: note:   candidate expects 3 arguments, 2 provided
2023-08-24T08:38:41.211Z [err] npm ERR! ../src/serialport.cpp:331:17: error: no matching function for call to 'v8::Object::Set(v8::Local<v8::String>, Nan::imp::FactoryBase<v8::Boolean>::return_t)'
2023-08-24T08:38:41.211Z [err] npm ERR!
2023-08-24T08:38:41.211Z [err]    331 |     results->Set(Nan::New<v8::String>("dcd").ToLocalChecked(), Nan::New<v8::Boolean>(data->dcd));
2023-08-24T08:38:41.211Z [err] npm ERR!       |     ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2023-08-24T08:38:41.211Z [err] npm ERR!
2023-08-24T08:38:41.211Z [err]  /usr/src/node-red/.cache/node-gyp/16.20.1/include/node/v8.h:3961:37: note: candidate: 'v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)'
2023-08-24T08:38:41.211Z [err] npm ERR!  3961 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
2023-08-24T08:38:41.211Z [err] npm ERR!
2023-08-24T08:38:41.211Z [err]        |                                     ^~~
2023-08-24T08:38:41.211Z [err] npm ERR! /usr/src/node-red/.cache/node-gyp/16.20.1/include/node/v8.h:3961:37: note:   candidate expects 3 arguments, 2 provided
2023-08-24T08:38:41.211Z [err] npm ERR!
2023-08-24T08:38:41.211Z [err]  /usr/src/node-red/.cache/node-gyp/16.20.1/include/node/v8.h:3964:37: note: candidate: 'v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, uint32_t, v8::Local<v8::Value>)'
2023-08-24T08:38:41.211Z [err] npm ERR!  3964 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
2023-08-24T08:38:41.211Z [err] npm ERR!
2023-08-24T08:38:41.212Z [err]        |                                     ^~~
2023-08-24T08:38:41.212Z [err] npm ERR! /usr/src/node-red/.cache/node-gyp/16.20.1/include/node/v8.h:3964:37: note:   candidate expects 3 arguments, 2 provided
2023-08-24T08:38:41.212Z [err] npm ERR!
2023-08-24T08:38:41.212Z [err]  ../src/serialport.cpp: In function 'Nan::NAN_METHOD_RETURN_TYPE GetBaudRate(Nan::NAN_METHOD_ARGS_TYPE)':
2023-08-24T08:38:41.212Z [err] npm ERR! ../src/serialport.cpp:363:58: warning: cast between incompatible function types from 'void (*)(uv_work_t*)' {aka 'void (*)(uv_work_s*)'} to 'uv_after_work_cb' {aka 'void (*)(uv_work_s*, int)'} [-Wcast-function-type]
2023-08-24T08:38:41.212Z [err] npm ERR!
2023-08-24T08:38:41.212Z [err]    363 |   uv_queue_work(uv_default_loop(), req, EIO_GetBaudRate, (uv_after_work_cb)EIO_AfterGetBaudRate);
2023-08-24T08:38:41.212Z [err] npm ERR!       |                                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2023-08-24T08:38:41.212Z [err] npm 
2023-08-24T08:38:41.212Z [err] ERR! ../src/serialport.cpp: In function 'void EIO_AfterGetBaudRate(uv_work_t*)':
2023-08-24T08:38:41.212Z [err] npm ERR! ../src/serialport.cpp:378:17: error: no matching function for call to 'v8::Object::Set(v8::Local<v8::String>, Nan::imp::IntegerFactory<v8::Integer>::return_t)'
2023-08-24T08:38:41.212Z [err] npm
2023-08-24T08:38:41.212Z [err]  ERR!   378 |     results->Set(Nan::New<v8::String>("baudRate").ToLocalChecked(), Nan::New<v8::Integer>(data->baudRate));
2023-08-24T08:38:41.212Z [err] npm ERR!       |     ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2023-08-24T08:38:41.212Z [err] npm ERR! /usr/src/node-red/.cache/node-gyp/16.20.1/include/node/v8.h:3961:37: note: candidate: 'v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)'
2023-08-24T08:38:41.212Z [err] npm ERR!  3961 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
2023-08-24T08:38:41.212Z [err] npm ERR!       |                                     ^~~
2023-08-24T08:38:41.212Z [err] npm ERR!
2023-08-24T08:38:41.213Z [err]  /usr/src/node-red/.cache/node-gyp/16.20.1/include/node/v8.h:3961:37: note:   candidate expects 3 arguments, 2 provided
2023-08-24T08:38:41.213Z [err] npm ERR! /usr/src/node-red/.cache/node-gyp/16.20.1/include/node/v8.h:3964:37: note: candidate: 'v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, uint32_t, v8::Local<v8::Value>)'
2023-08-24T08:38:41.213Z [err] npm ERR!
2023-08-24T08:38:41.213Z [err]   3964 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
2023-08-24T08:38:41.213Z [err] npm ERR!       |                                     ^~~
2023-08-24T08:38:41.213Z [err] npm ERR!
2023-08-24T08:38:41.213Z [err]  /usr/src/node-red/.cache/node-gyp/16.20.1/include/node/v8.h:3964:37: note:   candidate expects 3 arguments, 2 provided
2023-08-24T08:38:41.213Z [err] npm ERR! ../src/serialport.cpp: In function 'Nan::NAN_METHOD_RETURN_TYPE Drain(Nan::NAN_METHOD_ARGS_TYPE)':
2023-08-24T08:38:41.213Z [err] npm ERR!
2023-08-24T08:38:41.213Z [err]  ../src/serialport.cpp:409:52: warning: cast between incompatible function types from 'void (*)(uv_work_t*)' {aka 'void (*)(uv_work_s*)'} to 'uv_after_work_cb' {aka 'void (*)(uv_work_s*, int)'} [-Wcast-function-type]
2023-08-24T08:38:41.213Z [err] npm ERR!   409 |   uv_queue_work(uv_default_loop(), req, EIO_Drain, (uv_after_work_cb)EIO_AfterDrain);
2023-08-24T08:38:41.213Z [err] npm
2023-08-24T08:38:41.213Z [err]  ERR!       |                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2023-08-24T08:38:41.213Z [err] npm ERR! ../src/serialport.cpp: At global scope:
2023-08-24T08:38:41.213Z [err] npm
2023-08-24T08:38:41.213Z [err]  ERR! ../src/serialport.cpp:430:28: warning: unnecessary parentheses in declaration of 'ToParityEnum' [-Wparentheses]
2023-08-24T08:38:41.213Z [err] npm ERR!   430 | SerialPortParity NAN_INLINE(ToParityEnum(const v8::Local<v8::String>& v8str)) {
2023-08-24T08:38:41.213Z [err] npm ERR!       |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2023-08-24T08:38:41.213Z [err] npm ERR! ../src/serialport.cpp:430:28: note: remove parentheses
2023-08-24T08:38:41.214Z [err] npm ERR!   430 | SerialPortParity NAN_INLINE(ToParityEnum(const v8::Local<v8::String>& v8str)) {
2023-08-24T08:38:41.214Z [err] npm ERR!       |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2023-08-24T08:38:41.214Z [err] npm ERR!       |                            -                                                -
2023-08-24T08:38:41.214Z [err] npm ERR! ../src/serialport.cpp:449:30: warning: unnecessary parentheses in declaration of 'ToStopBitEnum' [-Wparentheses]
2023-08-24T08:38:41.214Z [err] npm ERR!   449 | SerialPortStopBits NAN_INLINE(ToStopBitEnum(double stopBits)) {
2023-08-24T08:38:41.214Z [err] npm ERR!       |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2023-08-24T08:38:41.214Z [err] npm
2023-08-24T08:38:41.214Z [err]  ERR! ../src/serialport.cpp:449:30: note: remove parentheses
2023-08-24T08:38:41.214Z [err] npm ERR!
2023-08-24T08:38:41.214Z [err]    449 | SerialPortStopBits NAN_INLINE(ToStopBitEnum(double stopBits)) {
2023-08-24T08:38:41.214Z [err] npm ERR!       |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2023-08-24T08:38:41.214Z [err] npm ERR!
2023-08-24T08:38:41.214Z [err]        |                              -                              -
2023-08-24T08:38:41.214Z [err] npm ERR! /usr/src/node-red/.cache/node-gyp/16.20.1/include/node/node.h:887:7: warning: cast between incompatible function types from 'void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)' {aka 'void (*)(v8::Local<v8::Object>)'} to 'node::addon_register_func' {aka 'void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)'} [-Wcast-function-type]
2023-08-24T08:38:41.214Z [err] npm ERR!
2023-08-24T08:38:41.215Z [err]    887 |       (node::addon_register_func) (regfunc),                          \
2023-08-24T08:38:41.215Z [err] npm ERR!       |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2023-08-24T08:38:41.215Z [err] npm 
2023-08-24T08:38:41.215Z [err] ERR! /usr/src/node-red/.cache/node-gyp/16.20.1/include/node/node.h:921:3: note: in expansion of macro 'NODE_MODULE_X'
2023-08-24T08:38:41.215Z [err] npm ERR!   921 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
2023-08-24T08:38:41.215Z [err] npm 
2023-08-24T08:38:41.215Z [err] ERR!       |   ^~~~~~~~~~~~~
2023-08-24T08:38:41.215Z [err] npm ERR! ../src/serialport.cpp:483:1: note: in expansion of macro 'NODE_MODULE'
2023-08-24T08:38:41.215Z [err] npm
2023-08-24T08:38:41.215Z [err]  ERR!   483 | NODE_MODULE(serialport, init);
2023-08-24T08:38:41.215Z [err] npm ERR!       | ^~~~~~~~~~~
2023-08-24T08:38:41.215Z [err] npm
2023-08-24T08:38:41.215Z [err]  ERR! make: *** [bindings.target.mk:114: Release/obj.target/bindings/src/serialport.o] Error 1
2023-08-24T08:38:41.215Z [err] npm ERR! gyp ERR! build error 
2023-08-24T08:38:41.215Z [err] npm
2023-08-24T08:38:41.215Z [err]  ERR! gyp ERR! stack Error: `make` failed with exit code: 2
2023-08-24T08:38:41.215Z [err] npm ERR! gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:201:23)
2023-08-24T08:38:41.215Z [err] npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
2023-08-24T08:38:41.215Z [err] npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12)
2023-08-24T08:38:41.216Z [err] npm ERR! gyp ERR! System Linux 6.1.21-v8+
2023-08-24T08:38:41.216Z [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-08-24T08:38:41.216Z [err] npm ERR! gyp ERR! cwd /data/node_modules/node-red-contrib-serial-modbus/node_modules/@serialport/bindings
2023-08-24T08:38:41.216Z [err] npm ERR!
2023-08-24T08:38:41.216Z [err]  gyp ERR! node -v v16.20.1
2023-08-24T08:38:41.216Z [err] npm ERR! gyp ERR! node-gyp -v v9.1.0
2023-08-24T08:38:41.216Z [err] npm ERR!
2023-08-24T08:38:41.216Z [err]  gyp ERR! not ok
2023-08-24T08:38:41.222Z [err] 
2023-08-24T08:38:41.223Z [err] npm ERR! A complete log of this run can be found in:
2023-08-24T08:38:41.223Z [err] npm
2023-08-24T08:38:41.225Z [err]  ERR!     /data/.npm/_logs/2023-08-24T08_38_24_807Z-debug-0.log
2023-08-24T08:38:41.252Z rc=1

That node has not been updated in several years so is probably abandoned. I think the problem is that it specifies an old version of the serialport module which does not compile with current versions of nodejs. Is there a reason that you are not using node-red-contrib-modbus? That does serial and tcp modbus.

Hi Colin,
thank you for this reply.
This make sense, that the deps of the old module are not meet.
I thought, that this is the right module to read the input register from Eastron SDM72M power meter over the USB adapter.

I'll give the 'node-red-contrib-modbus' a try and will find out, how to read the needed data.

Thanks for your hint.

regards,
Christian

i'm using this one with success: node-red-contrib-modbus 5.26.0

Hello Jean-Luc,

that should work and I find a flow that should fit my needs.
The next problem now is, that node-red crashes if I access the bound serial port from within the docker container in RPI.

Thanks for helping.

regards,
Christian

SDM72DM_modbus_flow.json

[{"id":"33e1f0e5.130ee","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"644fd6ea.5d87d","type":"modbus-read","z":"33e1f0e5.130ee","name":"EASTRON Zähler","topic":"","showStatusActivities":true,"logIOActivities":false,"showErrors":true,"unitid":"001","dataType":"InputRegister","adr":"0","quantity":"36","rate":"10","rateUnit":"s","delayOnStart":false,"startDelayTime":"","server":"881c983a.3c799","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":true,"x":140,"y":80,"wires":[[],["7c1bf95f.e5cec8"]]},{"id":"7c1bf95f.e5cec8","type":"buffer-parser","z":"33e1f0e5.130ee","name":"","data":"payload.buffer","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"floatbe","name":"p1n_voltage","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"p2n_voltage","offset":4,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"p3n_voltage","offset":8,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"p1_current","offset":12,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"p2_current","offset":16,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"p3_current","offset":20,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"p1_activepower","offset":24,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"p2_activepower","offset":28,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"p3_activepower","offset":32,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"p1_apparentpower","offset":36,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"p2_apparentpower","offset":40,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"p3_apparentpower","offset":44,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"p1_reactivepower","offset":48,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"p2_reactivepower","offset":52,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"p3_reactivepower","offset":56,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"p1_powerfactor","offset":60,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"p2_powerfactor","offset":64,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"p3_powerfactor","offset":68,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"value","resultTypeType":"return","multipleResult":true,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":370,"y":80,"wires":[["86c2b6fc.7817d"]]},{"id":"15c33b19.54d685","type":"debug","z":"33e1f0e5.130ee","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":990,"y":80,"wires":[]},{"id":"6739b7cb.940f2","type":"show-value","z":"33e1f0e5.130ee","name":"","path":"","x":810,"y":80,"wires":[["15c33b19.54d685"]]},{"id":"86c2b6fc.7817d","type":"switch","z":"33e1f0e5.130ee","name":"Phase 1 zu N Spannung","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"p1n_voltage","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":590,"y":80,"wires":[["6739b7cb.940f2"]]},{"id":"9b95f660.cdf8e8","type":"buffer-parser","z":"33e1f0e5.130ee","name":"","data":"payload.buffer","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"floatbe","name":"avgn_voltage","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"avg_current","offset":8,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"sum_current","offset":12,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"total_activepower","offset":20,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"total_apparentpower","offset":28,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"total_reactivepower","offset":36,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"total_pwerfactor","offset":40,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"frequency","offset":56,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"import_kwh","offset":60,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"export_kwh","offset":64,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"import_kvarh","offset":68,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"export_kvarh","offset":72,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"value","resultTypeType":"return","multipleResult":true,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":370,"y":140,"wires":[["52507069.211318"]]},{"id":"d98ca7f2.9d02e8","type":"modbus-read","z":"33e1f0e5.130ee","name":"EASTRON Zähler","topic":"","showStatusActivities":true,"logIOActivities":false,"showErrors":true,"unitid":"001","dataType":"InputRegister","adr":"42","quantity":"38","rate":"10","rateUnit":"s","delayOnStart":false,"startDelayTime":"","server":"881c983a.3c799","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":true,"x":140,"y":140,"wires":[[],["9b95f660.cdf8e8"]]},{"id":"52507069.211318","type":"switch","z":"33e1f0e5.130ee","name":"Netzfrequenz","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"frequency","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":550,"y":140,"wires":[["d214cc37.47aef8"]]},{"id":"a4158876.24f74","type":"debug","z":"33e1f0e5.130ee","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":990,"y":140,"wires":[]},{"id":"1c43cc14.8f3ebc","type":"buffer-parser","z":"33e1f0e5.130ee","name":"","data":"payload.buffer","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"floatbe","name":"p1p2_voltage","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"p2p3_voltage","offset":4,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"p3p1_voltage","offset":8,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"avgptp_voltage","offset":12,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"n_current","offset":48,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"value","resultTypeType":"return","multipleResult":true,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":370,"y":200,"wires":[["f9e88ca5.ed416"]]},{"id":"2044276a.a577e","type":"modbus-read","z":"33e1f0e5.130ee","name":"EASTRON Zähler","topic":"","showStatusActivities":true,"logIOActivities":false,"showErrors":true,"unitid":"001","dataType":"InputRegister","adr":"200","quantity":"26","rate":"10","rateUnit":"s","delayOnStart":false,"startDelayTime":"","server":"881c983a.3c799","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":true,"x":140,"y":200,"wires":[[],["1c43cc14.8f3ebc"]]},{"id":"f9e88ca5.ed416","type":"switch","z":"33e1f0e5.130ee","name":"Neutralleiterstrom","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"n_current","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":570,"y":200,"wires":[["28f94b96.04e24c"]]},{"id":"fee0ff8.1bde78","type":"debug","z":"33e1f0e5.130ee","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":990,"y":200,"wires":[]},{"id":"d214cc37.47aef8","type":"show-value","z":"33e1f0e5.130ee","name":"","path":"","x":810,"y":140,"wires":[["a4158876.24f74"]]},{"id":"28f94b96.04e24c","type":"show-value","z":"33e1f0e5.130ee","name":"","path":"","x":810,"y":200,"wires":[["fee0ff8.1bde78"]]},{"id":"7e605828.b8f3c","type":"buffer-parser","z":"33e1f0e5.130ee","name":"","data":"payload.buffer","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"floatbe","name":"total_kwh","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"total_kvarh","offset":4,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"value","resultTypeType":"return","multipleResult":true,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":370,"y":260,"wires":[["ef4a560d.d62878"]]},{"id":"816697ff.00cc28","type":"modbus-read","z":"33e1f0e5.130ee","name":"EASTRON Zähler","topic":"","showStatusActivities":true,"logIOActivities":false,"showErrors":true,"unitid":"001","dataType":"InputRegister","adr":"342","quantity":"4","rate":"10","rateUnit":"s","delayOnStart":false,"startDelayTime":"","server":"881c983a.3c799","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":true,"x":140,"y":260,"wires":[[],["7e605828.b8f3c"]]},{"id":"ef4a560d.d62878","type":"switch","z":"33e1f0e5.130ee","name":"Gesamt Stromzählerstand","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"total_kwh","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":590,"y":260,"wires":[["20ee33aa.2095cc"]]},{"id":"70c991ee.fb7e28","type":"debug","z":"33e1f0e5.130ee","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":990,"y":260,"wires":[]},{"id":"20ee33aa.2095cc","type":"show-value","z":"33e1f0e5.130ee","name":"","path":"","x":810,"y":260,"wires":[["70c991ee.fb7e28"]]},{"id":"7fbb4774.c62fc","type":"comment","z":"33e1f0e5.130ee","name":"EASTRON SDM72DM-V2 Modbus - Alle Messwerte","info":"","x":210,"y":40,"wires":[]},{"id":"881c983a.3c799","type":"modbus-client","name":"Modbus-RS485","clienttype":"serial","bufferCommands":true,"stateLogEnabled":true,"queueLogEnabled":false,"tcpHost":"127.0.0.1","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB0","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":"2","commandDelay":"1","clientTimeout":"1000","reconnectOnTimeout":true,"reconnectTimeout":"2000","parallelUnitIdsAllowed":true}]

I don't have NR under Docker.
A quick question, do you need all this data?
There really is a lot of it.
If not, how do you describe accessing the /dev/ttyUSB0 interface to bring it up in the NR container?
Is there only one physical USB port connected?
ah yes, the Pi power supply is official?

Is there a reason that you are using Docker? I advise against that unless you have a good reason.

Otherwise, show us the log when you start node-red up to the point it crashes. I don't know how to get that in Docker so hopefully you do.

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