Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nodejs 19 unable to return new can.RawChannel #131

Closed
SirJamesBrown opened this issue Dec 12, 2023 · 3 comments
Closed

Nodejs 19 unable to return new can.RawChannel #131

SirJamesBrown opened this issue Dec 12, 2023 · 3 comments

Comments

@SirJamesBrown
Copy link

Not entirely sure how to interpret this.
I am on nodejs 19.9
both cjs and mjs give this apparent error on v4.0.4 and tried v4.0.1:

node_modules/socketcan/dist/socketcan.js:73
    return new can.RawChannel(channel, timestamps, protocol, false);
           ^

Error: Error while creating channel
    at Object.createRawChannel (/home/james/code/car/node_modules/socketcan/dist/socketcan.js:73:12)

for the following example

import * as can from 'socketcan'
// let can = require("socketcan")

let channel = can.createRawChannel('can0', true)
let msg = { id: 0x123, data: [0, 1, 2, 3, 4, 5, 6, 7] }

setInterval(() => {
  let out = {}
  out.id = 0x123
  out.data = new Buffer.from(msg.data)
  channel.send(out)
}, 100)

channel.start()
@sebi2k1
Copy link
Owner

sebi2k1 commented Dec 13, 2023

Is can0 available and up?

@SirJamesBrown
Copy link
Author

SirJamesBrown commented Dec 13, 2023 via email

@SirJamesBrown
Copy link
Author

So sorry to waste your time, was playing a bit more and realized I was not passing over ssh to the machine correctly, works like a charm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants