natevw / pi-spi

Simple RasPi SPI library (node.js)
93 stars 14 forks source link

Error installing on Rasberry model 2 #16

Closed adeptp closed 9 years ago

adeptp commented 9 years ago

npm install pi-spi on my Raspberry Pi (model 2) running Raspbian

 npm install pi-spi
\
> pi-spi@1.0.0 install /root/node_modules/pi-spi
> node-gyp rebuild

make: вход в каталог «/root/node_modules/pi-spi/build»
  CXX(target) Release/obj.target/spi_binding/spi_binding.o
In file included from ../spi_binding.cc:2:0:
../node_modules/nan/nan.h:324:27: error: redefinition of ‘template<class T> v8::Local<T> Nan::imp::NanEnsureHandleOrPersistent(const v8::Local<T>&)’
   NAN_INLINE v8::Local<T> NanEnsureHandleOrPersistent(const v8::Local<T> &val) {
                           ^
../node_modules/nan/nan.h:319:17: note: ‘template<class T> v8::Handle<T> Nan::imp::NanEnsureHandleOrPersistent(v8::Handle<T>&)’ previously declared here
   v8::Handle<T> NanEnsureHandleOrPersistent(const v8::Handle<T> &val) {
                 ^
../node_modules/nan/nan.h:344:27: error: redefinition of ‘template<class T> v8::Local<T> Nan::imp::NanEnsureLocal(v8::Handle<T>&)’
   NAN_INLINE v8::Local<T> NanEnsureLocal(const v8::Handle<T> &val) {
                           ^
../node_modules/nan/nan.h:334:27: note: ‘template<class T> v8::Local<T> Nan::imp::NanEnsureLocal(const v8::Local<T>&)’ previously declared here
   NAN_INLINE v8::Local<T> NanEnsureLocal(const v8::Local<T> &val) {
                           ^
../node_modules/nan/nan.h:757:13: error: ‘node::smalloc’ has not been declared
     , node::smalloc::FreeCallback callback
             ^
../node_modules/nan/nan.h:757:35: error: expected ‘,’ or ‘...’ before ‘callback’
     , node::smalloc::FreeCallback callback
                                   ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(char*, size_t, int)’:
../node_modules/nan/nan.h:761:50: error: ‘callback’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                  ^
../node_modules/nan/nan.h:761:60: error: ‘hint’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                            ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(const char*, uint32_t)’:
../node_modules/nan/nan.h:768:67: error: call of overloaded ‘New(v8::Isolate*, const char*&, uint32_t&)’ is ambiguous
     return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                   ^
../node_modules/nan/nan.h:768:67: note: candidates are:
In file included from ../node_modules/nan/nan.h:25:0,
                 from ../spi_binding.cc:2:
/root/.node-gyp/4.0.0/include/node/node_buffer.h:31:40: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, v8::Local<v8::String>, node::encoding) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                        ^
/root/.node-gyp/4.0.0/include/node/node_buffer.h:31:40: note:   no known conversion for argument 3 from ‘uint32_t {aka unsigned int}’ to ‘node::encoding’
/root/.node-gyp/4.0.0/include/node/node_buffer.h:43:40: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, char*, size_t) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                        ^
/root/.node-gyp/4.0.0/include/node/node_buffer.h:43:40: note:   no known conversion for argument 2 from ‘const char*’ to ‘char*’
In file included from ../spi_binding.cc:2:0:
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(uint32_t)’:
../node_modules/nan/nan.h:772:61: error: could not convert ‘node::Buffer::New(v8::Isolate::GetCurrent(), size)’ from ‘v8::MaybeLocal<v8::Object>’ to ‘v8::Local<v8::Object>’
     return node::Buffer::New(v8::Isolate::GetCurrent(), size);
                                                             ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanBufferUse(char*, uint32_t)’:
../node_modules/nan/nan.h:779:12: error: ‘Use’ is not a member of ‘node::Buffer’
     return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
            ^
../spi_binding.cc: In member function ‘virtual void SpiTransfer::Execute()’:
../spi_binding.cc:72:19: warning: missing initializer for member ‘spi_ioc_transfer::rx_nbits’ [-Wmissing-field-initializers]
                   };
                   ^
../spi_binding.cc:72:19: warning: missing initializer for member ‘spi_ioc_transfer::pad’ [-Wmissing-field-initializers]
../spi_binding.cc: In member function ‘virtual void SpiTransfer::HandleOKCallback()’:
../spi_binding.cc:125:43: warning: ‘void node::FatalException(const v8::TryCatch&)’ is deprecated (declared at /root/.node-gyp/4.0.0/include/node/node.h:282): Use FatalException(isolate, ...) [-Wdeprecated-declarations]
             node::FatalException(try_catch);
                                           ^
In file included from ../spi_binding.cc:2:0:
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(const char*, uint32_t)’:
../node_modules/nan/nan.h:769:3: warning: control reaches end of non-void function [-Wreturn-type]
   }
   ^
