Blog
Recent Posts
Arduino-Compatible Open-Source Dual CAN-FD Network Analyzer
Posted by
on
In a previous post, we highlighted SavvyCAN, developed by Collin Kidder, as the most effective open-source software for CAN bus sniffing. We have also worked on enhancing the compatibility of the CANFDuino and the GVRET protocol with SavvyCAN to support CANFD messages from two ports.
With these updates on GitHub, you can now sniff two CANFD busses with SavvyCAN and CANFDuino for less than $150! This cost-effective solution is worth noting. The configurability of the FD settings and messaging in SavvyCAN’s GVRET has not yet been fully baked in. Right now, it looks like it’s coded for 2 Mb CANFD speeds, which seem to be the most common combination for CANFD automotive networks. We will continue to contribute to this project, and there is a bit of a workaround at the moment. The current implementation has been tested with a baud rate of 500 k / 2 MB and sample rates per SAE standard J2284-5. It’s also worth noting that all the standard CAN bauds still work and apply, providing you with a reliable and versatile tool. Since all the standard CAN bus frames are compatible with CANFD, you can sniff either bus with the FD settings enabled (don’t transmit an FD message on a standard bus).
To begin sniffing on two CANFD buses using SavvyCAN, please follow the steps below:
Step 1: Install, Build and Verify
To ensure that all software and hardware are working properly, follow the instructions in the getting started section of the git repo readme file. Then, connect the CAN/FD ports to the bus(es) you want to monitor.
Step 2: Program the CANFDuino Firmware
Open Arduino IDE and navigate to File -> Examples -> CANFDuino_SavvyCANFD.ino. Upload the sketch using the IDE. Once complete, place a jumper on the “NO BOOT” pin to bypass the bootloader when the device is reset. (see hookup guide).
Optional: We've designed a user-friendly terminal interface for configuring the baud rates for CANFD and traditional CAN. If you prefer to pre-configure your unit before connecting to SavvyCAN, it's a breeze. Do NOT place the jumper on the NO BOOT pin and open up the serial monitor window in the ArduinoIDE with a 2 MB serial port baud rate and "carriage return" when pressing enter. Follow the on-screen prompts and type your responses (should only be a single number), followed by the return key until all baud rates are set. Now place the "NO BOOT" jumper on and power cycle (unplug USB, plug back in). See below, 2,2,2,2 results in both ports set for 500 k / 2 MB CANFD. This does enable FD rates beyond 2 MB. With such a straightforward process, you can configure your device with confidence and ease.
Step 3: Get SavvyCAN
Download our modified SavvyCAN build from GitHub (Windows only for now). The entire codebase can be downloaded, and the Windows executable is located in the "release" folder. Also, refer to YouTube videos for SavvyCAN usage.
Step 4: Connect to CANFDuino
To open the connection window in SavvyCAN, click "Add New Device Connection". Then select "enable console" to display the serial traffic, including the heartbeat. After that, choose "serial connection," and you will see a COM port corresponding to the CANFduino. Select the "CAN-FD" checkbox and click "create new connection" to complete the process.
In the console window, you should see messages confirming data transmission and reception over the serial port. If you have pre-configured your baud rates and port settings in the Arduino IDE, they will appear here. If the baud rate settings for CAN0 and CAN1 are not shown in the bottom tabs, select "enable bus," "enable CANFD," and choose the standard CAN "speed" and CANFD "baud rate" you wish to monitor from the drop-down list. After setting the baud rates for both tabs, remember to click "save bus settings" and then click on the GVRET device to check the status. It may show "connected," but if there is no traffic in the console window, click "reset selected device" to reset the CANFDuino with the new baud rates. The status will change from "not connected" to "connected," and traffic will reappear in the console window. Click "clear" to ensure there is traffic. The baud rates will now be saved, and you will not need to reprogram the device baud settings each time you use SavvyCAN. If you are connected to a bus, you should see packets in the serial window. Close this window to view the bus traffic in the main window.
Step 5: Start Sniffing a CAN Bus
Now that we are connected, it's time to connect to your CAN bus(es) and start sniffing. Remember that you'll need to understand where the terminations are and observe proper wiring in your network. If you need to enable one on your CANFDuino, do so. You should now see traffic in the main window and the source of that traffic (CAN 0 or CAN 1). Note: you will see longer messages on a CANFD bus of up to 64 bytes! A big thanks to Collin Kidder for developing such a powerful tool for the community!
CANFDuino - Dual CAN/CANFD Prototyping Platform
The CANFDuino is a fully-equipped embedded system designed for real-world applications. It integrates essential features such as dual CAN/CANFD ports, an SD card slot, and numerous analog and digital I/O. In addition, it includes an onboard prototyping shield for SMT and through-hole components, a sturdy aluminum enclosure, and durable connectors.
The CANFDuino supports CANFD, the latest version of the CAN Bus standard, which accommodates speeds of up to 5 Mbps. It has two native ports with DB9 connectors in an enclosure, ready to be mounted on your vehicle or installed in your autonomous project. This platform suits tinkerers, hackers, and industry professionals seeking an off-the-shelf, open-source CAN Bus solution that requires minimal or no hardware assembly.