Raspberry Pi Legacy Tools addon

  • I would like to know the reasons why the RPi.GPIO library was dropped from the Raspberry Pi Tools add-on. In my opinion, this is a mistake. I'll explain. I am the author of the OLEDproc plugin. It depends on several libraries, including the luma.oled and luma.core libraries. And therein lies the trouble. The luma.core library needs the RPi.GPIO library to work. I am convinced that it is unthinkable and also pointless for me to create some clone of the luma.core library, which would use, for example, gpiozero instead of RPi.GPIO. So, as it stands, the OLEDproc add-on user could not upgrade their system to LE12, otherwise their OLED display would stop working. It occurred to me that it was possible to go another way. I tried to reincarnate the Raspberry Pi Tools add-on to include the necessary RPi.GPIO library. The result is the "new" add-on Raspberry Pi Legacy Tools.
    And it really works!
    I know there are more similarly affected add-ons (dependent on Raspberry Pi Tools/RPi.GPIO). If their users couldn't upgrade to LE12 because of this, now they can! It is really easy. You only need to do two steps:
    1. Install the Raspberry Pi Legacy Tools add-on
    2. Make a simple edit to the addon.xml file of the dependent addon. As an example, I present an excerpt from the addon.xml file that belongs to the OLEDproc add-on:
    Original version:
     <requires>
       <import addon="xbmc.python" version="3.0.0"/>
       <import addon="script.module.luma" />
       <import addon="script.module.cbor2" />
       <import addon="script.module.smbus2" />
       <import addon="script.module.spidev" />
       <import addon="virtual.rpi-tools" />
     </requires>

    Modified version:
     <requires>
       <import addon="xbmc.python" version="3.0.0"/>
       <import addon="script.module.luma" />
       <import addon="script.module.cbor2" />
       <import addon="script.module.smbus2" />
       <import addon="script.module.spidev" />
       <import addon="virtual.rpi-legacy-tools" />
     </requires>

  • First of RPi.GPIO is EOL and does not support RPi5 and has problems with recent kernels.

    For luma this is ofc a problem, as long they do not support the recent way of doing GPIO (RPi.GPIO was always more or less a massive hack rather then doing it properly). I have no idea what's needed that the standard way of dealing with gpio is gets supported there - there are open issues in that directions too.

    For reference

    rpi-tools: update addon and build for aarch64 as well by HiassofT · Pull Request #8230 · LibreELEC/LibreELEC.tv
    update gpiozero to 2.0 and switch from RPI.GPIO to the libgpiod-based lg-gpio, like RPiOS did in it's bookworm release Also drop the ancient adafruit libraries…
    github.com
    GPIO.add_event_detect no longer works with the new kernel 6.60 · Issue #6037 · raspberrypi/linux
    Describe the bug Since the update to the following kernel, the "add_event_detect" function from the RPi.GPIO library no longer works. Linux outdoor enclosurePi…
    github.com
  • First of RPi.GPIO is EOL and does not support RPi5 and has problems with recent kernels.

    Yes, I am aware of the EOL situation. But I (and surely many other users) don't have an RPi5 and for the RPi4 the RPi.GPIO library works FOR NOW...
    I just wanted to use the Raspberry Pi Legacy Tools to help myself (and perhaps other similarly affected users) give some time to the final solution.
    But okay, there's another option. It is also a workaround, but probably with a much longer perspective than the previous solution.
    The other option is rpi-lgpio.
    I tried to integrate it into Raspberry Pi Tools and it works!
    I am attaching both the finished add-on and the modified sources.