canhut
is a composite of tools to provide GUI-enriched CAN signal visualizer for FDC, aims at supporting application-level verification and debugging in vehicle environment. It consists of a SocketCAN over Ethernet tunnel tool called cannelloni
. The tool run on FDC and ubuntu PC to accomplish a CAN message mirroring from FDC's SocketCAN to ubuntu's SocketCAN. Besides, a CAN DBC and signal visualizer tool cabana
runs on ubuntu PC to read frames from SocketCAN and plotting it on the Qt-based GUI. The signal can be decoded according to the DBC file.
┌─────────┐ eth ┌───────┐
│ ubuntu ├────────┤ FDC ├────────────┐ ...... ───────┐
└─────────┘ └──┬──┬─┘ │ │
│ └──────────┐ └───────┐ └───────┐
│ GBDC CAN │ CAN1 │ CAN2 │ CAN_n
┌───┴───┐ ┌───┴───┐ ┌───┴───┐ ┌───┴───┐
│ BMS │ │ ECUs │ │ ECUs │ │ ECUs │
└───────┘ └───────┘ └───────┘ └───────┘
- Ubuntu 22.04 (WSL2 is okay)
- Support kernel module (or built-in) can can-raw vcan
- If using WSL2,
networkingMode=mirrored
is required to be set in wsl2 config
[wsl2]
networkingMode=mirrored
- S32G3 SDK 40 for cross-compile
- Ethernet cable to connect FDC
- DBC files (need sanitize, remove multiple-lines comment)
Clone the source code including submodules
git clone --recurse-submodules git@github.com:foxtron-ev/canhut.git
The cannelloni uses cmake to generate a Makefile. Please build cannelloni using the following command.
For ubuntu
cmake -DCMAKE_BUILD_TYPE=Release -DSCTP_SUPPORT=false
make
In another shell environment, to build the executable runs on FDC
source /opt/fsl-auto/40.0/environment-setup-cortexa53-crypto-fsl-linux
cmake -DCMAKE_BUILD_TYPE=Release -DSCTP_SUPPORT=false
make
Please follow the readme in openpilot tools to build.
On ubuntu, just instal it using make install
On FDC, copy the executable cannelloni
to FDC file system.
On FDC, turn on CAN-to-ETH routing. For example, forward CAN2 to ubuntu port 20000, where the ubuntu IP address is 192.168.200.63.
cannelloni -I vcan2 -R 192.168.200.63 -l 20000 -r 20000
On ubuntu, turn on CAN-to-ETH routing, to listen port 20000 and mirror it to vcan2.
cannelloni -I vcan2 -R 192.168.200.1 -l 20000 -r 20000
And then launch cabana in openpilot project.
./tools/cabana/cabana
Then switch to "SocketCAN" tab to select vcan2 and corresponding DBC file. The alternative is to add options to the command line.
./tools/cabana/cabana --dbc ~/projects/cmm/FPD1_101.0_CAN2_FUSION_20240909_Fix.dbc --socketcan vcan2
- Support one channel at a time