SocketCAN Command Generator
cansend can0 123#1122334455667788Linux terminal command · updates as you edit
Command options
01 Interface & frame
Protocol
ID format
Frame type
000–7FF
02 Payload 8 B · HEX
HEX bytes; spaces or dots allowed. Zero-pad short data, ignore excess; preserve input.
View final payload
Final payload: 11 22 33 44 55 66 77 88
Advanced frame options
How to use
- Choose configuration, inspection, transmission, reception or bus load. Use the Presets dropdown at the top right of the options panel to fill in common settings. Help links to the current command’s official documentation and related guides. Choose “More commands” for log replay, bidirectional testing and data change monitoring.
- Enter the actual Linux interface name, such as
can0. Configure and bring up the interface before sending or receiving. Match the bit rates of the other bus nodes. - Adjust the options and review the command at the top; it stays visible as you scroll through the options. Short payloads are automatically padded with
00; longer payloads use only the selected number of leading bytes, with a notice below the payload field showing how many trailing bytes were ignored. Your original input is preserved so you can change the length again. Expand “View final payload” to check the bytes to be sent. Invalid formats are identified beside each field. - Copy the command and paste it into a Linux terminal. Configuration and traffic commands are generated separately. Press
Ctrl+Cto stop a continuous command.
Requirements
- Install the driver appropriate to your device and current firmware so that a SocketCAN interface is available. CAN FD, listen-only mode and hardware timestamps require device and driver support.
- Install
can-utilsandiproute2. Options follow can-utils v2025.01. If an older package lacks an option, upgrade it or consult the installed version’s help. - Suggested bit rates also allow custom input. Supported rates depend on the controller, driver and bus. For sample points, SJW and other timing parameters, use the CAN Baud Rate Calculator.
- The rates passed to
canbusloadare used for calculation, not interface configuration. Results depend on stuffing calculations and dropped frames. CAN FD uses estimation; bit-by-bit stuffing calculation is for Classic CAN only. - Logs use a format suitable for
canplayerreplay. Existing files with the same name are overwritten. A~in a filename is treated literally; enter the actual path.
Options and official help
Common options are visible immediately. Expand advanced options for additional controls. The following covers Classic CAN / CAN FD usage in can-utils v2025.01. Run canplayer -h, canfdtest '-?' or cansniffer '-?' for help on the installed version.
| Command / official help | Available options |
|---|---|
| cansend | Standard / extended IDs, data / RTR, CAN FD, BRS, ESI, raw DLC 9–F for eight-byte Classic frames |
| candump | -t -H -c -i -a -S -s -l -f -L -n -r -D -d -e -8 -x -T; multiple interfaces, any, ID / mask, inverse filters, AND combination and error masks |
| cangen | -g -a -t --start --mark -e -f -b -E -R -8 -I -L -D -p -P -n -i -x -c -v; fixed / random / incrementing values, odd / even IDs and random nibbles |
| canbusload | -t -c -b -r -i -e -s -v; independent interface rates, any and up to 20 interfaces |
| canplayer | Log replay, interface mapping, repeat and frame limits, pacing and idle gap skipping |
| canfdtest | Paired responder and host, Classic CAN / CAN FD, BRS, IDs, length, loops and filtering |
| cansniffer | CAN FD mode, change highlighting, binary display and timing |
- This page is for Classic CAN / CAN FD debugging. For CAN XL syntax,
cangen -X -F -S -A -V, and random mixed-frame mode-m, use the official help. The generator uses explicit protocol and frame-type choices. - FD flags for
cansendcombine BRS and ESI; FDF and reserved bits need no manual setting. Physical controllers normally determine ESI from their own state; explicit ESI is mainly useful with virtual CAN. - Raw DLC 9–15 still carries eight Classic data bytes and requires controller and driver support for
CC_LEN8_DLC. - With
cangen -c,-gis the gap between bursts.-tschedules individual frames and requires a suitable queueing discipline, driver and privileges. The v2025.01 implementation of--startuses nanoseconds on theCLOCK_TAItime base. candump -Luses log format and cannot be combined with binary, ASCII or byte-swap display options. Advanced filter expressions preserve ID / mask flag bits, allowing RTR and EFF matching.canbusload -sshows statistics; pressrto reset.-venables visualization.anyapplies the same calculation rates to all interfaces; add channels individually when their rates differ.