linklayer / cantact-fw

Firmware source files for the CANtact tool
http://cantact.io
Other
260 stars 179 forks source link

How to send and receive CAN messages between two CANtact devices using CANard library? #18

Open Prriyamvradha opened 5 years ago

Prriyamvradha commented 5 years ago

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

And then I types the following Python code which uses CANard libraries.I have attached a detailed screenshot of it screenshot from 2019-02-26 10-43-28

20190226_142956 ![Uploading 20190226_142956.jpg…]()

How can I resolve this problem?