This tutorial is based on a Debian wheezy distribution from 2015-03-01 on the Beaglebone Black. The description is independent of the used CAN cape.
I used this CAN cape: BeagleBone Serial Cape from Logic Supply
The BeagleBone should already have the SocketCAN drivers installed, so to use the CAN bus you just need to set the bitrate 125 kBit/s and bring up the CAN0 interface. This this with:
ip link set can0 up type can bitrate 125000 ifconfig
You should see the can0 interface.
Get some useful CAN utilities for the command line:
# CAN 0 interface auto can0 iface can0 inet manual pre-up /sbin/ip link set $IFACE type can bitrate 125000 listen-only off up /sbin/ifconfig $IFACE up down /sbin/ifconfig $IFACE down
# Start can0 interface at startup ifup -a
Dump all CAN messages to the console: