The PICAN board is an additional piece of hardware that you connect to your Raspberry. The board fits all Raspberry versions.
It is since the later versions of Raspbian fairly easy to install hardware skpang.co.uk the PICAN.
You can use the [sudo raspi-config] command, which allows you to turn on the SPI functionality (and to boot automatically when you start your Pi).
Selecteer:
[8 Advanced Options]
[A6 SPI]
[Enable SPI]
Then update your current software:
[sudo apt-get update]
[sudo apt-get upgrade]
[sudo reboot]
Subsequently some settings have to be added to your config.txt.
[sudo nano /boot/config.txt]
Add the following 3 lines at the bottom of the file:
[dtparam=spi=on]
[dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25]
[dtoverlay=spi-bcm2835-overlay]
Your software is now installed, briefly reboot.
After restart you can bring your interface "up" by the following command to give:
[sudo /sbin/ip link set can0 up type can bitrate 100000]
(You need to adjust the bitrate to the bitrate of the canbus to measure activities to your desired hardware. In my case this is the Audi A4B6 Infotainmentbus, who has a bitrate of 100 KB per second.)
On [ifconfig] you can see if your can0 bus runs.
On [ip -s -d link show can0] you can see whether bytes are sent or received.
Ok, your canbus is now up and running. One last step is to install a number of small utilities / tools which are usefull to be able to make use of sending and receiving of can messages. To do this, enter the following commands:
[git clone https://github.com/linux-can/can-utils.git]
[cd can-utils]
[./autogen.sh]- gave me an error message, no effect
[make]
[make install]
If you prefer to download the files directly here:
Can_Utils (256 downloads)
[whohit]Install PiCan[/whohit]
EDIT:
@farfenkugell (Thanks for noticing!)
From the Jessie distro of Raspbian shall be in the following format URboot/config.txt used to be;
dtparam=spi=on
dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25
dtoverlay=spi-bcm2835-overlay
Comments are now also on the Forum!
Hi Janssuuh,
first great praise, for the effort you've made friends.
I have the PICAN 2 Module, should be just as istallation? I did it with your manual. but it always comes (Indicated find device “can0”)
Hi Steven,
I think, the MCP2515 chip on the module PICAN is unchanged. So also the installation.
There are some small differences in the format of the installation on your Raspbian distro. Perhaps here the problem. Do know, What version you are using? (Wheezy / Jessie?)
In the Forum I've written the differences:
http://www.janssuuh.nl/topic/pican-installeren/
With kind regards,
Jeroen
Hi Jeroen,
I have Raspbian Jessie.
The mistake was in the translation.
Have corrected the error.
Now it works.
Thank you!!
I found an issue:
Add the following 3 lines at the bottom of the file:
[dtparam=spi=on]
[dtoverlay=mcp2515-can0-overlay,oscillator=16000000,interrupt=25]
[dtoverlay=spi-bcm2835-overlay]
= cannot find device “can0”
I jused Jesse and
[dtparam=spi=on
dtoverlay = mcp2515-c, oscillator = 16 million pesetas, interrupt = 25
dtoverlay=spi-bcm2835-overlay]
doestn work too 🙁
Hi David,
Possibly there’s a translation issue? (Your oscilator is set in pesetas?
Jessie distro uses these settings:
dtparam=spi=on
dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25
dtoverlay=spi-bcm2835-overlay
Which version of the pican hardware do you use?
Regards Jeroen