spi_binding.target.mk:88: ошибка выполнения рецепта для цели «Release/obj.target/spi_binding/spi_binding.o»
make: *** [Release/obj.target/spi_binding/spi_binding.o] Ошибка 1
make: выход из каталога «/root/node_modules/pi-spi/build»
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.1.10-v7+
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /root/node_modules/pi-spi
gyp ERR! node -v v4.0.0
gyp ERR! node-gyp -v v3.0.1
gyp ERR! not ok
npm ERR! Linux 4.1.10-v7+
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "pi-spi"
npm ERR! node v4.0.0
npm ERR! npm  v2.14.2
npm ERR! code ELIFECYCLE

npm ERR! pi-spi@1.0.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pi-spi@1.0.0 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the pi-spi package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls pi-spi
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /root/npm-debug.log
npm install pi-spi  15,60s user 0,99s system 65% cpu 25,161 total
adeptp commented 9 years ago

upd: node ver v4.2.0 nan ver 1.8.0

natevw commented 9 years ago

Sorry, probably needs an update to the latest nan for compatibility with whatever version Node.js is up to this week ;-)

Been completely swamped with family stuff for many months, but finally starting to calm down a little. Pull request appreciated and/or feel free to keep this in my attention if I don't fix it soon!

natevw commented 9 years ago

Can you try latest master (npm install https://github.com/natevw/pi-spi)? I have updated it to compile under latest node.js but do not have a RasPi set up to test actual transfer right now.

adeptp commented 9 years ago

Thanks for the quick response! Yes, now this library is installed. I'm glad now try to manage nrf24l01 + using your library through node.js thank.

sterling commented 9 years ago

+1

Could you please publish these changes? Would love to make use of them soon. Thanks

sterling commented 9 years ago

@natevw any plans for publishing soon?

natevw commented 9 years ago

@sterlinghw THanks for the reminder, I've been wanting to test it out for myself on an actual Raspberry Pi to make sure it's working (more than just compiling ;-) but if someone or two can confirm that they are able not just to install but to use this on a real Pi/BB/etc. with no regressions I'd be more comfortable publishing it on npm. [Though I guess worst case people just install the older version if newer one breaks…still would prefer to avoid that if possible.]

sterling commented 9 years ago

If it's any consolation, I've been using node-nrf with the latest on master for pi-spi and I've been able to communicate between my rpi2 (node v4.2.1) and arduino. I haven't directly used pi-spi, though.

adeptp commented 9 years ago

I confirm. I'm on a real raspberry 2 runs. As part of the library nrf. And transmission and reception. The library plans to use the adapter iobroker. Who I Adapt your library nrf to work in it. For it must needs describe the abstract methods. Thank you for your library.

natevw commented 9 years ago

Pushd as pi-spi@1.0.1, thanks for the reminders and reports!

sterling commented 9 years ago

:+1: