Raspberry Pi CAN-Bus interface

Configuring CAN-Bus interface

General information

The following instructions are written primarily for the Experimental Avionics FDR unit, however they are largely applicable to any MCP2515-based hardware working with Raspberry Pi

FDR unit uses NiRen MCP2515 CAN-Bus adapter wired to the Raspberry Pi as follows:

CS pin – GPIO 8/ Pin 24
INT pin – GPIO 25/ Pin 22

Some nicie writeups about configuring CAN on Raspberry Pi:



Enable the SPI Bus by editing the /boot/config.txt

sudo nano /boot/config.txt

Add the following lines


This will configure the CAN Bus adapter to work at the speed of 500Kbs.


sudo reboot

Edit /etc/network/interfaces

sudo nano /etc/network/interfaces

Add the following lines

auto can0
iface can0 inet manual
pre-up /sbin/ip link set can0 type can bitrate 500000
up /sbin/ifconfig can0 up
down /sbin/ifconfig can0 down

Restart the Pi

sudo reboot

Initialize the CAN interface by entering:

sudo /sbin/ip link set can0 up type can bitrate 500000

Install can-utils

sudo apt-get install can-utils

Confirm the can board can read data from the bus.
For that

  • connect the FDR unit to the CAN-Hub
  • connect any sensor board (AHRS or Module-A) to CAN-Hub
  • power up the CAN-Hub
  • run the following command
candump can0

You should be able to the stream of CAN messages