How to connect SignalK Server to vcan interface?
Hi. I am setting up a new pi to replace the old one on boat. For testing and configuration, I routed the physical can0 interface on the boat to vcan0 on the new pi at home using canneloni (https://github.com/mguentner/cannelloni). That works great--I can candump vcan0 successfully--but the vcan0 interface, set up as a data source, is not read by the server. Error message from the server log below. I would be grateful for any advice to resolve this issue.
Apr 23 20:07:47 Error: Module did not self-register: '/usr/local/lib/node_modules/signalk-server/node_modules/socketcan/build/Release/can.node'. at Module._extensions..node (node:internal/modules/cjs/loader:1651:18) at Module.load (node:internal/modules/cjs/loader:1275:32) at Module._load (node:internal/modules/cjs/loader:1096:12) at Module.require (node:internal/modules/cjs/loader:1298:19) at require (node:internal/modules/helpers:182:18) at Object.<anonymous> (/usr/local/lib/node_modules/signalk-server/node_modules/socketcan/dist/socketcan.js:51:26) at Module._compile (node:internal/modules/cjs/loader:1529:14) at Module._extensions..js (node:internal/modules/cjs/loader:1613:10) at Module.load (node:internal/modules/cjs/loader:1275:32) at Module._load (node:internal/modules/cjs/loader:1096:12) at Module.require (node:internal/modules/cjs/loader:1298:19) at require (node:internal/modules/helpers:182:18) at new CanbusStream (/usr/local/lib/node_modules/signalk-server/node_modules/@canboat/canboatjs/lib/canbus.js:73:22) at CanbusStream (/usr/local/lib/node_modules/signalk-server/node_modules/@canboat/canboatjs/lib/canbus.js:46:12) at Object.nmea2000input [as NMEA2000] (/usr/local/lib/node_modules/signalk-server/node_modules/@signalk/streams/simple.js:260:30) at new Simple (/usr/local/lib/node_modules/signalk-server/node_modules/@signalk/streams/simple.js:93:34) { code: 'ERR_DLOPEN_FAILED' }
10 Replies
What version of nodejs are you running?
And is it possible that you updated nodejs since you installed signalk-server?
nodejs -v gives v20.19.0. ...and yes, I think I upgraded when I upgraded to the newest server version.
Remove and re-install signalk-server
Ok - thanks. I will try that.
GitHub
FAQ: Frequently Asked Questions
An implementation of a Signal K central server for boats. - SignalK/signalk-server
In the future, I would not upgrade nodejs unless there is a specific reason to
Understood. Thanks again.
Greetings. Reinstalling the server did not fix the vcan issue so I gave up. Just not worth the effort. I am now on the boat, however, and I am seeing the same error connecting to can0. That worked before I upgraded the signalk server, node, and npm. I'd be grateful for any ideas on fixing it without starting over. Thanks.
Apr 26 08:48:41 Error: Module did not self-register: '/usr/local/lib/node_modules/signalk-server/node_modules/socketcan/build/Release/can.node'. at Module._extensions..node (node:internal/modules/cjs/loader:1651:18) at Module.load (node:internal/modules/cjs/loader:1275:32) at Module._load (node:internal/modules/cjs/loader:1096:12) at Module.require (node:internal/modules/cjs/loader:1298:19) at require (node:internal/modules/helpers:182:18) at Object.<anonymous> (/usr/local/lib/node_modules/signalk-server/node_modules/socketcan/dist/socketcan.js:51:26) at Module._compile (node:internal/modules/cjs/loader:1529:14) at Module._extensions..js (node:internal/modules/cjs/loader:1613:10) at Module.load (node:internal/modules/cjs/loader:1275:32) at Module._load (node:internal/modules/cjs/loader:1096:12) at Module.require (node:internal/modules/cjs/loader:1298:19) at require (node:internal/modules/helpers:182:18) at new CanbusStream (/usr/local/lib/node_modules/signalk-server/node_modules/@canboat/canboatjs/lib/canbus.js:73:22) at CanbusStream (/usr/local/lib/node_modules/signalk-server/node_modules/@canboat/canboatjs/lib/canbus.js:46:12) at Object.nmea2000input [as NMEA2000] (/usr/local/lib/node_modules/signalk-server/node_modules/@signalk/streams/simple.js:260:30) at new Simple (/usr/local/lib/node_modules/signalk-server/node_modules/@signalk/streams/simple.js:93:34) { code: 'ERR_DLOPEN_FAILED' }
Apr 26 08:48:41 WARNING unable to load native socketcan interface
The only time I have seen this happen is when the nodejs version is upgraded after the server was installed.
Fixed by deleting all the server installed files and any plugins
And then reinstalling
Ok. Thanks again.
Try this
sudo npm install -g @canboat/canboatjs
candumpjs can0