If you want to send/receive data on the CAN interface,
you should install can-utils
:
sudo apt install can-utils
The repository for can-utils can be found at
https://github.com/linux-can/can-utils.
To send data to the CAN bus,
use the cansend
utility:
cansend can0 123#1122334455667788
The above command will send a CAN message on can0
with the identifier 0x123
and the data bytes [ 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88 ]
. Values are always treated as hexadecimal.
To display a list of received messages on the bus
in realtime, use the candump
utility:
candump can0
Source: Send/Receive Data On SocketCAN