ubuntucan-bussocketcancanutils

No active virtual can messages when using candump (SocketCAN)


I am playing with can-utils package, trying to run a virtual can device. Everything seems to work fine except there is no active messages. Candump and cansniffer works, because I send a message manually and it shows up.

Am I doing something wrong?

Here are the commands I run:

sudo modprobe vcan
sudo ip link add dev vcan0 type vcan
sudo ip link set up vcan0
candump vcan0

I am using Ubuntu 16, Kernel 4.11.0


Solution

  • I have found out that I need to create traffic by myself using "cangen" command. So, here is complete guide to generate random virtual can traffic:

    sudo modprobe vcan
    sudo ip link add dev vcan0 type vcan
    sudo ip link set up vcan0
    cangen vcan0
    

    Last one is to create traffic. Now, if you try "candump" or "cansniffer", you will be able to see random generated traffic.