This is a stand-alone example application using the Anybus CompactCom Driver API (abcc-driver-api) ported for the Anybus CompactCom Adapter Board - Module to Raspberry Pi evaluation platform.
To enable easy evaluation and inspiration to Anybus CompactCom prospects.
- This example application shall be built for and ran in a Linux environment, like the Raspberry Pi OS.
The library libgpiod-dev V2.x.x is required.
For Raspberry Pi OS V6.x (Debian 13 `Trixie´ based)
Install the library with the following command. Use the sudo prefix as suggested below if your user is not authorized for this installation.
sudo apt install libgpiod-dev
For Raspberry Pi OS V5.x (Debian 12 `Bookworm´ based)
A backported version of libgpiod-dev V2.x.x is available. Here's how to install it. First, add the backports repository to your sources list by running
echo "deb https://deb.debian.org/debian bookworm-backports main" | sudo tee /etc/apt/sources.list.d/bookworm-backports.list
then update your package list with
sudo apt update
With these preparations, you can install libgpiod-dev V2.x.x by running
sudo apt install -t bookworm-backports libgpiod-dev
Use the sudo prefix as suggested above if your user is not authorized for this installation.
How to check your version of Raspberry Pi OS
lsb_release -d
If you do not yet have CMake and want to use it for building, install it with the following command. Use the sudo prefix as suggested below if your user is not authorized for this installation.
sudo apt install -y cmake
For Raspberry Pi OS V6.x (Debian 13 `Trixie´ based)
- SPI: In the Raspberry Pi OS GUI, click on the Raspberry Pi icon in the top-left corner of the screen. Then navigate to Preferences > Control Centre and type your password if prompted. In Control Centre, go to Interfaces and enable SPI.
- Serial Interface: In the Raspberry Pi OS GUI, click on the Raspberry Pi icon in the top-left corner of the screen. Then navigate to Preferences > Control Centre and type your password if prompted. In Control Centre, go to Interfaces, enable Serial Port, and disable Serial Console.
For Raspberry Pi OS V5.x (Debian 12 `Bookworm´ based)
- SPI: In the Raspberry Pi OS GUI, click on the Raspberry Pi icon in the top-left corner of the screen. Then navigate to Preferences > Raspberry Pi Configuration and type your password if prompted. In the Raspberry Pi Configuration menu, go to Interfaces and enable SPI.
- Serial Interface: In the Raspberry Pi OS GUI, click on the Raspberry Pi icon in the top-left corner of the screen. Then navigate to Preferences > Raspberry Pi Configuration and type your password if prompted. In the Raspberry Pi Configuration menu, go to Interfaces, enable Serial Port, and disable Serial Console.
This repository contains submodules abcc-driver-api, (abcc-driver and abcc-abp that must be initialized. Therefore, pass the flag --recurse-submodules when cloning.
git clone --recurse-submodules https://github.com/hms-networks/abcc-example-raspberrypi.git
If you did not pass the flag --recurse-submodules when cloning, the following command can be run:
git submodule update --init --recursive
This example application utilizes the Anybus CompactCom Driver API's CMake module file in a top level CMakelLists.txt file to generate a complete Visual Studio project. To generate the project, run the lines below, starting in the repository root.
mkdir build
cd build
Generate a makefile with CMake:
cmake ..
Compile the target by running the generated makefile in the build/ folder:
make
Run the compiled executable in the build/ folder:
./raspberry_pi_example_project
Run the Makefile in the repository root to compile:
make
Run the compiled executable:
./raspberry_pi_example_project
Make sure that the SPI or serial interface is enabled on your Raspberry Pi configuration and that your CompactCom is attached correctly. See the Adapter Board for Raspberry Pi INSTALLATION GUIDE for more details.