1

We have some data files with messages for a microcontroller.

We use Blue CAN v2 IXXAT with a simulator to transfer messages to the microcontroller.

Currently we are using the GUI, but can we use some module in linux to write a script to automate it?

AdminBee
  • 22,803

1 Answers1

0

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

alecxs
  • 564