Raspberry Pi: Libgpiod Issue With Acconeer A111 Server

by Admin 55 views
Raspberry Pi OS 64-bit: libgpiod2 Unavailable, libgpiod3 Not Linking Correctly with exploration_server_a111

Hey Acconeer team,

I'm currently trying to get the A111 exploration server up and running on my Raspberry Pi, which is running the 64-bit version of Raspberry Pi OS (Bookworm, aarch64). I've been following the official instructions (Raspberry Pi (A111 on XC111+XR111 or XC112+XR112)), but I've hit a few snags related to the libgpiod2 library. It looks like Bookworm and the 64-bit architecture have moved on to libgpiod3, and it seems the current build of acc_exploration_server_a111 isn't linking correctly. I actually had this working a few months back, but now, with a fresh Raspberry Pi, I'm running into installation problems.

Here’s a detailed breakdown of what I’ve done:

Environment

  • Device: Raspberry Pi 4B
  • OS: Raspberry Pi OS 64-bit (Bookworm, aarch64)
  • SDK version: Acconeer Exploration SDK v2.8.0
  • Python version: 3.13.5
  • acconeer-exptool version: 7.17.4

What I Tried

Option 1: Attempting to install libgpiod2 via apt

sudo apt install libgpiod2

Result: Not available. Apt reports:

Package 'libgpiod2' has no installation candidate

So, I went ahead and installed libgpiod3, which is the default package for Bookworm:

sudo apt install libgpiod3 gpiod

Option 2: Installing libgpiod3

With libgpiod3 installed, the system provides /usr/lib/aarch64-linux-gnu/libgpiod.so.3. However, when I try to launch the exploration server:

./out/acc_exploration_server_a111

It throws this error:

error while loading shared libraries: libgpiod.so.2: cannot open shared object file

It looks like the prebuilt exploration server binary is still looking for libgpiod.so.2.

Essentially, it fails to start because it can't find the older library.

error while loading shared libraries: libgpiod.so.2: cannot open shared object file

Option 3: Manually installing an older libgpiod2 (arm64) .deb

I then attempted to manually download and install an older libgpiod2 (arm64) .deb package:

wget http://ftp.debian.org/debian/pool/main/libg/libgpiod/libgpiod2_1.6.3-1+b3_arm64.deb

sudo dpkg -i libgpiod2_1.6.3-1+b3_arm64.deb

Unfortunately, this failed due to dependency conflicts (dependency problems - leaving unconfigured).

What I’m Looking For

Okay, here’s what I’m hoping you guys can help me with:

  1. Clarification on Raspberry Pi OS 64-bit (Bookworm) Support: Could you clarify the official support status for Raspberry Pi OS 64-bit (Bookworm)? Knowing whether this configuration is officially supported will help me determine the best course of action. It would be great to know if there are any known issues or specific steps to take when using Bookworm.
  2. Availability of a 64-bit Prebuilt Binary: Is there a 64-bit prebuilt exploration server binary available that is linked against libgpiod3? Using a prebuilt binary compatible with the current OS libraries would greatly simplify the setup process and avoid the linking issues I'm currently facing. A direct link to the binary or instructions on where to find it would be extremely helpful.
  3. Guidance on Rebuilding the Exploration Server: Alternatively, could you provide guidance or updated build instructions to rebuild acc_exploration_server_a111 specifically for the current 64-bit environment? Detailed instructions on how to properly build the server from source, ensuring it links against libgpiod3, would allow me to create a compatible binary myself. This could include information on necessary build tools, dependencies, and any specific flags or configurations required.

Thanks a bunch!

Any advice on how to proceed with Bookworm 64-bit support would be amazing – whether I should try rebuilding the SDK or if it’s best to wait for an updated precompiled binary.

Understanding the libgpiod Issue on Raspberry Pi 4B

Let's dive deeper into the libgpiod issue on a Raspberry Pi 4B running Raspberry Pi OS 64-bit (Bookworm). The core problem revolves around the transition from libgpiod2 to libgpiod3 in the newer Bookworm distribution. The older Acconeer Exploration SDK, specifically the acc_exploration_server_a111, was likely built against libgpiod2. When you try to run it on a system that only provides libgpiod3, you encounter the dreaded "error while loading shared libraries" message. This error essentially means the program can't find the specific version of the library it was designed to work with. The transition from libgpiod2 to libgpiod3 involves changes in the Application Programming Interface (API), which is the set of rules and specifications that software programs can follow to communicate with each other. When a library's API changes, programs built against the older API might not be compatible with the newer version without recompilation or modification.

