sebi2k1 / node-can

NodeJS SocketCAN extension
223 stars 73 forks source link

serial port ? #99

Closed ptorrent closed 2 years ago

ptorrent commented 3 years ago

Hello,

Is it possible to use serial port with this library ?

Or did I have to use https://elinux.org/Bringing_CAN_interface_up

juleq commented 3 years ago

Do you mean serial to CAN interfaces? I doubt it. You would need a Linux socketcan driver that sits on your serial interface because this library does only support socketcan interfaces.

I assume it will be hard to find such a driver because these serial/CAN interfaces do not use standardized protocols on their serial side.

I can recommend Peak CAN interfaces (~200€). There might be cheaper options, just ensure that it ships with a socketcan driver (the Peak one does, I think they even are supported by mainline Kernels out of the box).

sebi2k1 commented 3 years ago

What about slcan? It’s a SocketCAN driver supporting serial devices but they have to support the SLCAN protocol.

https://github.com/torvalds/linux/blob/614124bea77e452aa6df7a8714e8bc820b489922/drivers/net/can/slcan.c

juleq commented 3 years ago

Well. I guess it wan not that hard to find 😋.