https://www.ridgerun.com/developer/wiki/index.php/How_to_configure_and_use_CAN_bus
Socket CAN utilities
The BerliOS Socket CAN package is an implementation of CAN protocols for Linux. It uses the Berkeley socket API, the Linux network stack and implements the CAN device drivers as network interfaces. In addition, the package provides user space utilities and test programs suggested as a reference for CAN interface evaluation and testing. The socketCAN package is available for downloading using SVN or HTTP protocols from the BerliOS Socket CAN SVN repository website.Download the package and compile can-utils directory using an appropriate cross-compiler. For information on cross tool-chain, please read Cross-Compiler chapter. After the build process is complete, copy the application binaries to the CM-T3517 file system (e.g. /usr/local/can-utils/).Use cansend and candump utilities to send and receive packets via CAN interface.
Send standard CAN frame (on the first device):
root@cm-debian:/# cd /usr/local/can-utils/ root@cm-debian:/usr/local/can-utils# ./cansend can0 111#1122334455667788 root@cm-debian:/usr/local/can-utils#
Send extended CAN frame (on the first device):
root@cm-debian:/usr/local/can-utils# ./cansend can0 11111111#1122334455667788 root@cm-debian:/usr/local/can-utils#
Dump all received data frames as well as error frames (on the second device):
root@cm-debian:/usr/local/can-utils# ./candump any,0:0,#FFFFFFFF can0 111 [8] 11 22 33 44 55 66 77 88 can0 11111111 [8] 11 22 33 44 55 66 77 88