Thread:Talk:RPi CANBus/RPI Kernel Compilation Easier Method && CAN bus

I wanted to share my experience with building can bus support for the Raspberry Pi using the most recent version of Ubuntu (14.04 LTS).

In order to get everything up and running, I used a package called rpi-build (see rpi-build). On a fresh install of ubuntu 14.04, one needs to install 32-bit libraries, but not from ia32-libs. This package is deprecated in 14.04. The packages needed to install can be done with the following:

From here, you can build the code using (assuming cross-compilation from linux)

In menu config, make sure to enable, CAN bus, timing calculation, and the usb driver (I used a PEAK USB adapter personally). I also recommend enabling the virtual CAN interface for testing code.

The Pi makes use of the SocketCAN library to perform the CAN bus integration. It can be called similarly to a TCP/IP socket, with some differences. If you use Python version 3.3+ you can create CAN sockets from Python.

Hope that this helps some others as I personally struggled with this.