28 Responses

  1. CAN Bus Support in Raspberry Pi - Tiqni

    […] Update : Latest Raspbian supports CAN Controller MCP251X, you don’t need to add modules like described above. Please read the new post on how to use CAN Bus with Raspberry Pi. […]

  2. Mike Jagoe
    Mike Jagoe at | | Reply

    Hi,
    your site really helped me – i have my Pi + Pican board working and ‘candump’ delivers a great file.
    i am now trying to get the canplayer working, but (so far) with no joy. from the command line i am executing the following:
    (Bring up the virtual interface )
    $ modprobe vcan
    $ ip link add vcan0 type vcan
    $ ip link set vcan0 up
    (Run canplayer)
    $ canplayer vcan0=can0 < candump-2014-09-21_204243.log
    any idea why i get no response?
    Thanks

  3. Mike Jagoe
    Mike Jagoe at | | Reply

    i have got further thru the day. i have now run into a buffer error after the file starts to be read. my command lines are:
    $ ip link set can0 type can bitrate 250000 listen-only off
    $ canplayer -g 27 -I candump-2015-09-17_164844.log

    the can signals are received and my display starts to present them, then i get an error with buffer overflow.

    any ideas?

  4. Emi
    Emi at | | Reply

    The command
    sudo ip link set can0 up type can bitrate 250000
    is telling me
    Cannot find device “can0”

    What am I doing wrong? Or what have I missed?

  5. Holger
    Holger at | | Reply

    Hi!
    I’ve followed your instruction but unfortunately I get a “cannot find device can0” message using the ip command.
    I’m using a Seeed can shield which is originally for Arduino. I’ve connected it to my Raspi 2 using a breadboard.

    Interestingly, I do not get any mcp251x messages in dmesg.

    Any ideas?

  6. Rob
    Rob at | | Reply

    Hi Tiqni
    which can bus shield are you using?

    Rob

  7. akshay
    akshay at | | Reply

    Have you tested it on pi 2 b?

  8. Mike
    Mike at | | Reply

    Tiqni,

    Can you share how the components are wired on your breadboard?

    Thanks!

    -Mike

  9. Mike
    Mike at | | Reply

    Tiqni,

    When do you think you’ll have the hardware post up? Just want to understand your timing before I bother you on FB. Thanks again!

    -Mike

  10. Alex
    Alex at | | Reply

    Hi Tiqni,
    I have recently purchased Pican2 duo board for my work project. I have 4.1.19-v7+ kernel and I connected the board to my Raspberry PI 2 but I did not wire CAN controllers themselves (no jumper wires go to the controllers). I followed your instructions but I can’t set can0 up. It says can0 not found. Does it mean that I have a a bad board or I have to connect the controller(s) to something? Sorry, I am a SW guy. I am not much in HW.
    Your help will be greatly appreciated.
    Thanks
    Alex.

  11. akshay lalla
    akshay lalla at | | Reply

    hi there , im using a CAN-SPI click board form MikroElektronica coupled with a pi-2 click shield. im having a problem finding “can0”

  12. Mark
    Mark at | | Reply

    For those getting can’t find can0. Try changing:
    dtoverlay=mcp2515-can0-overlay,oscillator=16000000,interrupt=25
    to
    dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25
    It worked for me.

    1. Rafael
      Rafael at | | Reply

      Hi Mark,
      This worked for me too, thank you very much for posting this advice!!!!

  13. NJ
    NJ at | | Reply

    Hi!
    Thank you for your tutorial. Its of great help indeed. However I need to get the same working on a Raspberry Pi3 (attached with CAN shield) with Windows 10 IoT Core instead of Linux. Do you have any idea about this?

    Thankyou!
    NJ

  14. Daniel Berntsson
    Daniel Berntsson at | | Reply

    can u do one more guide, using the new Kernel version:4.4 and
    RASPBIAN:)

  15. Marc Schattorie
    Marc Schattorie at | | Reply

    I’ve seen this question in this comment section, but the solutions given don’t seem to work for me.
    When I try

    ip link set can0 up type can bitrate 500000
    It results in
    Cannot find device “can0”

    When I try:
    ip link add dev vcan0 type vcan
    ip link set vcan0 up

    It appears to work, it doesn’t result in any errors, and the vcan0 shows up in ifconfig…

    Any help?

    1. Marc Schattorie
      Marc Schattorie at | | Reply

      Sorry, correction, I missed the comment from Mark… I tried that, now the interface seems to be setup correct, but I’m not getting any data (I tried several bitrates)…

Please comment with your real name using good manners.

Leave a Reply