Install PiCan

The PICAN board is an additional piece of hardware that you connect to your Raspberry. The board fits all Raspberry versions.

Untitled-9

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).

Untitled-9

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.

clipping

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]

Subscribe
Email me at:
8 Comments
oldest
latest most voted
Inline feedbacks
View all comments
Steven Derstappen
Steven Derstappen
7 year ago

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”)

Steven Derstappen
Steven Derstappen
7 year ago
Reply to Janssuuh

Hi Jeroen,

I have Raspbian Jessie.
The mistake was in the translation.
Have corrected the error.
Now it works.
Thank you!!

Corrado
7 year ago

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”

Corrado
7 year ago
Reply to Corrado

I jused Jesse and

[dtparam=spi=on
dtoverlay = mcp2515-c, oscillator = 16 million pesetas, interrupt = 25
dtoverlay=spi-bcm2835-overlay]

doestn work too 🙁