Skip to content
Snippets Groups Projects
Claudiu MILEA (95030)'s avatar
Claudiu MILEA (95030) authored
Add basic setup for sending frames via CAN Bus and Ethernet between three processes (chassis, powertrain, body)

See merge request !3
4e640683
History

README

This docker image contains the can-utils package.

To be able to use/run it, the following steps should be followed:

  1. The host exposes the virtual interface vcan0. To create a virtual can port on the host:
    • sudo modprobe vcan
      • For the following error when enabling vcan module, we found a fix by installing the required extra kernel modules with sudo apt install linux-modules-extra-$(uname -r)

        modprobe: FATAL: Module vcan not found in directory /lib/modules/5.4.0-105-generic

    • sudo ip link add dev vcan0 type vcan
    • sudo ip link set up vcan0
  2. Generate access token
    • go to Access Tokens page
    • add token name
    • select read_registry and write_registry
    • create token
    • save the token to a file, as it is visible only once
  3. Login
    • docker login gitlab.cs.pub.ro:5050 -p "INSERT_ACCESS_TOKEN"
  4. Run the setup using Docker Compose
    • docker-compose up
  5. Generate CAN or Ethernet traffic from the containers
    • docker exec <can-container-name> cangen vcan0
    • docker exec <eth-container-name> trafgen --dev <eth-if> --conf trafgen.cfg
  6. View the CAN or Ethernet traffic on the host
    • candump vcan0
    • tcpdump -i <eth-if>

Or you can use the Makefile. Steps 1-3 remain the same and then:

  • Run the setup
    • make run
  • Generate traffic as mentioned in the previous section
  • Scan the traffic on the host
  • Stop the containers and delete the images
    • make clean

Useful links: