Posts by LuRu

    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

    Great, it's finally working.

    So probably the problem was that my LE was installed some time ago (although upgraded to the last night version).

    Thank you again for your extraordinary support and patience.

    But it looks like it will still be many hours of work before LCDproc will work. There is little information on how to debug it.

    So I'm surprised at how fast it went. The LCD display already shows the current Kodi informations !

    Now I would like to do the correct way to enable the i2c bus via overlays. But I probably can't do it without help.

    Could any OPi 3 owner help me?

    Thank you for your extraordinary helpfulness and willingness to help. However, it still doesn't work, even though I used your working binary file (and it looked so promising ...).

    I even tried the line

    FDTOVERLAYS /overlays/sun50i-h6-ir.dtbo

    or

    FDTOVERLAYS /overlays/sun50i-h6-spdif.dtbo

    Both of these files existed (so they were included in the installation image) in the /overlays folder. I thought it should work. But it still behaves the same - the boot fails.

    So out of desperation I decompiled the file sun50i-h6-orangepi-3.dtb, edited it

    and then compiled again. It works !

    But I'm not happy about it, I'd rather it worked the way over overlays.

    So far, I have to work with what I have.

    But it looks like it will still be many hours of work before LCDproc will work. There is little information on how to debug it.

    - overlay you're using isn't correct -

    Can you please specify in what sense isn't correct?

    I did some other experiments. First in Armbian OS.

    First I enabled all three i2c buses in armbian-config and switched my interface to i2c2.

    It works again. But interestingly, there are even 5 i2c buses at the moment!

    If I only enable i2c2 in armbian-config, then there are only three i2c buses (i2c-2, i2c-3 and i2c-4).

    This means that the two default i2c buses are always at the end (in terms of numbering).

    So if I don't have the i2c bus enabled in armbian-config at all, the default buses are numbered 0 and 1.

    If I only have bus 0 enabled in armbian-config, the default buses have the numbers 1 and 2.

    Then I went back to LE.

    Instead of i2c0, I now enabled i2c2 in extlinux.conf.

    Unfortunately, it behaves exactly the same as with i2c0. I.e:

    A) When the FDTOVERLAYS line is at the end, LE boots, but no i2c bus is added

    B) When the FDTOVERLAYS line is moved up, the boot fails

    What steps can I take now (debugging?)?

    1) In the meantime I tried to move FTDOVERLAYS one line higher and it has a big effect. LE doesn't boot - see picture - it stops like this and does nothing further (I had to return it using "cardreader edit")

    2) i2cdetect -l says I have two i2c buses. See picture

    I think that's right:

    1) There is no other i2c port on the GPIO header

    2) I have the same connection when I boot Armbian, and there it works with the command i2cdetect -y 0 (see pictures in the first post)

    Thank you for further advice on how to proceed.

    Unfortunately, the result is still the same - no detection of the PCF8574 address.

    My extlinux.conf file now looks like this:

    Code
    LABEL LibreELEC
      LINUX /KERNEL
      FDT /sun50i-h6-orangepi-3.dtb
      APPEND boot=UUID=2212-5002 disk=UUID=2047348e-1e45-42ca-a55a-b19a509853fa quiet console=ttyS0,115200 console=tty1
      FDTOVERLAYS /overlays/sun50i-h6-i2c0.dtbo

    Is it right ?

    What's next ?

    Thank you for the advice.

    Unfortunately, I have little knowledge in this regard.

    I've read about overlays in the wiki, but there is only Raspberry described, no Allwinner.

    I took the sun50i-h6-i2c0.dtbo file from Armbian and copied it to the /flash/overlays folder in LE.

    But still no detection of the PCF8574 interface address.

    How do I know the overlay is loaded?

    Does it have to be allowed somewhere else?

    I intend to run LCDproc on an Orange Pi 3. I would like to use a display with an HD44780 controller connected via i2c.

    I connected PCF8574 to OPi3 and it doesn't work. So I tried the i2cdetect utility and I see that my PCF8574 interface is not detected.

    Then I inserted an SD card with the Armbian system into my device and tried the same thing (without any change of connection).

    It works so my circuit is correct.

    What should I do to make i2c work in LibreELEC?

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

    My addon "service.fan.orangepi" 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 think that this problem is not related to Allwinner only. The new builds for RPi4 behave in the same way. I solve this by manually editing the file ".cache/connman/ethernet_XXXXXXXXXXXX_cable/settings".

    When I need to assign IP addresses manually, the content looks like this:

    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 Source_addon_virtual.opi-tools-001.zip 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 ".../http://LibreELEC.tv/packages/addons/addon-depends/" folder and the "opi-tools" folder should be placed in the ".../http://LibreELEC.tv/packages/addons/tools/".

    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 Compiled_addon_virtual.opi-tools-001.zip file (separately for H6 boards and separately for others).

    The service.fan.orangepi-0.0.1.zip 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 0.6.4.0.

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

    Source_addon_virtual.opi-tools-002.zip

    Compiled_addon_virtual.opi-tools-002.zip


    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:

    Source_addon_virtual.opi-tools-003.zip

    Compiled_addon_virtual.opi-tools-003.zip

    Orange Pi Cooling Fan add-on

    For several weeks I can't find system-tools in the new image. I just need "mc". So far, I'm solving this by copying the addon from an older version, where it was still available.

    Are there any plans for when system-tools will be normally available again?

    Thanks.