CANGEN(1)

πŸ“¦
version 2023.03 Β· 3 versions
, in ubuntu resolute, ubuntu stonking

✨ CANGEN(1) ✨

okay bestie, welcome to the cangen manual page β€” she's a User Command and she's here to serve πŸ’…


πŸŽ€ NAME πŸŽ€

cangen β€” the manual page for cangen 2023.03-1build1, no cap


🌸 SYNOPSIS 🌸

cangen [options] <CAN interface>

πŸ¦‹ DESCRIPTION πŸ¦‹

cangen is literally a CAN frames generator. that's the whole vibe. she makes frames and she makes them on purpose ✨


πŸ’– OPTIONS πŸ’–

  • -g <ms> β€” gap in milli seconds, and the default is 200 ms 🫢
  • -a β€” use absolute time for the gap, periodt
  • -t β€” use SO_TXTIME πŸ‘‘
  • --start <ns> β€” start time, measured in UTC nanoseconds ⏰
  • --mark <id> β€” set SO_MARK to <id>, and the default is 1
  • -e β€” generate extended frame mode (EFF) CAN frames πŸ¦‹
  • -f β€” generate CAN FD CAN frames
  • -b β€” generate CAN FD CAN frames with bitrate switch (BRS) πŸ”₯
  • -E β€” generate CAN FD CAN frames with error state (ESI) 😭
  • -R β€” generate RTR frames
  • -8 β€” allow DLC values greater then 8 for Classic CAN frames (yes, "then", that's how she wrote it, iykyk)
  • -m β€” mix -e -f -b -E -R frames together, it's giving chaos and we love her
  • -I <mode> β€” CAN ID generation mode, peep below for the deets
  • -L <mode> β€” CAN data length code (dlc) generation mode, also below
  • -D <mode> β€” CAN data (payload) generation mode, also also below
  • -p <timeout> β€” poll on -ENOBUFS to write frames with <timeout> ms πŸ’«
  • -n <count> β€” terminate after <count> CAN frames, and the default is infinite 🌈
  • -i β€” ignore -ENOBUFS return values on write() syscalls, living dangerously
  • -x β€” disable local loopback of generated CAN frames 🚫
  • -c <count> β€” number of messages to send in burst, default is 1
  • -v β€” increment verbose level for printing sent CAN frames, stack it up for more drama πŸŽ€

🌟 Generation modes 🌟

  • 'r' => random values, and yes this is the default babe
  • 'e' => random values, even ID
  • 'o' => random values, odd ID
  • 'i' => increment values
  • <value> => fixed value (in hexadecimal for -I and -D) πŸ’œ
  • => nibbles written as 'x' are randomized (only for -D) β€” so cute, so specific

the gap value (in milliseconds) may have decimal places, like '-g 4.73' β€” she's precise like that πŸ’…

when incrementing the CAN data the data length code minimum is set to 1.

CAN IDs and data content are given and expected in hexadecimal values. no cap, hex only 🧚


⭐ EXAMPLES ⭐

cangen vcan0 -g 4 -I 42A -L 1 -D i -v -v

fixed CAN ID and length, with incrementing data πŸ’–


cangen vcan0 -e -L i -v -v -v

generate EFF frames with incrementing length, triple verbose because main character energy ✨


cangen vcan0 -D 11223344DEADBEEF -L 8

fixed CAN data payload and fixed length πŸŽ€


cangen vcan0 -D 11xx3344DEADBEEF -L 8

fixed CAN data payload where the 2. byte is randomized, with a fixed length β€” the xx ate πŸ’…


cangen vcan0 -I 555 -D CCCCCCCCCCCCCCCC -L 8 -g 3.75

generate a fix busload without bit-stuffing effects 🌸


cangen vcan0 -g 0 -i -x

full load test ignoring -ENOBUFS πŸ”₯


cangen vcan0 -g 0 -p 10 -x

full load test with polling and a 10ms timeout ⏰


cangen vcan0

my favourite default :) 🫢 couldn't be me picking anything else


ok so quick vibe check reminder: -8 really does say "greater then 8" in the original and we are NOT fixing her grammar, we are respecting her journey 😌

and that's the whole page bestie, you're fully caught up πŸ’œ mwah πŸ’‹

this was cangen 2023.03-1build1, dated December 2025 β€” from me and the rest of the User Commands girlies, slay responsibly πŸ‘‘

πŸ“¦ where this page comes from