Two new addons for Orange Pi (Allwinner) boards

  • I created two new addons for Orange Pi (Allwinner) boards.

    Both are for Kodi 19 (Matrix) only.

    The first is "Orange Pi Tools". This is actually the OrangePi.GPIO library (binary) for controlling GPIO using Python3.

    The second is the "Orange Pi Cooling Fan". It uses the above library and controls the fan based on the CPU temperature.

    The file is the source. Most people won't need that. Just in case you want to make some adjustments and compile yourself. After unpacking, two new folders will be created. The "opi-tools-depends" folder must be placed in the ".../" folder and the "opi-tools" folder should be placed in the ".../".

    Then you can compile by entering the command (for example): "PROJECT=Allwinner ARCH=arm DEVICE=H6 scripts/create_addon opi-tools".

    Addon is ready in the file (separately for H6 boards and separately for others).

    The file is the addon "Orange Pi Cooling Fan".

    I hope someone will be interested in it.

    EDIT 2021-07-09:

    I found that there is an bug in the OPi.GPIO library. There does not work properly calling of callbacks when mode == GPIO.BOARD. The bug is fixed in release

    Subsequently, I also created a corresponding new version of the virtual.opi-tools add-on. It is here:

    EDIT 2021-08-23:

    I found some bugs in the original library Jeremie-C/OrangePi.GPIO:

    1) The control of pins belonging to the PL bank and higher does not work at all.

    2) Pin status reading GPIO.input(channel) does not work properly, when edge detection GPIO.add_event_detect() is activated on the same channel (this problem only occurs with H3).

    I fixed both bugs in my fork Pako2/OrangePi.GPIO.

    Subsequently, I also updated the Orange Pi Tools add-on, which uses the library.

    I also made a minor fix in the Orange Pi Cooling Fan add-on.

    All new versions of add-ons are here:

    Orange Pi Cooling Fan add-on

    Edited 3 times, last by LuRu: New version released. ().

    • Official Post

    You should look at creating a repo for the add-ons so that users can install the repo, then install the add-ons, and then receive updates to the add-ons when you push changes (fixes/enhancements) to them.

  • Thank you for the advice. Yes, that would probably be ideal. Maybe I'll do it sometime. But I'll wait for now. Maybe there will be little or no interest, so it would make no sense.

    • Official Post

    You could include them in our repo too of course, but that ideally requires them to detect and gracefully error when install on non-Opi boards since we are now publishing a common set of ARMv7/ARMv8 add-ons and they'll be visible to users of any ARM device. You can use "dtsoc" and "dtname" to read the device-tree compatible strings.

  • Today I upgraded LibreELEC to the latest nightly version (LibreELEC-H3.arm-9.80-nightly-20201230-c9e96e6-orangepi-pc.img).

    My addon "" then stopped working.

    I found that the problem is in the "-b" option of the "top" command.

    This returns the error " 'dumb': unknown terminal type. ".

    This will remain so that it is not possible to use "top batch-mode" in LibreELEC?

  • I wanted to use the virtual.opi-tools add-on even more.

    I wanted to add some buttons and test their status using a python.

    I can easily read the status of buttons (statically) with a command like state01 = GPIO.input(button01).

    But I need to use a callback and it doesn't work.

    I have the command GPIO.add_event_detect(button01, GPIO.BOTH, callback = buttonCallback) in my script.

    As soon as the interpreter reaches the specified line, I get an error message RuntimeError: Failed to add edge detection

    I don't know how to solve it.

    I installed Armbian on the same board and there the exact same script works as expected. The OPi.GPIO library is also installed from the same source (GitHub - Pako2/OrangePi.GPIO: RPi.GPIO drop-in replacement library for Orange Pi Boards).

    Does anyone have any idea what to do with it?

    Note: I have LE version nightly-20210703-9059fe9 installed

    Edited once, last by LuRu: Addition of version LE ().

  • I understand that I have provided little information.

    I made a debug version and now I have some information.

    This problem is in the following function:

    Specifically, where after executing g = new_gpio(gpio) the result is NULL.

    But I still don't know why this only happens in the LibreELEC OS, while in Armbian it works properly.

  • So I made another debug version and found out even more information.

    The problem is in the function

    specifically in section

    So now it looks much clearer.

    There is no  sys/class/gpio directory in LibreELEC (maybe just for Allwinner?).

    For comparison - in the case of Raspberry Pi this directory exists ...

    Can this be fixed?

    Edited once, last by LuRu: Addition of text. ().

  • Thank you for the answer. I have three different boards:

    1) Orange Pi PC (H3, 1GB DDR3 SDRAM)

    2) Orange Pi Lite 2 (H6, 1GB LPDDR3 SDRAM, no Ethernet)

    3) Orange Pi 3 (H6, 2GB LPDDR3 SDRAM)

    I use them all for LibreELEC, but due to the specification, my favorite is the Orange Pi 3. This is the board on which I performed the described debugging.