ludiazv / node-red-contrib-nrf24

NODE-Red fredom for nrf24l01(+)! Control nrf24l01(+) radios , RF24Mesh & RF24Gateway networks from Node-Red
MIT License
7 stars 4 forks source link

Doesn't work after reinstallation [CAN'T COMPILE WITH NODE >12] #4

Closed SerYojKa59 closed 4 years ago

SerYojKa59 commented 4 years ago

Install Node-RED at https://nodered.org/docs/getting-started/raspberrypi. Then I install node-red-contrib-nrf24 using npm and I can’t install it. The compilation problem is somewhere in the nrf24 package!

ludiazv commented 4 years ago

Hi, Could you send over the output of npm install?

SerYojKa59 commented 4 years ago

OK, I'll show you this week. Reiteration:

  1. I installed the “Raspbian Desktop Buster” on the Raspberry PI 3 Model B from Download Raspbian for Raspberry Pi.
  2. Installed Node-RED in accordance with the instructions on the website Running on Raspberry Pi : Node-RED via "bash <..."
  3. Installed node-red-contrib-nrf24 and failed.

Img: 1. img 2. img 3. Later

pavelnikitiuk commented 4 years ago

hi, I guess this issue related to this library https://github.com/ludiazv/node-nrf24 I have the same problem, and I assume that this is due to using node 12. please find error log after install

> node-gyp rebuild

make: Entering directory '/home/pi/.node-red/node_modules/node-red-contrib-nrf24/node_modules/nrf24/build'
  CXX(target) Release/obj.target/nRF24/tryabort.o
  CXX(target) Release/obj.target/nRF24/rf24_util.o
In file included from ../rf24_util.hpp:3,
                 from ../rf24_util.cc:2:
../../../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../../../../nan/nan.h:2298:62: 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]
     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
                                                              ^
../rf24_util.cc: In function ‘uint32_t ObjGetUInt(v8::Local<v8::Object>&, const string&)’:
../rf24_util.cc:15:45: error: no matching function for call to ‘v8::Value::Uint32Value()’
     return (v->IsUint32()) ? v->Uint32Value() : 0;
                                             ^
In file included from /home/pi/.cache/node-gyp/12.13.1/include/node/node.h:63,
                 from ../../../../nan/nan.h:54,
                 from ../rf24_util.hpp:3,
                 from ../rf24_util.cc:2:
/home/pi/.cache/node-gyp/12.13.1/include/node/v8.h:2611:41: note: candidate: ‘v8::Maybe<unsigned int> v8::Value::Uint32Value(v8::Local<v8::Context>) const’
   V8_WARN_UNUSED_RESULT Maybe<uint32_t> Uint32Value(
                                         ^~~~~~~~~~~
/home/pi/.cache/node-gyp/12.13.1/include/node/v8.h:2611:41: note:   candidate expects 1 argument, 0 provided
../rf24_util.cc: In function ‘bool ConvertHexAddress(v8::Local<v8::String>, uint8_t*, uint8_t)’:
../rf24_util.cc:20:34: error: no matching function for call to ‘v8::String::Utf8Value::Utf8Value(v8::Local<v8::String>&)’
   v8::String::Utf8Value value(val);

I tried to fix it in my fork https://github.com/pavelnikitiuk/node-nrf24/tree/node-12 but there is also issue with nan-marsal package, which is a nan-check dependency logs from fork

> node-gyp rebuild

make: Entering directory '/home/pi/lib/node-nrf24/build'
  CXX(target) Release/obj.target/nRF24/irq.o
In file included from ../rf24_config.hpp:6,
                 from ../irq.hpp:3,
                 from ../irq.cc:2:
../node_modules/nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../node_modules/nan/nan.h:2298:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_c ’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
                                                              ^
In file included from ../node_modules/nan-check/nan-check.h:17,
                 from ../rf24_config.hpp:7,
                 from ../irq.hpp:3,
                 from ../irq.cc:2:
../node_modules/nan-marshal/nan-marshal.h: In member function ‘void Nan::marshal::SaveArchive::save(const Nan::marshal::nvp_struct<T>&)’:
../node_modules/nan-marshal/nan-marshal.h:444:32: error: no matching function for call to ‘v8::Value::ToObject()’
                 _dst->ToObject()->Set(Nan::New<v8::String>(val.name).ToLocalChecked(), Marshal(val.value));
                                ^
In file included from /home/pi/.cache/node-gyp/12.13.1/include/node/node.h:63,
                 from ../node_modules/nan/nan.h:54,
                 from ../rf24_config.hpp:6,
                 from ../irq.hpp:3,
                 from ../irq.cc:2:
/home/pi/.cache/node-gyp/12.13.1/include/node/v8.h:2576:44: note: candidate: ‘v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const’
   V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
                                            ^~~~~~~~
/home/pi/.cache/node-gyp/12.13.1/include/node/v8.h:2576:44: note:   candidate expects 1 argument, 0 provided
In file included from /home/pi/.cache/node-gyp/12.13.1/include/node/v8-internal.h:14,
                 from /home/pi/.cache/node-gyp/12.13.1/include/node/v8.h:25,
                 from /home/pi/.cache/node-gyp/12.13.1/include/node/node.h:63,
                 from ../node_modules/nan/nan.h:54,
                 from ../rf24_config.hpp:6,
                 from ../irq.hpp:3,
                 from ../irq.cc:2:
/home/pi/.cache/node-gyp/12.13.1/include/node/v8.h:2590:31: note: candidate: ‘v8::Local<v8::Object> v8::Value::ToObject(v8::Isolate*) const’
                 Local<Object> ToObject(Isolate* isolate) const);
                               ^~~~~~~~
