RPi GPIO Python converter?

Can anyone assist locating the source code to convert RPi GPIO to GPIOD?

I’m not sure what you mean by “convert” in this case, but here is a link to my libgpiod example on the Python Bindings thread for the aml-s905x-cc. If you’re using a board other than le Potato you’ll just need to look up the chip and line numbers for your board.

As far as I know, RPi.GPIO hasn’t been ported to these boards, and probably wont ever be. First paragraph from the above mentioned thread’s OP:

There’s no source code to covert RPi.GPIO to use gpiod. We have text based GPIO maps that can be loaded into Python. We may create a library based on that in the future.

Thanks for the responses. Anytime I enter “import gpiod” I get command not found after following the tutorials.

How are you trying to run it? Sounds like you’re trying to run a script without making it executable first, or skipping the “./” .

The need for a package to convert RPi.GPIO calls to a modern equivalent such as GPIOD or LGPIO has become more urgent since the introduction of the Raspberry Pi Model 5 in 2023 using Raspberry Pi OS Bookworm. This is because the RPi Model 5 now has a separate chip called RP1 for controlling the GPIO header. This means that hundreds of thousands of programs or maybe even millions of programs need to be modified to use one of the newer libraries such as gpiod or lgpio.

My own product also Raspberry Pi Internet Radio is such a program and would have meant a lot of work to convert all the GPIO routines to say GPIOD which does run on the RPi Model 5. So I decided to write a simple interface called GPIOconverter which converts RPi GPIO calls to one of the newer GPIO interfaces. GPIOD was advocated as the best way forward however I found that GPIOD was poorly documented and I could not find any examples of how to handle interrupts. I eventually settled on using python3-lgpio for the GPIOconverter software. The architecture of the interface is shown below:

OUTPUT: User Program → GPIO calls → GPIOconverter → LGPIO
INPUT: LGPIO events → GPIOconverter → User Program

The GPIOconverter software is currently available available on GitHub (See below) or download it from the following Web site.


Our lgpio command line tool is not to be confused with lgpio python library. RPi.GPIO was not a good library to begin with.