Wireshark CAN Monitor

After many times thinking to myself how useful it would be to see the actual data on a robot’s CAN bus, I decided to sit down and write a Wireshark plugin capable of dissecting the frames sent by various devices: https://github.com/carlosgj/FRC-CAN-Wireshark.

Naturally, there needs to be some way to get the CAN data into a desktop computer. So far, I’m using a Microchip CAN Bus Analyzer. However, I believe it should also be possible to run Wireshark on a Raspberry Pi outfitted with one of several SPI CAN controllers for which there are Linux kernel drivers.

So far, the plugin can successfully decode the CAN ID fields in Wireshark, and I’m working on implementing dissection of the various status frames sent by a Talon SRX (dissection for other CAN devices will follow, hopefully).

As mentioned in the README in the repo, I don’t have any a priori knowledge of the data structure in the CAN data; the dissection is based on watching live CAN data, and occasionally finding low-level code laying around (https://github.com/CrossTheRoadElec/deprecated-HERO-SDK/blob/master/CTRE/LowLevel_TalonSrx.cs). If anyone (especially the manufacturers themselves :wink:) has additional information on CAN frame structure used by FRC devices, I’d greatly appreciate contributions to the reference information.

Also, this is my first foray into Wireshark development, and I therefore expect that I’ve implemented my dissectors pretty horribly. I’d welcome advice and/or pull requests from someone with greater Wireshark/C experience.

10 Likes