Uwes Blog

CAN bus on Raspberry Pi with Stretch

I needed to install my CAN Board on my Raspberry after some time not using it. Because most of the copy/paste stuff is for the older distribution(s), here how to install with Stretch (in my case 2017-11-29-raspbian-stretch.img).

  1. Add to /boot/config.txt
  1. Add file /etc/network/interfaces.d/can0
auto can0
iface can0 inet manual
    pre-up /sbin/ip link set $IFACE type can bitrate 1000000 triple-sampling on
    up /sbin/ifconfig $IFACE up
    down /sbin/ifconfig $IFACE down

Reboot and you should see the can interface with ifconfig. Even faster you could use my rpi-can role for Ansible.

Thanks for reading. Comment on this post!

Back to index