GPIO Library on Raspberry Pi Model 5

RPi5

 

GPIO interface for the Raspberry Pi model 5 (GPIOconverter)

and Pi Bookworm Operating System

26 July 2025

 

The Raspberry Pi Model 5 was introduced at the end of 2023. It only works with Raspberry Pi Bookworm OS or later

However, the biggest impact for most developers is that the RPi.GPIO input/output library does not work on the Raspberry Pi model 5. This is because the RPi Model 5 now has a seperate chip caled 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 (a so-called shim) 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. GPIOconverter has been successfully tested on LEDs, LCD's, Stepper Motors and Rotary encoders (KY-040, COM-09117 and PEC11R series). 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  or download the Debian package from this Web site (See below). GPIOconverter mainly runs on Raspberry Pi OS Bookworm but it has also had limited testing on Ubuntu.

"Thanks for this project; it's been incredibly helpful!" User icyz on GitHub

 

Disclaimer

The Bob Rathbone Computer Consultancy (BRCC) does not provide any direct support for software using the RPi GPIO library. If there are problems with RPi GPIO itself then you are referred to the Raspberry Pi Forum. There are also no guarantees that the GPIOconverter will work for all the RPi GPIO software out there. The GPIOconverter software  is provided as is, without guarantee, warranties expressed or implied and BRCC shall not be liable for any loss or damage how so ever caused. You use GPIOconverter software at your own risk. Please report any issues with this software on GitHub

 

See also Raspberry Pi Internet Radio Page

 


Documentation          Download GPIOconverter software
GPIO converter.pdf GPIOconverter Source on GitHub
LGPIO User Interface Download gpioconverter_1.1_all.deb
    To download and install, run the following two instructions on the Raspberry Pi: 
    wget https://www.bobrathbone.com/raspberrypi/packages/gpioconverter_1.1_all.deb
    sudo dpkg -i gpioconverter_1.1_all.deb

Top

Advert