sebi2k1 / node-can Goto Github PK
View Code? Open in Web Editor NEWNodeJS SocketCAN extension
NodeJS SocketCAN extension
Hi,
I'm trying to design a web interface to control canBus using mcp2515. now, i need to set a filter for incoming data which is chosen by user in run time. is there any way to set filters without involving into kcd? if there is none, how should i change kcd in run time? can anyone do me a favor and post an example?
Can this module be used to send data over CANbus as well ?
If yes, can you post a small example. The example in the readme isnt clear. Also where are the docs hosted ?
Thanks
node-can
doesn't seem to have error and close handlers (unless I'm missing something). It'd be nice to provide this in the module, allowing us to do something if the connection to the bus fails or closes.
When creating the channel, this can be caught using a try..catch
, but how would I go about doing after we have a working channel?
For some reason all the signal decoding tests are failing. Need to investigate.
We're considering using this with our open sourced project. What type of license is this intended to have?
The current implementation does not support extended multiplexing.
Extended multiplexing allows defining several multiplexors in a message and a signal can be multiplexed for more than one multiplexor value. A multiplexed signal can also serve as multiplexor signal for other multiplexed signals, meaning that hierarchical multiplexing can be modeled.
-> Extended multiplexing would be a great enhancement but likely requires a little remodeling of the current object structure. That could require breaking changes.
The quote above is taken from the Vector document below, but the kcd file format also supports it:
Extended Multiplexing
Hi Seb,
where can I find the defintion for the .kcd entries? And is any tool out there to generate an appropriate .kcd file?
--- Hermann
I want to decode all signals of a message at once based on the kcd information, something along these lines:
"use strict";
var can = require('socketcan');
var fs = require('fs');
// Parse database
var network = can.parseNetworkDescription("GWI_TT.kcd");
var channel = can.createRawChannel("can0");
var db = new can.DatabaseService(channel, network.buses["Private"]);
channel.addListener("onMessage", function(msg) {
console.log(msg);
let message_info = db.messages[msg.id];
if (message_info.id == '3')
{
for (let signal_name in message_info.signals)
{
let signal_info = message_info.signals[signal_name];
// decode that value based on information in signal_info
let value = ???
}
}
} );
channel.start();
Any hints appreciated.
Hi,
I tried to read 32 bit but it returns zero. Can you change the test function with below and confirm?
exports['little_endian_decode'] = function(test) {
data = new Buffer([0xDE, 0xAD, 0xBE, 0xEF, 0xCA, 0xFE, 0xBA, 0xBE]);
test.equals(signals.decode_signal(data, 0, 8, true, false), 0xDE);
test.equals(signals.decode_signal(data, 0, 12, true, false), 0xDDE);
test.equals(signals.decode_signal(data, 0, 16, true, false), 0xADDE);
test.equals(signals.decode_signal(data, 0, 24, true, false), 0xBEADDE);
test.equals(signals.decode_signal(data, 0, 32, true, false), 0xEFBEADDE);
test.equals(signals.decode_signal(data, 12, 8, true, false), 0xEA);
test.equals(signals.decode_signal(data, 12, 12, true, false), 0xBEA);
test.equals(signals.decode_signal(data, 12, 20, true, false), 0xEFBEA);
test.equals(signals.decode_signal(data, 12, 36, true, false), 0xCAEFBEA);
test.equals(signals.decode_signal(data, 0, 1, true, false), 0);
test.equals(signals.decode_signal(data, 1, 1, true, false), 1);
test.equals(signals.decode_signal(data, 2, 1, true, false), 1);
test.equals(signals.decode_signal(data, 3, 1, true, false), 1);
test.done();
}
Also, tried to fix the return value type, but no luck:
Local<Number> retval;
uint64_t val = _getvalue(data, offset, bitLength, endianess);
// Value shall be interpreted as signed (2's complement)
if (isSigned && val & (1 << (bitLength - 1))) {
int64_t tmp = -1 * (~((UINT64_MAX << bitLength) | val) + 1);
retval = Number::New(Isolate::GetCurrent(), tmp);
} else {
retval = Number::New(Isolate::GetCurrent(), val);
}
info.GetReturnValue().Set(retval);
Sorry to disturb, but I can not find information which needs to put to the node as "ID number".
I'm using Ubuntu 16,04, and I have the can0 connection. Is it 0 is ID?
Thanks
new Buffer(...)
is unsafe and deprecated. Could the code in these places be changed to Buffer.from(...)
?
Hey guys,
I'd really appreciate some help in the following regard.
We're developing on Windows machines but our target will be a small embedded Linux. Communication should use CAN and that's how I stumpled upon this very promising package.
I intended to add a conditional switch in my application: use some sort of CAN-dummy-mock during development on Windows then build it via Webpack and deploy it to Linux where socketcan
can be used.
However, when I try to install it using yarn add socketcan
I receive the following error:
info [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
error [email protected]: The platform "win32" is incompatible with this module.
error Found incompatible module
I understand that this is due to fsevents needing Linux/OSx to work but is there a way to get it to install anyway and only make use of it on the target system?
Best regards,
Rolf
The current implementation requires the user to append a ".[multiplexor value]" to the name of the multiplexed message that he wants to send.
IMHO requiring the user to just set the multiplexor value through the signal API and then call send on the message would be the more natural approach. And it does also work when extended multiplexing becomes implemented.
I downloaded the Github version - unzipped it then executed the following commands
and i get the following error
npm ERR! code ENOSELF
npm ERR! Refusing to install package with name "socketcan" under a package
npm ERR! also called "socketcan". Did you name your project the same
npm ERR! as the dependency you're installing?
npm ERR!
npm ERR! For more information, see:
npm ERR! https://docs.npmjs.com/cli/install#limitations-of-npms-install-algorithm
npm ERR! A complete log of this run can be found in:
npm ERR! /home/pi/.npm/_logs/2019-01-18T21_00_39_714Z-debug.log
Tried to add ---Force to NPM to force the install without sucess
Is it possible in perspective or now use CAN on the windows machine?
The current implementation does not support signals of floating point types single or double.
I have the following:
Request:
`cansend can0 7E0#0322F12100000000`
Response:
$ candump -L can0 | grep '7E8#'
(1555792813.746362) can0 7E8#037F2278AAAAAAAA
(1555792813.832389) can0 7E8#102162F121313737
Would I need to send the response as 2 messages to the channel? Note how the length byte on the second message is 0x10
, which is greater than 0x08
(aren't all CAN messages supposed to be 0x08 bytes long)?
Hi,
I'm using a bog standard MCP2515 based can board to communicate with another device. It seems to get all the data just fine until I get message like this though.
can0 0DFFFFFF [8] remote request
That seems to kill the network and I need to down/up can0 to get it working again until the next remote request. Is there a way to stop this behaviour?
Thanks,
Rob
var can = require('socketcan');
var network = can.parseNetworkDescription("node_modules/socketcan/samples/can_definition_sample.kcd");
console.log(JSON.stringify(network, null, ' '));
yields the following output
....
{
"name": "SpeedKm",
"bitLength": 24,
"endianess": "little",
"labels": {},
"slope": 0.2,
"intercept": 0,
"units": "",
"type": "unsigned",
"defaultValue": 0,
"bitOffset": 30
},
...
but the kcd file contains a unit
<Signal name="SpeedKm" offset="30" length="24" endianess="little">
<Notes>Middle speed of front wheels in kilometers per hour.</Notes>
<Consumer>
<NodeRef id="12"/>
<NodeRef id="16"/>
</Consumer>
<Value slope="0.2" intercept="0" unit="km/h"/>
<LabelSet>
<Label type="error" name="invalid" value="16777215"/>
</LabelSet>
</Signal>
The parse_kcd.js file seems to overlook the Multiplexer groups. Is there planned support for this?
Need to write some test cases for MUX support.
Hi, I'm trying to get this running with:
var can = require('socketcan');
var channel = can.createRawChannel("vcan0", true);
and I get an error:
/home/jedc/node_modules/socketcan/socketcan.js:35
return new can.RawChannel(channel, timestamps);;
^
Error: Error while creating channel
at Object.exports.createRawChannel (/home/jedc/node_modules/socketcan/socketcan.js:35:10)
at Object. (/home/jedc/socket_can_example.js:3:19)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:902:3
any help would be appreciated.
Hello,
When I send a CAN frame and bus gets in warning state (TX err = 119) the onMessage
callback is not launched. I see tx/rx frames with candump
but can't handle them with socketcan.
Can you help me guys with this issue?
Thanks.
First of all, thank you for writing this library!
Processing 10k CAN messages per second takes about 40% of the CPU on my fairly beefy laptop ( i7-4710MQ CPU @ 2.50GHz), while the equivalent golang and rust programs take about ~4.5% cpu.
These are numbers reported by htop.
I do expect rust and golang to be faster, but as socketcan is written in C++ so not that much faster. Profiling the code revealed that most of the time (95%) it is in epoll_pwait waiting for work. This might be a lie by the node profiler however, as presumably the process is simply waiting for work.
My question is: Is this the expected overhead from libuv? Or something tunable? Like the poll timeout (currently 100 ms)?
Below are the results of my testing, I've tried to elide uninteresting details, if I elided something useful I'm happy to provide them.
Writing about 10k can msgs per second to the vcan0
using cangen
. The test program canjs.js
simply just reads those can messages with a trivial handler.
$ cat canjs.js
var socketcan = require("socketcan");
cs = socketcan.createRawChannel("vcan0", true);
console.log("canjs connected");
cs.addListener("onMessage", function(msg) {
// console.log(msg.id);
var a = msg.id;
});
cs.start();
Profiling canjs.js
reveals that major of the ticks are spent in epoll_pwait
$ node --prof canjs.js
canjs connected
[wait few seconds]
^C
$ node --prof-process isolate-0x*.log
[...]
[Summary]:
ticks total nonlib name
21 0.1% 0.1% JavaScript
16430 99.4% 99.8% C++
15 0.1% 0.1% GC
63 0.4% Shared libraries
11 0.1% Unaccounted
[...]
[C++]:
ticks total nonlib name
15682 94.9% 95.3% epoll_pwait
140 0.8% 0.9% __libc_recv
60 0.4% 0.4% ioctl
[...]
Using strace
I found that epoll_pwait
is called everytime async_receiver_ready
finish exhausting the available messages on the socket. Presumably by libuv, as the uv_loop
is epoll-based on linux.
$ strace -rqp [pid] # showing the single thread as the multi-thread is just harder to follow.
[...]
0.000029 recvfrom(20, "\202\6\0\0\1\0\0\0`\0\0\0\0\0\0\0", 16, MSG_DONTWAIT, NULL, NULL) = 16
0.000027 ioctl(20, SIOCGSTAMP, 0x7ffd3630af00) = 0
0.000030 recvfrom(20, "\322\2\0\0\6\0\0\0U3v3z\216\0\0", 16, MSG_DONTWAIT, NULL, NULL) = 16
0.000028 ioctl(20, SIOCGSTAMP, 0x7ffd3630af00) = 0
0.000027 recvfrom(20, 0x7ffd3630af80, 16, MSG_DONTWAIT, NULL, NULL) = -1 EAGAIN (Resource temporarily unavailable)
0.000022 epoll_pwait(3, [{EPOLLIN, {u32=8, u64=8}}], 1024, -1, NULL, 8) = 1
[...]
If we summarize the syscalls made epoll_pwait
falls in the ranking. The futex'es are seemingly only during the start-up.
$ strace -cfq node canjs.js
canjs connected
[wait few seconds]
^C
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
80.01 19.304016 53922 358 17 futex
10.63 2.565721 12 221348 poll
2.96 0.714898 5 141162 33658 recvfrom
2.76 0.665723 6 107536 10 ioctl
1.77 0.426898 13 33659 epoll_pwait
1.08 0.260565 8 33663 write
0.76 0.183782 5 33702 read
0.01 0.001323 12 114 brk
0.00 0.000992 1 842 mprotect
0.00 0.000526 8 67 mmap
0.00 0.000242 3 72 20 open
0.00 0.000202 6 33 munmap
0.00 0.000183 5 35 rt_sigaction
0.00 0.000155 1 140 65 stat
0.00 0.000107 10 11 11 access
[...]
I've been getting this error and I'm stuck to see why. I've attached my definitions file below too so you can see the formatting. Thanks
events.js:160
throw er; // Unhandled 'error' event
^
TypeError: Cannot read property 'NetworkDefinition' of undefined
<NetworkDefinition>
<Node id="4" name="Main Encoder"/>
<Node id="6" name="Wing Instrumentation"/>
<Node id="7" name="Tower Top"/>
<Node id="8" name="Wind Sensor"/>
<Node id="10" name="Safety Brake"/>
<Node id="14" name="UPS Control"/>
<Node id="11" name="Servo Drive 1"/>
<Node id="12" name="Servo Drive 2"/>
<Node id="13" name="Servo Drive 3"/>
<Node id="9" name="Inverter Control"/>
<Node id="1" name="Master 1"/>
<Bus name="Turbine">
<Message id="0x6050h" name="Wind">
<Consumer>
<NodeRef id="8"/>
</Consumer>
<Signal name="SpeedMPH" offset="0"/></Signal>
</Message>
</Bus>
</NetworkDefinition>
I am a rookie at this CAN bus stuff, and in the process I was attempting to create a program similar to cansend in can-utils with this extension. I was able to get a reply message as the example program shows, but have not yet found a way to send my own hex value through the function, or find a way to hard code a value to make sure that it is working. Any help to do this would be greatly appreciated.
Hi!
While trying to install via npm install socketcan it fails for me.
I updated to latest nodejs but still didn't help.
I noticed that it during the install complained that it couldn't find the module nan. So I did a npm install nan and after that the npm install socketcan worked.
Could it be that you have forgotten to add nan in the package.json I can only see it under devDependencies and not dependencies. But I'm not to good with how these package.json files work.
Hi !
Following the example to update and send a message :
// Update tank temperature
db.messages["TankController"].signals["TankTemperature"].update(80);
// Trigger sending this message
db.send("TankController");
How could I send a message that as no value that would be defined such as the following in a kcd file :
<Message id="0x00A" name="Airbag">
<Producer>
<NodeRef id="2"/>
</Producer>
<Signal name="DriverAirbagFired" offset="0"/>
<Signal name="CodriverAirbagFired" offset="1"/>
<Signal name="DriverSeatOccupied" offset="2"/>
<Signal name="CodriverSeatOccupied" offset="3"/>
<Signal name="DriverSeatbeltLocked" offset="4"/>
<Signal name="CodriverSeatbeltLocked" offset="5"/>
<Signal name="AirbagConfiguration" offset="8" length="8"/>
<Signal name="SeatConfiguration" offset="16" length="8"/>
</Message>
How to update and send such message if i want to send for example the signal "DriverSeatOccupied" ?
db.messages["Airbag"].signals["DriverSeatOccupied"].update(??);
Many thanks for your help!
How can I trace back what is causing so many CAN bus errors?
The current implementation of e.g. EncodeSignal assumes the signal to fit into a 32 bit (u)int type. The Vector dbc format allows signals of up to 64 bit for non FD and 512 bit for FD.
The current implementation is a simplification of the Simple Signal Multiplexing described here.
It is simplified in that the multiplexor signal is assumed to be in the first byte of the payload. The multiplexor signal should be as flexible in positioning and length as any other signal. Further, I think its value can also be of one of the usual four suspects (signed/unsigned/single/double).
I've tried executing node-gyp configure && node-gyp build on both a native raspberry pi 2 (arm v7) and via cross compilation with the same errors. I'm running node & npm at versions v0.12.4 and 2.10.1 respectively built from the latest source via the node-js website.
pi@raspberrypi ~/node-can-master $ node-gyp build
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | arm
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/home/pi/node-can-master/build'
CXX(target) Release/obj.target/can/src/raw.o
In file included from ../src/raw.cc:36:0:
../src/raw.h:56:1: error: expected class-name before ‘{’ token
../src/raw.h:70:36: error: ‘Arguments’ does not name a type
../src/raw.h:70:47: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/raw.h:79:44: error: ‘Arguments’ does not name a type
../src/raw.h:79:55: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/raw.h:85:38: error: ‘Arguments’ does not name a type
../src/raw.h:85:49: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/raw.h:91:37: error: ‘Arguments’ does not name a type
../src/raw.h:91:48: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/raw.h:98:37: error: ‘Arguments’ does not name a type
../src/raw.h:98:48: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
In file included from ../src/raw.cc:36:0:
../src/raw.h:105:45: error: ‘Arguments’ does not name a type
../src/raw.h:105:56: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/raw.h:112:48: error: ‘Arguments’ does not name a type
../src/raw.h:112:59: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
../src/raw.h:115:5: error: ‘uv_async_t’ has not been declared
../src/raw.h:123:5: error: ‘uv_async_t’ does not name a type
../src/raw.h: In static member function ‘static void RawChannel::async_receiver_ready_cb(int*, int)’:
../src/raw.h:115:5: error: request for member ‘data’ in ‘* handle’, which is of non-class type ‘int’
../src/raw.h:115:5: error: request for member ‘data’ in ‘* handle’, which is of non-class type ‘int’
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h: In static member function ‘static void RawChannel::Init(v8::Handle<v8::Object>)’:
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected
../src/raw.cc:113:17: error: within this context
../src/raw.cc:115:58: error: no matching function for call to ‘v8::FunctionTemplate::New(v8::Handle<v8::Value> (&)(const int&))’
../src/raw.cc:115:58: note: candidate is:
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:3455:34: note: static v8::Local<v8::FunctionTemplate> v8::FunctionTemplate::New(v8::Isolate*, v8::FunctionCallback, v8::Handle<v8::Value>, v8::Handle<v8::Signature>, int)
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:3455:34: note: no known conversion for argument 1 from ‘v8::Handle<v8::Value>(const int&)’ to ‘v8::Isolate*’
../src/raw.cc:117:47: error: no matching function for call to ‘v8::Persistent<v8::FunctionTemplate>::New(v8::Local<v8::FunctionTemplate>&)’
../src/raw.cc:117:47: note: candidate is:
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:5798:4: note: static T* v8::PersistentBase<T>::New(v8::Isolate*, T*) [with T = v8::FunctionTemplate]
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:5798:4: note: candidate expects 2 arguments, 1 provided
../src/raw.cc:118:9: error: base operand of ‘->’ has non-pointer type ‘v8::Persistent<v8::FunctionTemplate>’
../src/raw.cc:119:9: error: base operand of ‘->’ has non-pointer type ‘v8::Persistent<v8::FunctionTemplate>’
../src/raw.cc:119:24: error: ‘NewSymbol’ is not a member of ‘v8::String’
../src/raw.cc:121:64: error: could not convert ‘RawChannel::s_ct’ from ‘v8::Persistent<v8::FunctionTemplate>’ to ‘v8::Handle<v8::FunctionTemplate>’
../src/raw.cc:122:58: error: could not convert ‘RawChannel::s_ct’ from ‘v8::Persistent<v8::FunctionTemplate>’ to ‘v8::Handle<v8::FunctionTemplate>’
../src/raw.cc:123:57: error: could not convert ‘RawChannel::s_ct’ from ‘v8::Persistent<v8::FunctionTemplate>’ to ‘v8::Handle<v8::FunctionTemplate>’
../src/raw.cc:124:57: error: could not convert ‘RawChannel::s_ct’ from ‘v8::Persistent<v8::FunctionTemplate>’ to ‘v8::Handle<v8::FunctionTemplate>’
../src/raw.cc:125:65: error: could not convert ‘RawChannel::s_ct’ from ‘v8::Persistent<v8::FunctionTemplate>’ to ‘v8::Handle<v8::FunctionTemplate>’
../src/raw.cc:126:72: error: could not convert ‘RawChannel::s_ct’ from ‘v8::Persistent<v8::FunctionTemplate>’ to ‘v8::Handle<v8::FunctionTemplate>’
../src/raw.cc:128:17: error: ‘NewSymbol’ is not a member of ‘v8::String’
../src/raw.cc:128:54: error: base operand of ‘->’ has non-pointer type ‘v8::Persistent<v8::FunctionTemplate>’
../src/raw.cc:130:42: error: ‘NODE_PSYMBOL’ was not declared in this scope
../src/raw.cc: At global scope:
../src/raw.cc:141:37: error: ‘Arguments’ does not name a type
../src/raw.cc:141:48: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h: In static member function ‘static v8::Handle<v8::Value> RawChannel::New(const int&)’:
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected
../src/raw.cc:143:17: error: within this context
../src/raw.cc:146:5: error: request for member ‘Length’ in ‘args’, which is of non-class type ‘const int’
../src/raw.cc:146:5: error: ‘New’ is not a member of ‘v8::String’
../src/raw.cc:146:5: error: ‘ThrowException’ was not declared in this scope
../src/raw.cc:147:5: error: invalid types ‘const int[int]’ for array subscript
../src/raw.cc:147:5: error: ‘New’ is not a member of ‘v8::String’
../src/raw.cc:147:5: error: ‘ThrowException’ was not declared in this scope
../src/raw.cc:149:5: error: ‘AsciiValue’ is not a member of ‘v8::String’
../src/raw.cc:149:24: error: expected ‘;’ before ‘ascii’
../src/raw.cc:151:14: error: request for member ‘Length’ in ‘args’, which is of non-class type ‘const int’
../src/raw.cc:153:19: error: invalid types ‘const int[int]’ for array subscript
../src/raw.cc:154:32: error: invalid types ‘const int[int]’ for array subscript
../src/raw.cc:157:38: error: ‘ascii’ was not declared in this scope
../src/raw.cc:158:9: error: ‘class RawChannel’ has no member named ‘Wrap’
../src/raw.cc:158:19: error: request for member ‘This’ in ‘args’, which is of non-class type ‘const int’
../src/raw.cc:160:5: error: ‘New’ is not a member of ‘v8::String’
../src/raw.cc:160:5: error: ‘ThrowException’ was not declared in this scope
../src/raw.cc:162:18: error: ‘class v8::HandleScope’ has no member named ‘Close’
../src/raw.cc:162:29: error: request for member ‘This’ in ‘args’, which is of non-class type ‘const int’
../src/raw.cc: At global scope:
../src/raw.cc:165:45: error: ‘Arguments’ does not name a type
../src/raw.cc:165:56: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h: In static member function ‘static v8::Handle<v8::Value> RawChannel::AddListener(const int&)’:
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected
../src/raw.cc:167:17: error: within this context
../src/raw.cc:169:22: error: ‘ObjectWrap’ has not been declared
../src/raw.cc:169:51: error: expected primary-expression before ‘>’ token
../src/raw.cc:169:58: error: request for member ‘This’ in ‘args’, which is of non-class type ‘const int’
../src/raw.cc:171:5: error: request for member ‘Length’ in ‘args’, which is of non-class type ‘const int’
../src/raw.cc:171:5: error: ‘New’ is not a member of ‘v8::String’
../src/raw.cc:171:5: error: ‘ThrowException’ was not declared in this scope
../src/raw.cc:173:5: error: invalid types ‘const int[int]’ for array subscript
../src/raw.cc:173:5: error: ‘New’ is not a member of ‘v8::String’
../src/raw.cc:173:5: error: ‘ThrowException’ was not declared in this scope
../src/raw.cc:178:15: error: invalid types ‘const int[int]’ for array subscript
../src/raw.cc:179:48: error: invalid types ‘const int[int]’ for array subscript
../src/raw.cc:179:61: error: expected primary-expression before ‘>’ token
../src/raw.cc:179:63: error: expected primary-expression before ‘)’ token
../src/raw.cc:181:14: error: request for member ‘Length’ in ‘args’, which is of non-class type ‘const int’
../src/raw.cc:183:19: error: invalid types ‘const int[int]’ for array subscript
../src/raw.cc:184:52: error: invalid types ‘const int[int]’ for array subscript
../src/raw.cc:193:18: error: ‘class v8::HandleScope’ has no member named ‘Close’
../src/raw.cc:193:34: error: too few arguments to function ‘v8::Handle<v8::Primitive> v8::Undefined(v8::Isolate*)’
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:305:28: note: declared here
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h: In function ‘bool ObjectToFilter(v8::Handle<v8::Object>, can_filter*)’:
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected
../src/raw.cc:198:17: error: within this context
../src/raw.cc:200:45: error: no matching function for call to ‘v8::Object::Get(v8::Persistent<v8::String>&)’
../src/raw.cc:200:45: note: candidates are:
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2128:16: note: v8::Local<v8::Value> v8::Object::Get(v8::Handle<v8::Value>)
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2128:16: note: no known conversion for argument 1 from ‘v8::Persistent<v8::String>’ to ‘v8::Handle<v8::Value>’
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2130:16: note: v8::Local<v8::Value> v8::Object::Get(uint32_t)
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2130:16: note: no known conversion for argument 1 from ‘v8::Persistent<v8::String>’ to ‘uint32_t {aka unsigned int}’
../src/raw.cc:201:49: error: no matching function for call to ‘v8::Object::Get(v8::Persistent<v8::String>&)’
../src/raw.cc:201:49: note: candidates are:
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2128:16: note: v8::Local<v8::Value> v8::Object::Get(v8::Handle<v8::Value>)
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2128:16: note: no known conversion for argument 1 from ‘v8::Persistent<v8::String>’ to ‘v8::Handle<v8::Value>’
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2130:16: note: v8::Local<v8::Value> v8::Object::Get(uint32_t)
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2130:16: note: no known conversion for argument 1 from ‘v8::Persistent<v8::String>’ to ‘uint32_t {aka unsigned int}’
../src/raw.cc:209:34: error: no matching function for call to ‘v8::Object::Get(v8::Persistent<v8::String>&)’
../src/raw.cc:209:34: note: candidates are:
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2128:16: note: v8::Local<v8::Value> v8::Object::Get(v8::Handle<v8::Value>)
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2128:16: note: no known conversion for argument 1 from ‘v8::Persistent<v8::String>’ to ‘v8::Handle<v8::Value>’
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2130:16: note: v8::Local<v8::Value> v8::Object::Get(uint32_t)
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2130:16: note: no known conversion for argument 1 from ‘v8::Persistent<v8::String>’ to ‘uint32_t {aka unsigned int}’
../src/raw.cc: At global scope:
../src/raw.cc:217:49: error: ‘Arguments’ does not name a type
../src/raw.cc:217:60: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h: In static member function ‘static v8::Handle<v8::Value> RawChannel::DisableLoopback(const int&)’:
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected
../src/raw.cc:219:17: error: within this context
../src/raw.cc:221:22: error: ‘ObjectWrap’ has not been declared
../src/raw.cc:221:51: error: expected primary-expression before ‘>’ token
../src/raw.cc:221:58: error: request for member ‘This’ in ‘args’, which is of non-class type ‘const int’
../src/raw.cc:222:5: error: ‘New’ is not a member of ‘v8::String’
../src/raw.cc:222:5: error: ‘ThrowException’ was not declared in this scope
../src/raw.cc:226:17: error: request for member ‘This’ in ‘args’, which is of non-class type ‘const int’
../src/raw.cc: At global scope:
../src/raw.cc:229:46: error: ‘Arguments’ does not name a type
../src/raw.cc:229:57: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h: In static member function ‘static v8::Handle<v8::Value> RawChannel::SetRxFilters(const int&)’:
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected
../src/raw.cc:231:17: error: within this context
../src/raw.cc:233:22: error: ‘ObjectWrap’ has not been declared
../src/raw.cc:233:51: error: expected primary-expression before ‘>’ token
../src/raw.cc:233:58: error: request for member ‘This’ in ‘args’, which is of non-class type ‘const int’
../src/raw.cc:235:5: error: request for member ‘Length’ in ‘args’, which is of non-class type ‘const int’
../src/raw.cc:235:5: error: ‘New’ is not a member of ‘v8::String’
../src/raw.cc:235:5: error: ‘ThrowException’ was not declared in this scope
../src/raw.cc:236:5: error: invalid types ‘const int[int]’ for array subscript
../src/raw.cc:236:5: error: invalid types ‘const int[int]’ for array subscript
../src/raw.cc:236:5: error: ‘New’ is not a member of ‘v8::String’
../src/raw.cc:236:5: error: ‘ThrowException’ was not declared in this scope
../src/raw.cc:238:5: error: ‘New’ is not a member of ‘v8::String’
../src/raw.cc:238:5: error: ‘ThrowException’ was not declared in this scope
../src/raw.cc:243:15: error: invalid types ‘const int[int]’ for array subscript
../src/raw.cc:245:54: error: invalid types ‘const int[int]’ for array subscript
../src/raw.cc:250:9: error: ‘New’ is not a member of ‘v8::String’
../src/raw.cc:250:9: error: ‘ThrowException’ was not declared in this scope
../src/raw.cc:264:9: error: ‘New’ is not a member of ‘v8::String’
../src/raw.cc:264:9: error: ‘ThrowException’ was not declared in this scope
../src/raw.cc:266:34: error: invalid types ‘const int[int]’ for array subscript
../src/raw.cc:276:17: error: request for member ‘This’ in ‘args’, which is of non-class type ‘const int’
../src/raw.cc: At global scope:
../src/raw.cc:279:39: error: ‘Arguments’ does not name a type
../src/raw.cc:279:50: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h: In static member function ‘static v8::Handle<v8::Value> RawChannel::Start(const int&)’:
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected
../src/raw.cc:281:17: error: within this context
../src/raw.cc:283:22: error: ‘ObjectWrap’ has not been declared
../src/raw.cc:283:51: error: expected primary-expression before ‘>’ token
../src/raw.cc:283:58: error: request for member ‘This’ in ‘args’, which is of non-class type ‘const int’
../src/raw.cc:286:48: error: ‘New’ is not a member of ‘v8::String’
../src/raw.cc:286:92: error: ‘ThrowException’ was not declared in this scope
../src/raw.cc:288:35: error: ‘uv_default_loop’ was not declared in this scope
../src/raw.cc:288:43: error: ‘class RawChannel’ has no member named ‘m_AsyncReceiverReady’
../src/raw.cc:288:88: error: ‘uv_async_init’ was not declared in this scope
../src/raw.cc:289:9: error: ‘class RawChannel’ has no member named ‘m_AsyncReceiverReady’
../src/raw.cc:295:48: error: ‘New’ is not a member of ‘v8::String’
../src/raw.cc:295:94: error: ‘ThrowException’ was not declared in this scope
../src/raw.cc:297:9: error: ‘class RawChannel’ has no member named ‘Ref’
../src/raw.cc:299:17: error: request for member ‘This’ in ‘args’, which is of non-class type ‘const int’
../src/raw.cc: At global scope:
../src/raw.cc:302:38: error: ‘Arguments’ does not name a type
../src/raw.cc:302:49: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h: In static member function ‘static v8::Handle<v8::Value> RawChannel::Stop(const int&)’:
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected
../src/raw.cc:304:17: error: within this context
../src/raw.cc:306:22: error: ‘ObjectWrap’ has not been declared
../src/raw.cc:306:51: error: expected primary-expression before ‘>’ token
../src/raw.cc:306:58: error: request for member ‘This’ in ‘args’, which is of non-class type ‘const int’
../src/raw.cc:308:5: error: ‘New’ is not a member of ‘v8::String’
../src/raw.cc:308:5: error: ‘ThrowException’ was not declared in this scope
../src/raw.cc:314:15: error: ‘uv_handle_t’ was not declared in this scope
../src/raw.cc:314:28: error: expected primary-expression before ‘)’ token
../src/raw.cc:314:34: error: ‘class RawChannel’ has no member named ‘m_AsyncReceiverReady’
../src/raw.cc:314:60: error: ‘uv_close’ was not declared in this scope
../src/raw.cc:316:9: error: ‘class RawChannel’ has no member named ‘Unref’
../src/raw.cc:318:17: error: request for member ‘This’ in ‘args’, which is of non-class type ‘const int’
../src/raw.cc: At global scope:
../src/raw.cc:325:38: error: ‘Arguments’ does not name a type
../src/raw.cc:325:49: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h: In static member function ‘static v8::Handle<v8::Value> RawChannel::Send(const int&)’:
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected
../src/raw.cc:327:17: error: within this context
../src/raw.cc:329:22: error: ‘ObjectWrap’ has not been declared
../src/raw.cc:329:51: error: expected primary-expression before ‘>’ token
../src/raw.cc:329:58: error: request for member ‘This’ in ‘args’, which is of non-class type ‘const int’
../src/raw.cc:331:9: error: request for member ‘Length’ in ‘args’, which is of non-class type ‘const int’
../src/raw.cc:332:48: error: ‘New’ is not a member of ‘v8::String’
../src/raw.cc:332:81: error: ‘ThrowException’ was not declared in this scope
../src/raw.cc:334:9: error: invalid types ‘const int[int]’ for array subscript
../src/raw.cc:335:48: error: ‘New’ is not a member of ‘v8::String’
../src/raw.cc:335:96: error: ‘ThrowException’ was not declared in this scope
../src/raw.cc:338:48: error: ‘New’ is not a member of ‘v8::String’
../src/raw.cc:338:79: error: ‘ThrowException’ was not declared in this scope
../src/raw.cc:342:32: error: invalid types ‘const int[int]’ for array subscript
../src/raw.cc:346:38: error: no matching function for call to ‘v8::Object::Get(v8::Persistent<v8::String>&)’
../src/raw.cc:346:38: note: candidates are:
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2128:16: note: v8::Local<v8::Value> v8::Object::Get(v8::Handle<v8::Value>)
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2128:16: note: no known conversion for argument 1 from ‘v8::Persistent<v8::String>’ to ‘v8::Handle<v8::Value>’
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2130:16: note: v8::Local<v8::Value> v8::Object::Get(uint32_t)
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2130:16: note: no known conversion for argument 1 from ‘v8::Persistent<v8::String>’ to ‘uint32_t {aka unsigned int}’
../src/raw.cc:348:28: error: no matching function for call to ‘v8::Object::Get(v8::Persistent<v8::String>&)’
../src/raw.cc:348:28: note: candidates are:
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2128:16: note: v8::Local<v8::Value> v8::Object::Get(v8::Handle<v8::Value>)
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2128:16: note: no known conversion for argument 1 from ‘v8::Persistent<v8::String>’ to ‘v8::Handle<v8::Value>’
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2130:16: note: v8::Local<v8::Value> v8::Object::Get(uint32_t)
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2130:16: note: no known conversion for argument 1 from ‘v8::Persistent<v8::String>’ to ‘uint32_t {aka unsigned int}’
../src/raw.cc:351:28: error: no matching function for call to ‘v8::Object::Get(v8::Persistent<v8::String>&)’
../src/raw.cc:351:28: note: candidates are:
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2128:16: note: v8::Local<v8::Value> v8::Object::Get(v8::Handle<v8::Value>)
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2128:16: note: no known conversion for argument 1 from ‘v8::Persistent<v8::String>’ to ‘v8::Handle<v8::Value>’
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2130:16: note: v8::Local<v8::Value> v8::Object::Get(uint32_t)
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2130:16: note: no known conversion for argument 1 from ‘v8::Persistent<v8::String>’ to ‘uint32_t {aka unsigned int}’
../src/raw.cc:354:48: error: no matching function for call to ‘v8::Object::Get(v8::Persistent<v8::String>&)’
../src/raw.cc:354:48: note: candidates are:
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2128:16: note: v8::Local<v8::Value> v8::Object::Get(v8::Handle<v8::Value>)
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2128:16: note: no known conversion for argument 1 from ‘v8::Persistent<v8::String>’ to ‘v8::Handle<v8::Value>’
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2130:16: note: v8::Local<v8::Value> v8::Object::Get(uint32_t)
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2130:16: note: no known conversion for argument 1 from ‘v8::Persistent<v8::String>’ to ‘uint32_t {aka unsigned int}’
../src/raw.cc:357:48: error: ‘New’ is not a member of ‘v8::String’
../src/raw.cc:357:91: error: ‘ThrowException’ was not declared in this scope
../src/raw.cc:366:54: error: no matching function for call to ‘v8::Uint32::New(__time_t&)’
../src/raw.cc:366:54: note: candidate is:
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Local<v8::Integer> v8::Integer::New(v8::Isolate*, int32_t)
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided
../src/raw.cc:367:56: error: no matching function for call to ‘v8::Uint32::New(__suseconds_t&)’
../src/raw.cc:367:56: note: candidate is:
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Local<v8::Integer> v8::Integer::New(v8::Isolate*, int32_t)
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided
../src/raw.cc:373:24: error: no matching function for call to ‘v8::Int32::New(int&)’
../src/raw.cc:373:24: note: candidate is:
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Local<v8::Integer> v8::Integer::New(v8::Isolate*, int32_t)
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h: In member function ‘void RawChannel::async_receiver_ready(int)’:
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:816:13: error: ‘v8::HandleScope::HandleScope()’ is protected
../src/raw.cc:378:17: error: within this context
../src/raw.cc:388:41: error: no matching function for call to ‘v8::Object::New()’
../src/raw.cc:388:41: note: candidate is:
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2388:24: note: static v8::Local<v8::Object> v8::Object::New(v8::Isolate*)
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2388:24: note: candidate expects 1 argument, 0 provided
../src/raw.cc:406:61: error: no matching function for call to ‘v8::Uint32::New(__time_t&)’
../src/raw.cc:406:61: note: candidate is:
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Local<v8::Integer> v8::Integer::New(v8::Isolate*, int32_t)
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided
../src/raw.cc:407:63: error: no matching function for call to ‘v8::Uint32::New(__suseconds_t&)’
../src/raw.cc:407:63: note: candidate is:
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Local<v8::Integer> v8::Integer::New(v8::Isolate*, int32_t)
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided
../src/raw.cc:411:43: error: no matching function for call to ‘v8::Uint32::New(canid_t&)’
../src/raw.cc:411:43: note: candidate is:
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Local<v8::Integer> v8::Integer::New(v8::Isolate*, int32_t)
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided
../src/raw.cc:414:52: error: no matching function for call to ‘v8::Boolean::New(bool&)’
../src/raw.cc:414:52: note: candidate is:
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:6183:17: note: static v8::Handle<v8::Boolean> v8::Boolean::New(v8::Isolate*, bool)
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:6183:17: note: candidate expects 2 arguments, 1 provided
../src/raw.cc:417:52: error: no matching function for call to ‘v8::Boolean::New(bool&)’
../src/raw.cc:417:52: note: candidate is:
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:6183:17: note: static v8::Handle<v8::Boolean> v8::Boolean::New(v8::Isolate*, bool)
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:6183:17: note: candidate expects 2 arguments, 1 provided
../src/raw.cc:420:52: error: no matching function for call to ‘v8::Boolean::New(bool&)’
../src/raw.cc:420:52: note: candidate is:
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:6183:17: note: static v8::Handle<v8::Boolean> v8::Boolean::New(v8::Isolate*, bool)
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:6183:17: note: candidate expects 2 arguments, 1 provided
../src/raw.cc:422:14: error: template argument 1 is invalid
../src/raw.cc:422:23: error: invalid type in declaration before ‘=’ token
../src/raw.cc:422:76: error: cannot convert ‘v8::Local<v8::Object>’ to ‘int’ in initialization
../src/raw.cc:424:30: error: base operand of ‘->’ is not a pointer
../src/raw.cc:431:35: error: base operand of ‘->’ has non-pointer type ‘v8::Persistent<v8::Function>’
../src/raw.cc:431:42: error: ‘GetCurrent’ is not a member of ‘v8::Context’
../src/raw.cc:433:35: error: base operand of ‘->’ has non-pointer type ‘v8::Persistent<v8::Function>’
../src/raw.cc: In member function ‘void RawChannel::ThreadEntry()’:
../src/raw.cc:458:32: error: ‘m_AsyncReceiverReady’ was not declared in this scope
../src/raw.cc:458:52: error: ‘uv_async_send’ was not declared in this scope
In file included from ../src/raw.h:24:0,
from ../src/raw.cc:36:
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h: In static member function ‘static void v8::NonCopyablePersistentTraits<T>::Uncompilable() [with O = v8::Object, T = v8::Object]’:
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:592:5: instantiated from ‘static void v8::NonCopyablePersistentTraits<T>::Copy(const v8::Persistent<S, M>&, v8::NonCopyablePersistentTraits<T>::NonCopyablePersistent*) [with S = v8::Object, M = v8::NonCopyablePersistentTraits<v8::Object>, T = v8::Object, v8::NonCopyablePersistentTraits<T>::NonCopyablePersistent = v8::Persistent<v8::Object>]’
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:5815:3: instantiated from ‘void v8::Persistent<T, M>::Copy(const v8::Persistent<S, M>&) [with S = v8::Object, M2 = v8::NonCopyablePersistentTraits<v8::Object>, T = v8::Object, M = v8::NonCopyablePersistentTraits<v8::Object>]’
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:664:5: instantiated from ‘v8::Persistent<T, M>& v8::Persistent<T, M>::operator=(const v8::Persistent<T, M>&) [with T = v8::Object, M = v8::NonCopyablePersistentTraits<v8::Object>, v8::Persistent<T, M> = v8::Persistent<v8::Object>]’
../src/raw.cc:188:24: instantiated from here
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:596:5: error: cannot convert ‘v8::Primitive*’ to ‘v8::Object* volatile’ in assignment
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h: In static member function ‘static void v8::NonCopyablePersistentTraits<T>::Uncompilable() [with O = v8::Object, T = v8::Function]’:
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:592:5: instantiated from ‘static void v8::NonCopyablePersistentTraits<T>::Copy(const v8::Persistent<S, M>&, v8::NonCopyablePersistentTraits<T>::NonCopyablePersistent*) [with S = v8::Function, M = v8::NonCopyablePersistentTraits<v8::Function>, T = v8::Function, v8::NonCopyablePersistentTraits<T>::NonCopyablePersistent = v8::Persistent<v8::Function>]’
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:5815:3: instantiated from ‘void v8::Persistent<T,M>::Copy(const v8::Persistent<S, M>&) [with S = v8::Function, M2 = v8::NonCopyablePersistentTraits<v8::Function>, T = v8::Function, M = v8::NonCopyablePersistentTraits<v8::Function>]’
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:664:5: instantiated from ‘v8::Persistent<T, M>& v8::Persistent<T, M>::operator=(const v8::Persistent<T, M>&) [with T = v8::Function, M = v8::NonCopyablePersistentTraits<v8::Function>, v8::Persistent<T, M> = v8::Persistent<v8::Function>]’
../src/raw.cc:189:26: instantiated from here
/home/pi/.node-gyp/0.12.4/deps/v8/include/v8.h:596:5: error: cannot convert ‘v8::Primitive*’ to ‘v8::Object* volatile’ in assignment
../src/raw.cc: In static member function ‘static v8::Handle<v8::Value> RawChannel::Send(const int&)’:
../src/raw.cc:374:1: warning: control reaches end of non-void function [-Wreturn-type]
../src/raw.cc: In static member function ‘static v8::Handle<v8::Value> RawChannel::Stop(const int&)’:
../src/raw.cc:319:1: warning: control reaches end of non-void function [-Wreturn-type]
../src/raw.cc: In static member function ‘static v8::Handle<v8::Value> RawChannel::Start(const int&)’:
../src/raw.cc:300:1: warning: control reaches end of non-void function [-Wreturn-type]
../src/raw.cc: In static member function ‘static v8::Handle<v8::Value> RawChannel::SetRxFilters(const int&)’:
../src/raw.cc:277:1: warning: control reaches end of non-void function [-Wreturn-type]
../src/raw.cc: In static member function ‘static v8::Handle<v8::Value> RawChannel::DisableLoopback(const int&)’:
../src/raw.cc:227:1: warning: control reaches end of non-void function [-Wreturn-type]
../src/raw.cc: In static member function ‘static v8::Handle<v8::Value> RawChannel::AddListener(const int&)’:
../src/raw.cc:194:1: warning: control reaches end of non-void function [-Wreturn-type]
../src/raw.cc: In static member function ‘static v8::Handle<v8::Value> RawChannel::New(const int&)’:
../src/raw.cc:163:1: warning: control reaches end of non-void function [-Wreturn-type]
can.target.mk:83: recipe for target 'Release/obj.target/can/src/raw.o' failed
make: *** [Release/obj.target/can/src/raw.o] Error 1
make: Leaving directory '/home/pi/node-can-master/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/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 3.18.11-v7+
gyp ERR! command "node" "/usr/local/bin/node-gyp" "build"
gyp ERR! cwd /home/pi/node-can-master
gyp ERR! node -v v0.12.4
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok
I am running the example from the README and running into an issue.
It looks like the code is expecting db.messages
to be a map, but mine is a long array with many null fields, and the message descriptions as JSON objects in the array. It appears to be an issue with the parser, since I can get the example working by doing the following (excuse the this
as this is in a class method):
this.network = can.parseNetworkDescription(
"node_modules/socketcan/samples/can_definition_sample.kcd");
this.channel = can.createRawChannel("vcan0");
this.db = new can.DatabaseService(
this.channel,
this.network.buses['Motor']
);
this.channel.start();
this.db.messages.find(m => m && m.name == 'Emission')
.signals['Enginespeed'].onUpdate(s => {
console.log('Enginespeed', s.value);
});
this.db.messages.find(m => m && m.name == 'Emission')
.signals['Enginespeed'].update(80);
But obviously this is not the intended API.
According to the KCD specification here the consumer is part of the signal not the message itself. Therefor parsing of consumers is not done correctly.
Hi!
I would like to create observables for channel.addListener('onMessage', cb)
. Do you have some example code? Mine failed silently
var observableMessages = Rx.Observable.fromEvent(channel.onMessage);
var subscription = observableMessages.subscribe((msg) => {
...
});
I'm new to node environment. I wanted to have a can node (for transmission and reception of simple can frames) in node-red which is on raspberry pi-3B.
I tried to install a node from palette from node-red, as per mentioned in:
(https://flows.nodered.org/node/node-red-contrib-canbus)
But installation failed.
So i tried installation with terminal command and faces build errors.
(Note: I am working on node v11.9.0 and npm 6.5.0.)
I guess it is related to version 8 node. Here is the terminal window details:
pi@raspberrypi:~/.node-red $ npm install node-red-contrib-canbus
> [email protected] install /home/pi/.node-red/node_modules/node-red-contrib-canbus/node_modules/socketcan
> node-gyp rebuild
make: Entering directory '/home/pi/.node-red/node_modules/node-red-contrib-canbus/node_modules/socketcan/build'
CXX(target) Release/obj.target/can/src/rawchannel.o
../src/rawchannel.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE RawChannel::New(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/rawchannel.cc:166:45: warning: ‘v8::Local<v8::String> v8::Value::ToString() const’ is deprecated (declared at /home/pi/.node-gyp/11.9.0/include/node/v8.h:10248): Use maybe version [-Wdeprecated-declarations]
Nan::Utf8String ascii(info[0]->ToString());
^
../src/rawchannel.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE RawChannel::AddListener(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/rawchannel.cc:200:50: warning: ‘v8::Local<v8::Object> v8::Value::ToObject() const’ is deprecated (declared at /home/pi/.node-gyp/11.9.0/include/node/v8.h:10254): Use maybe version [-Wdeprecated-declarations]
listener->handle.Reset(info[2]->ToObject());
^
../src/rawchannel.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE RawChannel::Send(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/rawchannel.cc:260:52: warning: ‘v8::Local<v8::Object> v8::Value::ToObject() const’ is deprecated (declared at /home/pi/.node-gyp/11.9.0/include/node/v8.h:10254): Use maybe version [-Wdeprecated-declarations]
v8::Local<v8::Object> obj = info[0]->ToObject();
^
../src/rawchannel.cc:263:53: warning: ‘uint32_t v8::Value::Uint32Value() const’ is deprecated (declared at /home/pi/.node-gyp/11.9.0/include/node/v8.h:2571): Use maybe version [-Wdeprecated-declarations]
frame.can_id = obj->Get(id_symbol)->Uint32Value();
^
../src/rawchannel.cc:276:60: warning: ‘v8::Local<v8::Object> v8::Value::ToObject() const’ is deprecated (declared at /home/pi/.node-gyp/11.9.0/include/node/v8.h:10254): Use maybe version [-Wdeprecated-declarations]
frame.can_dlc = node::Buffer::Length(dataArg->ToObject());
^
../src/rawchannel.cc:277:61: warning: ‘v8::Local<v8::Object> v8::Value::ToObject() const’ is deprecated (declared at /home/pi/.node-gyp/11.9.0/include/node/v8.h:10254): Use maybe version [-Wdeprecated-declarations]
memcpy(frame.data, node::Buffer::Data(dataArg->ToObject()), frame.can_dlc);
^
../src/rawchannel.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE RawChannel::SetRxFilters(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/rawchannel.cc:322:53: warning: ‘v8::Local<v8::Object> v8::Value::ToObject() const’ is deprecated (declared at /home/pi/.node-gyp/11.9.0/include/node/v8.h:10254): Use maybe version [-Wdeprecated-declarations]
if (ObjectToFilter(list->Get(idx)->ToObject(), &rfilter[numfilter]))
^
../src/rawchannel.cc:332:44: warning: ‘v8::Local<v8::Object> v8::Value::ToObject() const’ is deprecated (declared at /home/pi/.node-gyp/11.9.0/include/node/v8.h:10254): Use maybe version [-Wdeprecated-declarations]
if (ObjectToFilter(info[0]->ToObject(), &rfilter[numfilter]))
^
../src/rawchannel.cc: In static member function ‘static bool RawChannel::ObjectToFilter(v8::Handle<v8::Object>, can_filter*)’:
../src/rawchannel.cc:414:39: warning: ‘uint32_t v8::Value::Uint32Value() const’ is deprecated (declared at /home/pi/.node-gyp/11.9.0/include/node/v8.h:2571): Use maybe version [-Wdeprecated-declarations]
rfilter->can_id = id->Uint32Value();
^
../src/rawchannel.cc:415:43: warning: ‘uint32_t v8::Value::Uint32Value() const’ is deprecated (declared at /home/pi/.node-gyp/11.9.0/include/node/v8.h:2571): Use maybe version [-Wdeprecated-declarations]
rfilter->can_mask = mask->Uint32Value();
^
../src/rawchannel.cc: In member function ‘void RawChannel::async_receiver_ready(int)’:
../src/rawchannel.cc:486:32: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const’ is deprecated (declared at ../../../../nan/nan.h:1674) [-Wdeprecated-declarations]
callback.Call(1, argv);
^
../src/rawchannel.cc:488:60: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(v8::Local<v8::Object>, int, v8::Local<v8::Value>*) const’ is deprecated (declared at ../../../../nan/nan.h:1652) [-Wdeprecated-declarations]
callback.Call(Nan::New(listener->handle), 1, argv);
^
SOLINK_MODULE(target) Release/obj.target/can.node
COPY Release/can.node
CXX(target) Release/obj.target/can_signals/src/signals.o
../src/signals.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE DecodeSignal(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/signals.cc:103:46: warning: ‘v8::Local<v8::Object> v8::Value::ToObject() const’ is deprecated (declared at /home/pi/.node-gyp/11.9.0/include/node/v8.h:10254): Use maybe version [-Wdeprecated-declarations]
Local<Object> jsData = info[0]->ToObject();
^
../src/signals.cc:111:35: error: no matching function for call to ‘v8::Value::ToUint32()’
offset = info[1]->ToUint32()->Uint32Value();
^
../src/signals.cc:111:35: note: candidate is:
In file included from /home/pi/.node-gyp/11.9.0/include/node/node.h:63:0,
from ../../../../nan/nan.h:53,
from ../src/signals.cc:18:
/home/pi/.node-gyp/11.9.0/include/node/v8.h:2529:44: note: v8::MaybeLocal<v8::Uint32> v8::Value::ToUint32(v8::Local<v8::Context>) const
V8_WARN_UNUSED_RESULT MaybeLocal<Uint32> ToUint32(
^
/home/pi/.node-gyp/11.9.0/include/node/v8.h:2529:44: note: candidate expects 1 argument, 0 provided
../src/signals.cc:112:35: error: no matching function for call to ‘v8::Value::ToUint32()’
bitLength = info[2]->ToUint32()->Uint32Value();
^
../src/signals.cc:112:35: note: candidate is:
In file included from /home/pi/.node-gyp/11.9.0/include/node/node.h:63:0,
from ../../../../nan/nan.h:53,
from ../src/signals.cc:18:
/home/pi/.node-gyp/11.9.0/include/node/v8.h:2529:44: note: v8::MaybeLocal<v8::Uint32> v8::Value::ToUint32(v8::Local<v8::Context>) const
V8_WARN_UNUSED_RESULT MaybeLocal<Uint32> ToUint32(
^
/home/pi/.node-gyp/11.9.0/include/node/v8.h:2529:44: note: candidate expects 1 argument, 0 provided
../src/signals.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE EncodeSignal(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/signals.cc:203:46: warning: ‘v8::Local<v8::Object> v8::Value::ToObject() const’ is deprecated (declared at /home/pi/.node-gyp/11.9.0/include/node/v8.h:10254): Use maybe version [-Wdeprecated-declarations]
Local<Object> jsData = info[0]->ToObject();
^
../src/signals.cc:212:32: error: no matching function for call to ‘v8::Value::ToUint32()’
offset = info[1]->ToUint32()->Uint32Value();
^
../src/signals.cc:212:32: note: candidate is:
In file included from /home/pi/.node-gyp/11.9.0/include/node/node.h:63:0,
from ../../../../nan/nan.h:53,
from ../src/signals.cc:18:
/home/pi/.node-gyp/11.9.0/include/node/v8.h:2529:44: note: v8::MaybeLocal<v8::Uint32> v8::Value::ToUint32(v8::Local<v8::Context>) const
V8_WARN_UNUSED_RESULT MaybeLocal<Uint32> ToUint32(
^
/home/pi/.node-gyp/11.9.0/include/node/v8.h:2529:44: note: candidate expects 1 argument, 0 provided
../src/signals.cc:213:35: error: no matching function for call to ‘v8::Value::ToUint32()’
bitLength = info[2]->ToUint32()->Uint32Value();
^
../src/signals.cc:213:35: note: candidate is:
In file included from /home/pi/.node-gyp/11.9.0/include/node/node.h:63:0,
from ../../../../nan/nan.h:53,
from ../src/signals.cc:18:
/home/pi/.node-gyp/11.9.0/include/node/v8.h:2529:44: note: v8::MaybeLocal<v8::Uint32> v8::Value::ToUint32(v8::Local<v8::Context>) const
V8_WARN_UNUSED_RESULT MaybeLocal<Uint32> ToUint32(
^
/home/pi/.node-gyp/11.9.0/include/node/v8.h:2529:44: note: candidate expects 1 argument, 0 provided
../src/signals.cc:218:44: error: no matching function for call to ‘v8::Value::ToNumber()’
int32_t in_val = info[5]->ToNumber()->Int32Value();
^
../src/signals.cc:218:44: note: candidates are:
In file included from /home/pi/.node-gyp/11.9.0/include/node/node.h:63:0,
from ../../../../nan/nan.h:53,
from ../src/signals.cc:18:
/home/pi/.node-gyp/11.9.0/include/node/v8.h:2519:44: note: v8::MaybeLocal<v8::Number> v8::Value::ToNumber(v8::Local<v8::Context>) const
V8_WARN_UNUSED_RESULT MaybeLocal<Number> ToNumber(
^
/home/pi/.node-gyp/11.9.0/include/node/v8.h:2519:44: note: candidate expects 1 argument, 0 provided
In file included from /home/pi/.node-gyp/11.9.0/include/node/v8.h:26:0,
from /home/pi/.node-gyp/11.9.0/include/node/node.h:63,
from ../../../../nan/nan.h:53,
from ../src/signals.cc:18:
/home/pi/.node-gyp/11.9.0/include/node/v8.h:2536:31: note: v8::Local<v8::Number> v8::Value::ToNumber(v8::Isolate*) const
Local<Number> ToNumber(Isolate* isolate) const);
^
/home/pi/.node-gyp/11.9.0/include/node/v8config.h:326:3: note: in definition of macro ‘V8_DEPRECATED’
declarator __attribute__((deprecated(message)))
^
/home/pi/.node-gyp/11.9.0/include/node/v8.h:2536:31: note: candidate expects 1 argument, 0 provided
Local<Number> ToNumber(Isolate* isolate) const);
^
/home/pi/.node-gyp/11.9.0/include/node/v8config.h:326:3: note: in definition of macro ‘V8_DEPRECATED’
declarator __attribute__((deprecated(message)))
^
../src/signals.cc:228:35: error: no matching function for call to ‘v8::Value::ToNumber()’
raw_value = info[5]->ToNumber()->Uint32Value();
^
../src/signals.cc:228:35: note: candidates are:
In file included from /home/pi/.node-gyp/11.9.0/include/node/node.h:63:0,
from ../../../../nan/nan.h:53,
from ../src/signals.cc:18:
/home/pi/.node-gyp/11.9.0/include/node/v8.h:2519:44: note: v8::MaybeLocal<v8::Number> v8::Value::ToNumber(v8::Local<v8::Context>) const
V8_WARN_UNUSED_RESULT MaybeLocal<Number> ToNumber(
^
/home/pi/.node-gyp/11.9.0/include/node/v8.h:2519:44: note: candidate expects 1 argument, 0 provided
In file included from /home/pi/.node-gyp/11.9.0/include/node/v8.h:26:0,
from /home/pi/.node-gyp/11.9.0/include/node/node.h:63,
from ../../../../nan/nan.h:53,
from ../src/signals.cc:18:
/home/pi/.node-gyp/11.9.0/include/node/v8.h:2536:31: note: v8::Local<v8::Number> v8::Value::ToNumber(v8::Isolate*) const
Local<Number> ToNumber(Isolate* isolate) const);
^
/home/pi/.node-gyp/11.9.0/include/node/v8config.h:326:3: note: in definition of macro ‘V8_DEPRECATED’
declarator __attribute__((deprecated(message)))
^
/home/pi/.node-gyp/11.9.0/include/node/v8.h:2536:31: note: candidate expects 1 argument, 0 provided
Local<Number> ToNumber(Isolate* isolate) const);
^
/home/pi/.node-gyp/11.9.0/include/node/v8config.h:326:3: note: in definition of macro ‘V8_DEPRECATED’
declarator __attribute__((deprecated(message)))
^
can_signals.target.mk:99: recipe for target 'Release/obj.target/can_signals/src/signals.o' failed
make: *** [Release/obj.target/can_signals/src/signals.o] Error 1
make: Leaving directory '/home/pi/.node-red/node_modules/node-red-contrib-canbus/node_modules/socketcan/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:197:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
gyp ERR! System Linux 4.9.35-v7+
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pi/.node-red/node_modules/node-red-contrib-canbus/node_modules/socketcan
gyp ERR! node -v v11.9.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/pi/.npm/_logs/2019-02-13T01_16_19_121Z-debug.log
looking forward to hear from you.
thanks in advance.
In socketcan.js you are using a associative array for the signals. Why don't you use it as a normal array or why don't you use a Object?
`/**
* Named array of signals within this message. Accessible via index and name.
* @Attribute {Signal} signals
* @Final
*/
this.signals = [];
for (i in desc['signals']) {
var s = desc['signals'][i];
if (this.signals[s.name] && this.signals[s.name].muxGroup) {
this.signals[s.name].muxGroup.push(s.mux);
} else {
this.signals[s.name] = new Signal(s);
}
}`
Hi,
i have problems installing node-can with npm when having a Node Version greater than 8.
Is there a trick or am i doing something wrong?
I tried 'npm install node-can' command on a linux machine and got errors concerning to 'make'.
My error pretty much looked like in
#52
I'm using node-can in my project and it works good.
But can the time stamp start from zero when channel start?
Like can-utils they can type candump -tz can0 to get CAN message from zero.
Hello @sebi2k1,
I was wondering how you would like to keep track of features that wait for implementation. Should we add a new issue for each observation that might get addressed in the future?
What I have noticed so far:
I know a nice dbc file to test these enhancements when they have been implemented. The lab power supply manufacturer ElektroAutomatik uses e.g. 16 bit big endian multiplexors for 32bit floating point nominal values (e.g. device nominal current, etc.). They provide the dbc files for their units free of charge and they can be converted to kcd e.g. by the Python package cantools.
I cannot contribute right now but I thought I make a note for future me (and perhaps you :).
ElektoAutomatiks dbc files
The fantastic cantools Python package
64 bit signal not working because use int 32 bit.
in signal.cc work around for method _setvalue
uint64_t m = ~0 & ~(1ULL << bitLength);
if (bitLength == 64)
{
m = ULLONG_MAX;
}
but for NAN_METHOD(DecodeSignal) I don't know.....
Hi, the example code as below:
After 1 second timeout, I can see 'timeout' log in the console. But I cannot see 'stop' log in the console, it means 'onStopped' isn't invoked.
Can anyone help me to check and fix this?
var can = require('socketcan');
var channel= can.createRawChannel("can1");
channel.addListener("onStopped", function() {
console.log('stop');
});
channel.start();
setTimeout(function() {
console.log('timeout');
channel.stop();
}, 1000);
I've been using this library successfully for a while, but recently ive had some odd occurances, if i dont run the node app, the can network is fine, however when running the app, i will suddenly 'kill' my network off, and to get it up i need to do a ifconfig can0 down, can0 up.
When this happens, my software does record can messages that shouldn't exsist on the network, (id 4 and 40 normally) these are not used.
Has anyone else had this problem?channel.addListener("onMessage", function (msg) { var id = msg.id; var message = msg.data.toString('hex'); var datagram = 0; var source = 0; var destination = 0; switch (id) { case 1175421952: /* code removed */ break; case 1175420928: /* code removed */ break; case 1175422976: /* code removed */ break; default: console.log("unknown id: " + id + "\t hex: " + id.toString(16)); console.log(msg); break; } }); channel.start();
I'm not sure why this is going on, and it worked until today fine (no non expected messages or anything)
I have a question regarding the language choice for your CAN library. It is really generic, so it might not fit to an actual issue in here, but what is the reason why you opted for Javascript for this and not Java?
Hi
I am trying to migrate to nodejs a candump+perl based application with routing cababilities.
I don't understand the following code behaviour... i think it is because of proper loopback support...
var can = require('can');
var ask = can.createRawChannel("ask", true);
var respond = can.createRawChannel("respond", true);
var respond2 = can.createRawChannel("respond", true);
// route message
ask .addListener("onMessage", respond.send, respond);
// Log any message
ask .addListener("onMessage", function(msg) { msg.orig="ask";console.log(msg); } );
// shows messages comming from ask
// route messages from ask to respond
respond .addListener("onMessage", function(msg) { msg.orig="respond";console.log(msg); } );
// show messages comming from respond channel, but not routed ones
respond2 .addListener("onMessage", function(msg) { msg.orig="respond2";console.log(msg); } );
// show messages comming from respond channed, included routed ones.
ask.start();
respond.start();
respond2.start();
I tried using electron and socketcan/node-can. When ever i try to run the app, that following error message appears:
A JavaScript error occurred in the main process
Uncaught Exception:
Error: The module '/home/user/Documents/01_CODING/myProject/node_modules/rawcan/build/Release/can_wrap.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 57. This version of Node.js requires
NODE_MODULE_VERSION 54. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or`npm install`).
at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:173:20)
at Object.Module._extensions..node (module.js:598:18)
at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:173:20)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at bindings (/home/user/Documents/01_CODING/myProject/node_modules/bindings/bindings.js:81:44)
at Object.<anonymous> (/home/user/Documents/01_CODING/myProject/node_modules/rawcan/dist/can_wrap.js:2:18)
No matter what node version i am using - there will always be a mismatch and i have no clue how to fix it. What i have tried so far:
node_modules
and reinstallingnpm rebuild
In some context it would be nice to also be able to remove previously registered listeners. Is it possible to add the method removeListener
to rawChannel?
I recently upgraded to node v10.4.1 (npm 6.1.0). When building the module, a build error occurs that seems to be related to changes in v8.
> [email protected] install /home/decipher/Apps/essense-control-api/node_modules/socketcan
> node-gyp rebuild
make: Entering directory '/home/decipher/Apps/essense-control-api/node_modules/socketcan/build'
CXX(target) Release/obj.target/can/src/rawchannel.o
../src/rawchannel.cc: In member function 'void RawChannel::async_channel_stopped(int)':
../src/rawchannel.cc:485:32: warning: 'v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const' is deprecated [-Wdeprecated-declarations]
callback.Call(0, NULL);
^
In file included from ../src/rawchannel.cc:23:0:
../../nan/nan.h:1618:3: note: declared here
Call(int argc, v8::Local<v8::Value> argv[]) const {
^
../src/rawchannel.cc:487:60: warning: 'v8::Local<v8::Value> Nan::Callback::Call(v8::Local<v8::Object>, int, v8::Local<v8::Value>*) const' is deprecated [-Wdeprecated-declarations]
callback.Call(Nan::New(listener->handle), 0, NULL);
^
In file included from ../src/rawchannel.cc:23:0:
../../nan/nan.h:1596:3: note: declared here
Call(v8::Local<v8::Object> target
^
../src/rawchannel.cc: In member function 'void RawChannel::async_receiver_ready(int)':
../src/rawchannel.cc:561:32: warning: 'v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const' is deprecated [-Wdeprecated-declarations]
callback.Call(1, argv);
^
In file included from ../src/rawchannel.cc:23:0:
../../nan/nan.h:1618:3: note: declared here
Call(int argc, v8::Local<v8::Value> argv[]) const {
^
../src/rawchannel.cc:563:60: warning: 'v8::Local<v8::Value> Nan::Callback::Call(v8::Local<v8::Object>, int, v8::Local<v8::Value>*) const' is deprecated [-Wdeprecated-declarations]
callback.Call(Nan::New(listener->handle), 1, argv);
^
In file included from ../src/rawchannel.cc:23:0:
../../nan/nan.h:1596:3: note: declared here
Call(v8::Local<v8::Object> target
^
SOLINK_MODULE(target) Release/obj.target/can.node
COPY Release/can.node
CXX(target) Release/obj.target/can_signals/src/signals.o
../src/signals.cc: In function 'Nan::NAN_METHOD_RETURN_TYPE DecodeSignal(Nan::NAN_METHOD_ARGS_TYPE)':
../src/signals.cc:111:35: error: no matching function for call to 'v8::Value::ToUint32()'
offset = info[1]->ToUint32()->Uint32Value();
^
In file included from /home/decipher/.node-gyp/10.4.1/include/node/node.h:63:0,
from ../../nan/nan.h:51,
from ../src/signals.cc:18:
/home/decipher/.node-gyp/10.4.1/include/node/v8.h:2400:44: note: candidate: v8::MaybeLocal<v8::Uint32> v8::Value::ToUint32(v8::Local<v8::Context>) const
V8_WARN_UNUSED_RESULT MaybeLocal<Uint32> ToUint32(
^
/home/decipher/.node-gyp/10.4.1/include/node/v8.h:2400:44: note: candidate expects 1 argument, 0 provided
../src/signals.cc:112:35: error: no matching function for call to 'v8::Value::ToUint32()'
bitLength = info[2]->ToUint32()->Uint32Value();
^
In file included from /home/decipher/.node-gyp/10.4.1/include/node/node.h:63:0,
from ../../nan/nan.h:51,
from ../src/signals.cc:18:
/home/decipher/.node-gyp/10.4.1/include/node/v8.h:2400:44: note: candidate: v8::MaybeLocal<v8::Uint32> v8::Value::ToUint32(v8::Local<v8::Context>) const
V8_WARN_UNUSED_RESULT MaybeLocal<Uint32> ToUint32(
^
/home/decipher/.node-gyp/10.4.1/include/node/v8.h:2400:44: note: candidate expects 1 argument, 0 provided
../src/signals.cc: In function 'Nan::NAN_METHOD_RETURN_TYPE EncodeSignal(Nan::NAN_METHOD_ARGS_TYPE)':
../src/signals.cc:212:32: error: no matching function for call to 'v8::Value::ToUint32()'
offset = info[1]->ToUint32()->Uint32Value();
^
In file included from /home/decipher/.node-gyp/10.4.1/include/node/node.h:63:0,
from ../../nan/nan.h:51,
from ../src/signals.cc:18:
/home/decipher/.node-gyp/10.4.1/include/node/v8.h:2400:44: note: candidate: v8::MaybeLocal<v8::Uint32> v8::Value::ToUint32(v8::Local<v8::Context>) const
V8_WARN_UNUSED_RESULT MaybeLocal<Uint32> ToUint32(
^
/home/decipher/.node-gyp/10.4.1/include/node/v8.h:2400:44: note: candidate expects 1 argument, 0 provided
../src/signals.cc:213:35: error: no matching function for call to 'v8::Value::ToUint32()'
bitLength = info[2]->ToUint32()->Uint32Value();
^
In file included from /home/decipher/.node-gyp/10.4.1/include/node/node.h:63:0,
from ../../nan/nan.h:51,
from ../src/signals.cc:18:
/home/decipher/.node-gyp/10.4.1/include/node/v8.h:2400:44: note: candidate: v8::MaybeLocal<v8::Uint32> v8::Value::ToUint32(v8::Local<v8::Context>) const
V8_WARN_UNUSED_RESULT MaybeLocal<Uint32> ToUint32(
^
/home/decipher/.node-gyp/10.4.1/include/node/v8.h:2400:44: note: candidate expects 1 argument, 0 provided
../src/signals.cc:218:44: error: no matching function for call to 'v8::Value::ToNumber()'
int32_t in_val = info[5]->ToNumber()->Int32Value();
^
In file included from /home/decipher/.node-gyp/10.4.1/include/node/node.h:63:0,
from ../../nan/nan.h:51,
from ../src/signals.cc:18:
/home/decipher/.node-gyp/10.4.1/include/node/v8.h:2390:44: note: candidate: v8::MaybeLocal<v8::Number> v8::Value::ToNumber(v8::Local<v8::Context>) const
V8_WARN_UNUSED_RESULT MaybeLocal<Number> ToNumber(
^
/home/decipher/.node-gyp/10.4.1/include/node/v8.h:2390:44: note: candidate expects 1 argument, 0 provided
In file included from /home/decipher/.node-gyp/10.4.1/include/node/v8.h:26:0,
from /home/decipher/.node-gyp/10.4.1/include/node/node.h:63,
from ../../nan/nan.h:51,
from ../src/signals.cc:18:
/home/decipher/.node-gyp/10.4.1/include/node/v8.h:2407:35: note: candidate: v8::Local<v8::Number> v8::Value::ToNumber(v8::Isolate*) const
Local<Number> ToNumber(Isolate* isolate) const);
^
/home/decipher/.node-gyp/10.4.1/include/node/v8config.h:346:48: note: in definition of macro 'V8_DEPRECATE_SOON'
#define V8_DEPRECATE_SOON(message, declarator) declarator
^
/home/decipher/.node-gyp/10.4.1/include/node/v8.h:2407:35: note: candidate expects 1 argument, 0 provided
Local<Number> ToNumber(Isolate* isolate) const);
^
/home/decipher/.node-gyp/10.4.1/include/node/v8config.h:346:48: note: in definition of macro 'V8_DEPRECATE_SOON'
#define V8_DEPRECATE_SOON(message, declarator) declarator
^
../src/signals.cc:228:35: error: no matching function for call to 'v8::Value::ToNumber()'
raw_value = info[5]->ToNumber()->Uint32Value();
^
In file included from /home/decipher/.node-gyp/10.4.1/include/node/node.h:63:0,
from ../../nan/nan.h:51,
from ../src/signals.cc:18:
/home/decipher/.node-gyp/10.4.1/include/node/v8.h:2390:44: note: candidate: v8::MaybeLocal<v8::Number> v8::Value::ToNumber(v8::Local<v8::Context>) const
V8_WARN_UNUSED_RESULT MaybeLocal<Number> ToNumber(
^
/home/decipher/.node-gyp/10.4.1/include/node/v8.h:2390:44: note: candidate expects 1 argument, 0 provided
In file included from /home/decipher/.node-gyp/10.4.1/include/node/v8.h:26:0,
from /home/decipher/.node-gyp/10.4.1/include/node/node.h:63,
from ../../nan/nan.h:51,
from ../src/signals.cc:18:
/home/decipher/.node-gyp/10.4.1/include/node/v8.h:2407:35: note: candidate: v8::Local<v8::Number> v8::Value::ToNumber(v8::Isolate*) const
Local<Number> ToNumber(Isolate* isolate) const);
^
/home/decipher/.node-gyp/10.4.1/include/node/v8config.h:346:48: note: in definition of macro 'V8_DEPRECATE_SOON'
#define V8_DEPRECATE_SOON(message, declarator) declarator
^
/home/decipher/.node-gyp/10.4.1/include/node/v8.h:2407:35: note: candidate expects 1 argument, 0 provided
Local<Number> ToNumber(Isolate* isolate) const);
^
/home/decipher/.node-gyp/10.4.1/include/node/v8config.h:346:48: note: in definition of macro 'V8_DEPRECATE_SOON'
#define V8_DEPRECATE_SOON(message, declarator) declarator
^
can_signals.target.mk:95: recipe for target 'Release/obj.target/can_signals/src/signals.o' failed
make: *** [Release/obj.target/can_signals/src/signals.o] Error 1
make: Leaving directory '/home/decipher/Apps/essense-control-api/node_modules/socketcan/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Linux 4.13.0-45-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/decipher/Apps/essense-control-api/node_modules/socketcan
gyp ERR! node -v v10.4.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN [email protected] requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.