This page is a simple use of
CAN
query, setting, sending, and receivingcan0
nodes
$ ifconfig -a
can0: flags=128<NOARP> mtu 16
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (UNSPEC)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 71
......
# Shut down CAN:
$ ip link set can0 down
# Set bit rate to 500KHz:
$ ip link set can0 type can bitrate 500000
# Print can0 information:
$ ip -details -statistics link show can0
# Start CAN:
$ ip link set can0 up
# Send standard frame, data frame
$ cansend can0 123#DEADBEEF
# Send standard frame, remote frame
$ cansend can0 123#R
# Send extended frame, data frame
$ cansend can0 00000123#12345678
# Send extended frame, remote frame
$ cansend can0 00000123#R
$ candump can0