Manually installing an older .deb package for libgpiod2 often leads to dependency conflicts. This is because the system's package manager recognizes that installing an older version of a core library can break other software components that rely on the newer libgpiod3. Package managers are designed to prevent such conflicts to maintain system stability. Therefore, the best approach is to either rebuild the acc_exploration_server_a111 against libgpiod3 or obtain a prebuilt binary that is already compatible with the newer library.

Exploring Solutions: Rebuilding vs. Prebuilt Binaries

When faced with this libgpiod incompatibility, there are generally two paths forward: rebuilding the acc_exploration_server_a111 from source or using a prebuilt binary. Rebuilding involves obtaining the source code for the exploration server, configuring the build environment to use libgpiod3, and then compiling the code to produce a new executable. This approach ensures that the resulting binary is specifically designed to work with the libgpiod3 library available on the Raspberry Pi OS 64-bit (Bookworm) system. However, rebuilding from source can be complex, especially if you're not familiar with the build process, required tools, or specific configuration options.

Using a prebuilt binary, on the other hand, is a simpler solution, provided that a compatible binary exists. A prebuilt binary is an executable file that has already been compiled and is ready to run on the target system. If Acconeer provides a prebuilt acc_exploration_server_a111 binary that is linked against libgpiod3, you can simply download and run it without needing to rebuild anything. This approach avoids the complexities of the build process and ensures compatibility with the system's libraries. However, the availability of a compatible prebuilt binary depends on whether Acconeer has released one specifically for Raspberry Pi OS 64-bit (Bookworm).

Step-by-Step Troubleshooting Guide for libgpiod Issues

Let's outline a step-by-step troubleshooting guide to address the libgpiod issues when setting up the A111 exploration server on a Raspberry Pi 4B running Raspberry Pi OS 64-bit (Bookworm):

  1. Verify libgpiod3 Installation: Ensure that libgpiod3 is correctly installed on your system. You can verify this by running dpkg -l | grep libgpiod3 in the terminal. This command will list all installed packages that include "libgpiod3" in their name. If the library is installed, you should see an output indicating its presence and version.
  2. Check for libgpiod2: Confirm that libgpiod2 is not installed. Run dpkg -l | grep libgpiod2 in the terminal. If libgpiod2 is installed, it may be conflicting with libgpiod3. You may need to remove libgpiod2 if it's causing issues, but be cautious as removing it might affect other applications that depend on it.
  3. Identify Dependencies: Use the ldd command to identify the dependencies of the acc_exploration_server_a111 executable. Run ldd ./out/acc_exploration_server_a111 in the terminal. This will list all the shared libraries that the executable depends on. Look for entries related to libgpiod. If it shows that the executable is looking for libgpiod.so.2, it confirms that it was built against libgpiod2.
  4. Rebuild from Source (if available): If Acconeer provides the source code for acc_exploration_server_a111, try rebuilding it against libgpiod3. Follow the build instructions provided by Acconeer, ensuring that the build environment is configured to use libgpiod3. This may involve updating include paths, library paths, and build flags.
  5. Obtain a Prebuilt Binary (if available): Check the Acconeer website or contact Acconeer support to see if they offer a prebuilt binary of acc_exploration_server_a111 that is compatible with Raspberry Pi OS 64-bit (Bookworm) and linked against libgpiod3. If a compatible prebuilt binary is available, download and use it.
  6. Create Symbolic Links (as a temporary workaround): As a temporary workaround, you can try creating symbolic links to map libgpiod.so.3 to libgpiod.so.2. However, this is not a recommended solution, as it can lead to unexpected behavior or crashes if the API changes between the two versions are significant. To create the symbolic links, run the following commands:
sudo ln -s /usr/lib/aarch64-linux-gnu/libgpiod.so.3 /usr/lib/aarch64-linux-gnu/libgpiod.so.2
sudo ln -s /usr/lib/aarch64-linux-gnu/libgpiod.so.3.1.0 /usr/lib/aarch64-linux-gnu/libgpiod.so.2.0.0

Note: Use this workaround with caution and only as a temporary measure.

Key Takeaways and Recommendations

The libgpiod issue on Raspberry Pi OS 64-bit (Bookworm) highlights the importance of library compatibility and the challenges of transitioning between library versions. To resolve this issue, it is recommended to either rebuild the acc_exploration_server_a111 from source against libgpiod3 or obtain a prebuilt binary that is specifically designed for the target system and library version. Avoid manually installing older .deb packages or creating symbolic links as permanent solutions, as they can lead to instability and unexpected behavior.

By following the troubleshooting steps outlined above and seeking guidance from Acconeer support, you can effectively address the libgpiod issue and successfully set up the A111 exploration server on your Raspberry Pi 4B running Raspberry Pi OS 64-bit (Bookworm).