darrylhodgins / piface-node

Node.js addon for Raspberry Pi & Piface
MIT License
24 stars 11 forks source link

Confirm whether piface-node works with A+/B+ or newer boards, with Piface Digital 2 #14

Open darrylhodgins opened 9 years ago

darrylhodgins commented 9 years ago

I don't have the Piface Digital 2 hardware to test this out. Anyone able to confirm?

markusf commented 9 years ago

Hey, I am currently compiling node.js and will check it out later!

markusf commented 9 years ago

Cannot build the node package, but I think this is caused my using v0.12.7 (is this unsupported?), Raspberry pi 2 piface2:

make: Entering directory '/home/pi/nodejs/sampleproject/nodemodules/piface-node/build' CXX(target) Release/obj.target/pfio/pfio.o ../pfio.cc:7:30: error: ‘Arguments’ does not name a type ../pfio.cc:7:41: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive] /home/pi/.node-gyp/0.12.7/deps/v8/include/v8.h: In function ‘v8::Handlev8::Value PfioInit(const int&)’: /home/pi/.node-gyp/0.12.7/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected ../pfio.cc:8:14: error: within this context ../pfio.cc:10:15: error: ‘class v8::HandleScope’ has no member named ‘Close’ ../pfio.cc:10:31: error: too few arguments to function ‘v8::Handlev8::Primitive v8::Undefined(v8::Isolate)’ /home/pi/.node-gyp/0.12.7/deps/v8/include/v8.h:305:28: note: declared here ../pfio.cc: At global scope: ../pfio.cc:13:32: error: ‘Arguments’ does not name a type ../pfio.cc:13:43: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive] /home/pi/.node-gyp/0.12.7/deps/v8/include/v8.h: In function ‘v8::Handlev8::Value PfioDeinit(const int&)’: /home/pi/.node-gyp/0.12.7/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected ../pfio.cc:14:14: error: within this context ../pfio.cc:16:15: error: ‘class v8::HandleScope’ has no member named ‘Close’ ../pfio.cc:16:31: error: too few arguments to function ‘v8::Handlev8::Primitive v8::Undefined(v8::Isolate_)’ /home/pi/.node-gyp/0.12.7/deps/v8/include/v8.h:305:28: note: declared here ../pfio.cc: At global scope: ../pfio.cc:19:37: error: ‘Arguments’ does not name a type ../pfio.cc:19:48: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive] /home/pi/.node-gyp/0.12.7/deps/v8/include/v8.h: In function ‘v8::Handlev8::Value PfioDigitalRead(const int&)’: /home/pi/.node-gyp/0.12.7/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected ../pfio.cc:20:14: error: within this context ../pfio.cc:21:35: error: invalid types ‘const int[int]’ for array subscript ../pfio.cc:23:15: error: ‘class v8::HandleScope’ has no member named ‘Close’ ../pfio.cc:23:40: error: no matching function for call to ‘v8::Integer::New(uint8t&)’ ../pfio.cc:23:40: note: candidate is: /home/pi/.node-gyp/0.12.7/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate, int32t) /home/pi/.node-gyp/0.12.7/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../pfio.cc: At global scope: ../pfio.cc:26:38: error: ‘Arguments’ does not name a type ../pfio.cc:26:49: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive] /home/pi/.node-gyp/0.12.7/deps/v8/include/v8.h: In function ‘v8::Handlev8::Value PfioDigitalWrite(const int&)’: /home/pi/.node-gyp/0.12.7/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected ../pfio.cc:27:14: error: within this context ../pfio.cc:28:35: error: invalid types ‘const int[int]’ for array subscript ../pfio.cc:29:35: error: invalid types ‘const int[int]’ for array subscript ../pfio.cc:31:15: error: ‘class v8::HandleScope’ has no member named ‘Close’ ../pfio.cc:31:31: error: too few arguments to function ‘v8::Handlev8::Primitive v8::Undefined(v8::Isolate)’ /home/pi/.node-gyp/0.12.7/deps/v8/include/v8.h:305:28: note: declared here ../pfio.cc: At global scope: ../pfio.cc:34:35: error: ‘Arguments’ does not name a type ../pfio.cc:34:46: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive] /home/pi/.node-gyp/0.12.7/deps/v8/include/v8.h: In function ‘v8::Handlev8::Value PfioReadInput(const int&)’: /home/pi/.node-gyp/0.12.7/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected ../pfio.cc:35:14: error: within this context ../pfio.cc:37:15: error: ‘class v8::HandleScope’ has no member named ‘Close’ ../pfio.cc:37:37: error: no matching function for call to ‘v8::Integer::New(uint8t&)’ ../pfio.cc:37:37: note: candidate is: /home/pi/.node-gyp/0.12.7/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate, int32_t) /home/pi/.node-gyp/0.12.7/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../pfio.cc: At global scope: ../pfio.cc:40:36: error: ‘Arguments’ does not name a type ../pfio.cc:40:47: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive] /home/pi/.node-gyp/0.12.7/deps/v8/include/v8.h: In function ‘v8::Handlev8::Value PfioReadOutput(const int&)’: /home/pi/.node-gyp/0.12.7/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected ../pfio.cc:41:14: error: within this context ../pfio.cc:43:15: error: ‘class v8::HandleScope’ has no member named ‘Close’ ../pfio.cc:43:37: error: no matching function for call to ‘v8::Integer::New(uint8t&)’ ../pfio.cc:43:37: note: candidate is: /home/pi/.node-gyp/0.12.7/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate, int32t) /home/pi/.node-gyp/0.12.7/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../pfio.cc: At global scope: ../pfio.cc:46:37: error: ‘Arguments’ does not name a type ../pfio.cc:46:48: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive] /home/pi/.node-gyp/0.12.7/deps/v8/include/v8.h: In function ‘v8::Handlev8::Value PfioWriteOutput(const int&)’: /home/pi/.node-gyp/0.12.7/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected ../pfio.cc:47:14: error: within this context ../pfio.cc:48:35: error: invalid types ‘const int[int]’ for array subscript ../pfio.cc:50:15: error: ‘class v8::HandleScope’ has no member named ‘Close’ ../pfio.cc:50:31: error: too few arguments to function ‘v8::Handlev8::Primitive v8::Undefined(v8::Isolate)’ /home/pi/.node-gyp/0.12.7/deps/v8/include/v8.h:305:28: note: declared here ../pfio.cc: In function ‘void init(v8::Handlev8::Object)’: ../pfio.cc:54:15: error: ‘NewSymbol’ is not a member of ‘v8::String’ ../pfio.cc:55:33: error: no matching function for call to ‘v8::FunctionTemplate::New(v8::Handlev8::Value (&)(const int&))’ ../pfio.cc:55:33: note: candidate is: /home/pi/.node-gyp/0.12.7/deps/v8/include/v8.h:3455:34: note: static v8::Localv8::FunctionTemplate v8::FunctionTemplate::New(v8::Isolate, v8::FunctionCallback, v8::Handlev8::Value, v8::Handlev8::Signature, int) /home/pi/.node-gyp/0.12.7/deps/v8/include/v8.h:3455:34: note: no known conversion for argument 1 from ‘v8::Handlev8::Value(const int&)’ to ‘v8::Isolate’ ../pfio.cc:56:15: error: ‘NewSymbol’ is not a member of ‘v8::String’ ../pfio.cc:57:35: error: no matching function for call to ‘v8::FunctionTemplate::New(v8::Handlev8::Value (&)(const int&))’ ../pfio.cc:57:35: note: candidate is: /home/pi/.node-gyp/0.12.7/deps/v8/include/v8.h:3455:34: note: static v8::Localv8::FunctionTemplate v8::FunctionTemplate::New(v8::Isolate, v8::FunctionCallback, v8::Handlev8::Value, v8::Handlev8::Signature, int) /home/pi/.node-gyp/0.12.7/deps/v8/include/v8.h:3455:34: note: no known conversion for argument 1 from ‘v8::Handlev8::Value(const int&)’ to ‘v8::Isolate’ ../pfio.cc:58:15: error: ‘NewSymbol’ is not a member of ‘v8::String’ ../pfio.cc:59:40: error: no matching function for call to ‘v8::FunctionTemplate::New(v8::Handlev8::Value (&)(const int&))’ ../pfio.cc:59:40: note: candidate is: /home/pi/.node-gyp/0.12.7/deps/v8/include/v8.h:3455:34: note: static v8::Localv8::FunctionTemplate v8::FunctionTemplate::New(v8::Isolate, v8::FunctionCallback, v8::Handlev8::Value, v8::Handlev8::Signature, int) /home/pi/.node-gyp/0.12.7/deps/v8/include/v8.h:3455:34: note: no known conversion for argument 1 from ‘v8::Handlev8::Value(const int&)’ to ‘v8::Isolate’ ../pfio.cc:60:15: error: ‘NewSymbol’ is not a member of ‘v8::String’ ../pfio.cc:61:41: error: no matching function for call to ‘v8::FunctionTemplate::New(v8::Handlev8::Value (&)(const int&))’ ../pfio.cc:61:41: note: candidate is: /home/pi/.node-gyp/0.12.7/deps/v8/include/v8.h:3455:34: note: static v8::Localv8::FunctionTemplate v8::FunctionTemplate::New(v8::Isolate, v8::FunctionCallback, v8::Handlev8::Value, v8::Handlev8::Signature, int) /home/pi/.node-gyp/0.12.7/deps/v8/include/v8.h:3455:34: note: no known conversion for argument 1 from ‘v8::Handlev8::Value(const int&)’ to ‘v8::Isolate’ ../pfio.cc:62:15: error: ‘NewSymbol’ is not a member of ‘v8::String’ ../pfio.cc:63:38: error: no matching function for call to ‘v8::FunctionTemplate::New(v8::Handlev8::Value (&)(const int&))’ ../pfio.cc:63:38: note: candidate is: /home/pi/.node-gyp/0.12.7/deps/v8/include/v8.h:3455:34: note: static v8::Localv8::FunctionTemplate v8::FunctionTemplate::New(v8::Isolate, v8::FunctionCallback, v8::Handlev8::Value, v8::Handlev8::Signature, int) /home/pi/.node-gyp/0.12.7/deps/v8/include/v8.h:3455:34: note: no known conversion for argument 1 from ‘v8::Handlev8::Value(const int&)’ to ‘v8::Isolate’ ../pfio.cc:64:15: error: ‘NewSymbol’ is not a member of ‘v8::String’ ../pfio.cc:65:39: error: no matching function for call to ‘v8::FunctionTemplate::New(v8::Handlev8::Value (&)(const int&))’ ../pfio.cc:65:39: note: candidate is: /home/pi/.node-gyp/0.12.7/deps/v8/include/v8.h:3455:34: note: static v8::Localv8::FunctionTemplate v8::FunctionTemplate::New(v8::Isolate, v8::FunctionCallback, v8::Handlev8::Value, v8::Handlev8::Signature, int) /home/pi/.node-gyp/0.12.7/deps/v8/include/v8.h:3455:34: note: no known conversion for argument 1 from ‘v8::Handlev8::Value(const int&)’ to ‘v8::Isolate’ ../pfio.cc:66:15: error: ‘NewSymbol’ is not a member of ‘v8::String’ ../pfio.cc:67:40: error: no matching function for call to ‘v8::FunctionTemplate::New(v8::Handlev8::Value (&)(const int&))’ ../pfio.cc:67:40: note: candidate is: /home/pi/.node-gyp/0.12.7/deps/v8/include/v8.h:3455:34: note: static v8::Localv8::FunctionTemplate v8::FunctionTemplate::New(v8::Isolate, v8::FunctionCallback, v8::Handlev8::Value, v8::Handlev8::Signature, int) /home/pi/.node-gyp/0.12.7/deps/v8/include/v8.h:3455:34: note: no known conversion for argument 1 from ‘v8::Handlev8::Value(const int&)’ to ‘v8::Isolate’ ../pfio.cc: In function ‘v8::Handlev8::Value PfioWriteOutput(const int&)’: ../pfio.cc:51:1: warning: control reaches end of non-void function [-Wreturn-type] ../pfio.cc: In function ‘v8::Handlev8::Value PfioReadOutput(const int&)’: ../pfio.cc:44:1: warning: control reaches end of non-void function [-Wreturn-type] ../pfio.cc: In function ‘v8::Handlev8::Value PfioReadInput(const int&)’: ../pfio.cc:38:1: warning: control reaches end of non-void function [-Wreturn-type] ../pfio.cc: In function ‘v8::Handlev8::Value PfioDigitalWrite(const int&)’: ../pfio.cc:32:1: warning: control reaches end of non-void function [-Wreturn-type] ../pfio.cc: In function ‘v8::Handlev8::Value PfioDigitalRead(const int&)’: ../pfio.cc:24:1: warning: control reaches end of non-void function [-Wreturn-type] ../pfio.cc: In function ‘v8::Handlev8::Value PfioDeinit(const int&)’: ../pfio.cc:17:1: warning: control reaches end of non-void function [-Wreturn-type] ../pfio.cc: In function ‘v8::Handlev8::Value PfioInit(const int&)’: ../pfio.cc:11:1: warning: control reaches end of non-void function [-Wreturn-type] pfio.target.mk:85: recipe for target 'Release/obj.target/pfio/pfio.o' failed make: _\ [Release/obj.target/pfio/pfio.o] Error 1 make: Leaving directory '/home/pi/nodejs/sampleproject/node_modules/piface-node/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:269:23) gyp ERR! stack at ChildProcess.emit (events.js:110:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12) gyp ERR! System Linux 4.1.6-v7+ gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /home/pi/nodejs/sampleproject/node_modules/piface-node gyp ERR! node -v v0.12.7 gyp ERR! node-gyp -v v2.0.1 gyp ERR! not ok npm ERR! Linux 4.1.6-v7+ npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "piface-node" "--save-dev" npm ERR! node v0.12.7 npm ERR! npm v2.11.3 npm ERR! code ELIFECYCLE

npm ERR! piface-node@0.0.6 install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the piface-node@0.0.6 install script 'node-gyp rebuild'. npm ERR! This is most likely a problem with the piface-node 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 piface-node npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /home/pi/nodejs/sampleproject/npm-debug.log

markusf commented 9 years ago

Got it working following these instructions: https://github.com/darrylhodgins/piface-node/pull/12