/home/pi/.cache/node-gyp/12.13.1/include/node/v8config.h:311:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
/home/pi/.cache/node-gyp/12.13.1/include/node/v8.h:2590:31: note:   candidate expects 1 argument, 0 provided
                 Local<Object> ToObject(Isolate* isolate) const);
                               ^~~~~~~~
/home/pi/.cache/node-gyp/12.13.1/include/node/v8config.h:311:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
In file included from ../node_modules/nan-check/nan-check.h:17,
                 from ../rf24_config.hpp:7,
                 from ../irq.hpp:3,
                 from ../irq.cc:2:
../node_modules/nan-marshal/nan-marshal.h: In member function ‘void Nan::marshal::LoadArchive::load(Nan::marshal::nvp_struct<T>&)’:
../node_modules/nan-marshal/nan-marshal.h:509:44: error: no matching function for call to ‘v8::Value::ToObject()’
                 auto prop = _src->ToObject()->Get(Nan::New<v8::String>(val.name).ToLocalChecked());
                                            ^
In file included from /home/pi/.cache/node-gyp/12.13.1/include/node/node.h:63,
                 from ../node_modules/nan/nan.h:54,
                 from ../rf24_config.hpp:6,
                 from ../irq.hpp:3,
                 from ../irq.cc:2:
/home/pi/.cache/node-gyp/12.13.1/include/node/v8.h:2576:44: note: candidate: ‘v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const’
   V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
                                            ^~~~~~~~
/home/pi/.cache/node-gyp/12.13.1/include/node/v8.h:2576:44: note:   candidate expects 1 argument, 0 provided
In file included from /home/pi/.cache/node-gyp/12.13.1/include/node/v8-internal.h:14,
                 from /home/pi/.cache/node-gyp/12.13.1/include/node/v8.h:25,
                 from /home/pi/.cache/node-gyp/12.13.1/include/node/node.h:63,
                 from ../node_modules/nan/nan.h:54,
                 from ../rf24_config.hpp:6,
                 from ../irq.hpp:3,
                 from ../irq.cc:2:
/home/pi/.cache/node-gyp/12.13.1/include/node/v8.h:2590:31: note: candidate: ‘v8::Local<v8::Object> v8::Value::ToObject(v8::Isolate*) const’
                 Local<Object> ToObject(Isolate* isolate) const);
                               ^~~~~~~~
/home/pi/.cache/node-gyp/12.13.1/include/node/v8config.h:311:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
/home/pi/.cache/node-gyp/12.13.1/include/node/v8.h:2590:31: note:   candidate expects 1 argument, 0 provided
                 Local<Object> ToObject(Isolate* isolate) const);
                               ^~~~~~~~
/home/pi/.cache/node-gyp/12.13.1/include/node/v8config.h:311:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
In file included from ../node_modules/nan-check/nan-check.h:17,
                 from ../rf24_config.hpp:7,
                 from ../irq.hpp:3,
                 from ../irq.cc:2:
../node_modules/nan-marshal/nan-marshal.h: In member function ‘void Nan::marshal::LoadArchive::load(T&) [with T = bool]’:
../node_modules/nan-marshal/nan-marshal.h:539:38: error: no matching function for call to ‘v8::Value::BooleanValue()’
             val = _src->BooleanValue();
                                      ^
In file included from /home/pi/.cache/node-gyp/12.13.1/include/node/node.h:63,
                 from ../node_modules/nan/nan.h:54,
                 from ../rf24_config.hpp:6,
                 from ../irq.hpp:3,
                 from ../irq.cc:2:
/home/pi/.cache/node-gyp/12.13.1/include/node/v8.h:2603:8: note: candidate: ‘bool v8::Value::BooleanValue(v8::Isolate*) const’
   bool BooleanValue(Isolate* isolate) const;
        ^~~~~~~~~~~~
/home/pi/.cache/node-gyp/12.13.1/include/node/v8.h:2603:8: note:   candidate expects 1 argument, 0 provided
In file included from /home/pi/.cache/node-gyp/12.13.1/include/node/v8-internal.h:14,
                 from /home/pi/.cache/node-gyp/12.13.1/include/node/v8.h:25,
                 from /home/pi/.cache/node-gyp/12.13.1/include/node/node.h:63,
                 from ../node_modules/nan/nan.h:54,
                 from ../rf24_config.hpp:6,
                 from ../irq.hpp:3,
                 from ../irq.cc:2:
/home/pi/.cache/node-gyp/12.13.1/include/node/v8.h:2606:51: note: candidate: ‘v8::Maybe<bool> v8::Value::BooleanValue(v8::Local<v8::Context>) const’
                 V8_WARN_UNUSED_RESULT Maybe<bool> BooleanValue(
                                                   ^~~~~~~~~~~~
/home/pi/.cache/node-gyp/12.13.1/include/node/v8config.h:311:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
/home/pi/.cache/node-gyp/12.13.1/include/node/v8.h:2606:51: note:   candidate expects 1 argument, 0 provided
                 V8_WARN_UNUSED_RESULT Maybe<bool> BooleanValue(
                                                   ^~~~~~~~~~~~
/home/pi/.cache/node-gyp/12.13.1/include/node/v8config.h:311:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
In file included from ../node_modules/nan-check/nan-check.h:17,
                 from ../rf24_config.hpp:7,
                 from ../irq.hpp:3,
                 from ../irq.cc:2:
../node_modules/nan-marshal/nan-marshal.h: In member function ‘void Nan::marshal::LoadArchive::load(T&) [with T = int]’:
../node_modules/nan-marshal/nan-marshal.h:548:36: error: no matching function for call to ‘v8::Value::Int32Value()’
             val = _src->Int32Value();
                                    ^
In file included from /home/pi/.cache/node-gyp/12.13.1/include/node/node.h:63,
                 from ../node_modules/nan/nan.h:54,
                 from ../rf24_config.hpp:6,
                 from ../irq.hpp:3,
                 from ../irq.cc:2:
/home/pi/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note: candidate: ‘v8::Maybe<int> v8::Value::Int32Value(v8::Local<v8::Context>) const’
   V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
                                        ^~~~~~~~~~
/home/pi/.cache/node-gyp/12.13.1/include/node/v8.h:2613:40: note:   candidate expects 1 argument, 0 provided
In file included from ../node_modules/nan-check/nan-check.h:17,
                 from ../rf24_config.hpp:7,
                 from ../irq.hpp:3,
                 from ../irq.cc:2:
../node_modules/nan-marshal/nan-marshal.h: In member function ‘void Nan::marshal::LoadArchive::load(T&) [with T = float]’:
../node_modules/nan-marshal/nan-marshal.h:557:44: error: no matching function for call to ‘v8::Value::NumberValue()’
             val = (float)_src->NumberValue();
                                            ^
In file included from /home/pi/.cache/node-gyp/12.13.1/include/node/node.h:63,
                 from ../node_modules/nan/nan.h:54,
                 from ../rf24_config.hpp:6,
                 from ../irq.hpp:3,
                 from ../irq.cc:2:
/home/pi/.cache/node-gyp/12.13.1/include/node/v8.h:2608:39: note: candidate: ‘v8::Maybe<double> v8::Value::NumberValue(v8::Local<v8::Context>) const’
   V8_WARN_UNUSED_RESULT Maybe<double> NumberValue(Local<Context> context) const;
                                       ^~~~~~~~~~~
/home/pi/.cache/node-gyp/12.13.1/include/node/v8.h:2608:39: note:   candidate expects 1 argument, 0 provided
In file included from ../node_modules/nan-check/nan-check.h:17,
                 from ../rf24_config.hpp:7,
                 from ../irq.hpp:3,
                 from ../irq.cc:2:
../node_modules/nan-marshal/nan-marshal.h: In member function ‘void Nan::marshal::LoadArchive::load(T&) [with T = double]’:
../node_modules/nan-marshal/nan-marshal.h:566:45: error: no matching function for call to ‘v8::Value::NumberValue()’
             val = (double)_src->NumberValue();
                                             ^

btw switching back to node 10 solves this problem

ludiazv commented 4 years ago

Hi, Thanks @SerYojKa59 , I think you found the issue. It seems that with node 8 some V8 Apis have been deprecated and removed. The fix is not easy as it require modification on other modules such nan-check/nan-marshall. The fix is not complex but it should published by the creator of nan-check. I will try to check with him if its possible and oppened an issue here: https://github.com/BloodAxe/nan-marshal/issues/1

If not the solution will be to change the library to avoid using nan-check. This will take some time.

By now the only solution to this issue is to use run node-red using node 10.

pavelnikitiuk commented 4 years ago

thanks

ludiazv commented 4 years ago

Bad news. nan-check/marshal is unmaintained. But the author is accepting PRs. I have not time now for testing it. The changes will be simple:

If you have time to do it go ahead. :)

pavelnikitiuk commented 4 years ago

created a pr in nan-marshal package, I am also going to create an issue for nrf24 package, and will create pr with an updated version of nan-marshal as this pr will be merged https://github.com/BloodAxe/nan-marshal/pull/2

ludiazv commented 4 years ago

@pavelnikitiuk it seems that the nan-check+marshall is not beeing merged. Next week I will try to remove this dependecies by importing your patched code inside this the node base node module.

ludiazv commented 4 years ago

I managed to release a new version in npm. The module has new improvements and is ready for node 12 & 14 and as well to node-red >1.