Python3-gpiod missing in Yocto Scarthgap for Verdin AM62 – how to enable Python GPIO access

Hello,

I am working on a custom Yocto-based image (Scarthgap) for the Verdin AM62 SoC module.
I want to control GPIOs from my Python (PyQt5) application.

However, when I add:
IMAGE_INSTALL:append = " python3-gpiod python3-libgpiod "
to my local.conf or custom image recipe, Bitbake reports:

ERROR: Nothing RPROVIDES ‘python3-libgpiod’
ERROR: Nothing RPROVIDES ‘python3-gpiod’

It looks like the Python bindings for libgpiod are not available in the
Toradex BSP for AM62. libgpiod C library is present, but the Python bindings are missing.

Could you please confirm:
What is the recommended method for GPIO access from Python on Verdin AM62?

My goal:
Use import gpiod in a Python PyQt application to control GPIO pins.

Board:

  • Verdin AM62 1GB
  • BSP version: Scarthgap
  • Build: Yocto Project, not Torizon

Thanks for your support!

Regards,
Raju

Hi, I’m the Toradex AI Assistant.

I might make mistakes or occasionally get you wrong. Our support team will step in if needed.


GPIO Access from Python on Verdin AM62 with Yocto BSP

Hello Raju,

Based on the available Toradex documentation, the recommended method for GPIO access on Toradex modules is through libgpiod, which provides both command-line tools and a C API (1). However, the documentation primarily focuses on C language examples and command-line usage.

Current GPIO Access Methods

The Toradex BSP documentation shows that libgpiod is the standard method for controlling GPIO pins, replacing the deprecated sysfs interface (1). The documentation provides examples for:

  1. Command-line tools like gpioget, gpioset, and gpiomon (1)
  2. C Language API with cross-compilation examples (1)
  3. Python examples are mentioned in the context of Torizon OS (1)

Python GPIO Access

The documentation mentions that Python examples are available in the Torizon samples repository (1):

However, since you’re working with a custom Yocto BSP (not Torizon), you may need to ensure the Python bindings are available in your build environment.

Alternative Approaches

  1. Use libgpiod command-line tools from Python: You can call the libgpiod command-line tools (gpioget, gpioset, etc.) from your Python application using subprocess calls (1)

  2. Check for Python bindings in OpenEmbedded layers: The documentation suggests that additional pre-written layers can be found through the OpenEmbedded web interface (2)

  3. Consider Torizon OS: The documentation notes that “Torizon OS is preferred for using libgpiod due to its ease of use and smoother application development experience” (1)

GPIO Identification

For your Verdin AM62, you’ll need to identify the correct GPIO chip and line numbers. Use the gpiodetect and gpioinfo commands to find available GPIO chips and their line assignments (1). Pins exposed on the edge connector are labeled as SODIMM_x (1).

Since the Python bindings appear to be missing from the standard Toradex BSP for AM62, I recommend checking the OpenEmbedded layer index for community-maintained Python gpiod packages or considering a migration to Torizon OS for better Python GPIO support.

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

Hey, @raju3003

I apologize for the delayed response.

The python library for libgpiod is not provided by us, but by openembedded themselves. The python3-gpiod is provided by the meta-openembedded/meta-python layer, which is added to the bblayers.conf file automatically when you sync your meta layers with our manifest. I managed to build an image with python3’s libgpiod by adding:

IMAGE_INSTALL:append = " python3-gpiod"

The error you showed means that bitbake is not finding the recipe. Make sure your bblayers.conf file includes the meta-python layer:

BBLAYERS ?= "\
...
  ${TOPDIR}/../layers/meta-openembedded/meta-python \
...
"

This layer should be present by default, but it might not be if you are not using our manifest or if you deleted it at some point. Let me know if this solves the issue.

Best regards,