Is it possible to generate CAN message in one device and dump CAN message in another device using SocketCAN?

﹥>﹥吖頭↗ 提交于 2019-12-25 00:38:34

问题


I am using SocketCAN and CANtact toolkit to send and receive CAN message. I am using two CANtact toolkits one to send CAN message and other to receive the CAN message both the CANtact toolkits are connected by DB9 female to DB9 female and the other ends are connected to the USB port of the laptop.

I used the following SocketCAN commands to first configure them

sudo modprobe can
sudo modprobe can_raw
sudo modprobe slcan
sudo slcand -o -s6 -t hw -S 3000000 /dev/ttyACM0 slcan0
sudo ip link set slcan0 up

The above commands are for the first CANtact toolkit then I connected the second CANtact toolkit and configured it with the following commands

sudo modprobe can
sudo modprobe can_raw
sudo modprobe slcan
sudo slcand -o -s6 -t hw -S 3000000 /dev/ttyACM1 slcan1
sudo ip link set slcan1 up

I performed these steps in two different terminals

In the first terminal, I gave

cangen -v slcan0

In the second terminal,I gave

 candump slcan1

I don't receive any CAN messages in terminal 2 but if i give

cangen -v slcan0

in the first terminal and

candump slcan0

in second terminal I am able to view the CAN messages sent

This means the CAN message is not communicated between the two CANtact toolkits How can this be resolved? Or am I committing any mistake?

]5

来源:https://stackoverflow.com/questions/54880371/is-it-possible-to-generate-can-message-in-one-device-and-dump-can-message-in-ano

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!