The PEAK CAN dongle is a device used to interact with a CAN bus from a laptop. On EVT, the firmware team primarily uses this for debugging of CAN messaging for individual boards and the bike system as a whole. As a team, we have a number of options to accomplish this, but this dongle is often the quickest and easiest because it requires relatively little setup and works very consistently.
Before you can use the PEAK CAN dongle, you need to download the necessary software. On Windows, you need to install the driver and PCAN-View, the application. On Linux, you may already have the kernel driver, so you can just use candump to see the output. Once you have your drivers and software set up, you can plug the dongle in and start using it.
Setting up CAN monitoring on macOS is a more involved process. Because of the lack of CAN drivers included in macOS you have two options for monitoring CAN.
OpenCANMonitor which can be downloaded from either brew or the GitHub page directly. This is a drop in solution for monitoring CAN and requires no additional instalations to get it working. However, the app is much newer and may be prone to bugs.
MacCAN Monitor App which is a two part download of the PCBUSB Library and MacCAN Monitor App. This is a demo app from the developers of the PCBUSB Library which is used to interface with a CAN network on macOS. The install instructions are listed below:
First download https://mac-can.com/ PCBUSB Library and MacCAN Monitor App. Once you have downloaded the files you need to extract both by double clicking on them in Finder.
Once you have extracted the files open the PCBUSB folder, you will then need to navigate to this folder using the terminal.
You should be able to enter cd ~/Downloads/PCBUSB into the terminal.
You next need too install the driver using the following command: sudo ./install.sh
The next step is to open the MacCAN Monitor App dmg file and drag the app into your Applications folder.
Everything should be working now!
Whichever setup you're using, you can start viewing CAN messages by plugging the dongle into the CAN bus and running the appropriate software on your computer. If needed, you should also be able to send CAN messages on the bus at a specified frequency. If you're unable to see CAN messages, check the bus impedance to ensure it's 60 ohms. If the bus impedance is fine, you can also diagnose bus problems by connecting an oscilloscope to CAN high and low.