CANopen Setup
This section explains setting up CANopen communication on a BBB with comms cape. This cape enables CANbus connections without additional hardware.
Setting up CANopenSocket
-
Clone the CANopenSocket repo and its submodules (CANopenNode).
git clone https://github.com/CANopenNode/CANopenSocket.git cd CANopenSocket git submodule init git submodule update
-
Put CANopenSocket folder in the
/home/debian/
folder on BBB. -
Compile CANopenSocket and canopencomm:
cd CANopenSocket/canopend make
and, go back to home folder
cd /
, then runcd CANopenSocket/canopencomm make
Starting the communication
- Firstly connect the BBB to the CANbus network of the X2.
- The communication setup requires CAN pins to be enabled on the BBB comms cape, and canopend (in CANopenSocket) has to be started.
- This can be done using the InitHardware.sh script from the BBB Script Folder. Copy this file to BBB
/home/debian/
folder and run it:./InitHardware.sh
. - The system is now setup to run programs that use CANopen.