No active virtual message messages when using candump (SocketCAN)

I am playing around with the can-utils package trying to start a virtual device. Everything seems to be working fine except for active messages. Candump and cansniffer work because I manually send the message and it appears.

Am I doing something wrong?

Here are the commands I'm running:

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

+3


source to share


2 answers


I figured out that I need to generate traffic myself using the "cangen" command. So here's a complete guide to generating random virtual traffic traffic:

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

      



The latter should generate traffic. Now if you try "candump" or "cansniffer", you should be able to see randomly generated traffic.

+3


source


This answer is correct, here is an alternative solution. "cangen" continuously generates random data, and this can be seen with "candump" or "cansniffer".

But for testing purposes or to send a specific CAN frame alternative to the above answer, you can send the can message directly using the "cansend" command.

Example: cansend vcan0 696 # 1111111111111111

CAN frame with ID 696 and 8 data bytes.



To see the result, you can use any of the commands (make sure you have already run this command below and then the cansend command to see the result):

cansniffer vcan0

or

candump vcan0

0


source







All Articles