socketcand icon indicating copy to clipboard operation
socketcand copied to clipboard

connect two socketcand

Open Cosik opened this issue 4 months ago • 2 comments

Hi,

I start thinking if there is possibility and anyone think about connecting two devices with socketcand?

I wonder if there is possibility to get something like can <-> eth <-> eth <-> can

Cosik avatar Jul 08 '25 13:07 Cosik

Not in the scope of socketcand currently, but you can easily use python-can on the other end to connect to the remote and proxy the traffic to/from any other local interface, for example a socketcan virtual interface

Kimmax avatar Aug 03 '25 12:08 Kimmax

The socketcand was intended for interactive control of CAN data from a host that wants to access CAN interfaces remotely.

A more efficient SocketCAN tunneling is provided by the https://github.com/mguentner/cannelloni project.

If your only use case is to see CAN traffic from another Linux host, e.g. on your local virtual CAN interfaces, you can get this traffic via ssh command option like this:

ssh root@remote-host candump -L can0 can1 | canplayer vcan0=can0 vcan1=can1

or e.g. create a CAN logfile on your local host with remove traffic:

ssh root@remote-host candump -L any > remote-candump.log

hartkopp avatar Aug 04 '25 09:08 hartkopp