SocketCAN Cheat Sheet
A quick reference of common SocketCAN use cases and commands.
# Set up a physical CAN devicesudo ip link set can0 type can bitrate 500000 # add the device and set bitratesudo ip link set up can0 # devices start down, bring it up
# Set up a Virtual CAN device# Virtual CAN — try with no hardwaresudo modprobe vcan #Load kernel module - only required oncesudo ip link add dev vcan0 type vcansudo ip link set up vcan0
# Inspectip link show # list interfacesip -details -statistics link show vcan0 # detailed counters, error state, and bitrate timing
# Recover - bring device down then upsudo ip link set down can0sudo ip link set up can0