Banana Pi BPI-M2+ RPi.GPIO Source Code

Hi everyone,

I am trying for days to figure out how to build a RPi.GPIO version for the M2+. In the Raspbian image the RPi.GPIO module is already installed but only as a compiled version. I’d like to rebuild it for 2 purposes:

  1. build it for python version 3.8 and higher.
  2. to be able to use it in docker containers, as copying the current version into a container gives the runtime error This module can only be run on a Raspberry Pi!

I’ve tried this version https://github.com/LeMaker/RPi.GPIO_BP. But no luck: setting pins doesnt result in an error but apparently the addresses are wrong as no effect can be seen (with gpio readall)

Is the package somewhere on github available? Would you have any other idea on how to overcome those problems?

Thanks Lukas

1 Like

I just found this https://github.com/BPI-SINOVOIP/RPi.GPIO. Apparently this is the source code (it works perfectly after compiling and installing).

However, does anyone has a clue why I still get the error This module can only be run on a Raspberry Pi! when installing and running it within a privileged docker container?

I found the reason. The above mentioned BP RPi.GPIO version needs the following file: /var/lib/bananapi/board.sh