To install the necessary extensions and to be able to use the CAN module with a Raspberry Pi, please
update the package lists first and install the extension can-utils:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install can-utils
Next, use the following command to get the kernel version of your Raspberry pis. This is necessary for the
further configuration of the system.
uname -a
You will be shown the current kernel version (e.g. "4.4.41-v7").
Next, open and edit the config.txt file with the following command:
sudo nano /boot/config.txt
If your kernel version is 4.4.x or newer, please add the following lines to the end of the file:
dtparam=spi=on
dtoverlay=mcp2515-can0,oscillator=8000000,interrupt=25
dtoverlay=sp1-1cs
However, if your Raspberry Pi runs with an older kernel version, please add the following lines to the end
of the file instead:
dtparam=spi=on
dtoverlay=mcp2515-can0,oscillator=8000000,interrupt=25
dtoverlay=sp1-bcm2835-overlay
Save the file with the key combination CTRL+O, confirm the saving process with Enter, and exit the editor
with the combination CTRL+X.
Restart your Raspberry Pi with the following command:
sudo reboot
Published: 30.10.2018
Copyright by Joy-IT
CAN Module
7
Need help?
Do you have a question about the CAN MODULE and is the answer not in the manual?