Orange Pi 3 and i2c

  • 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?

  • 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?

  • 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 ?

  • 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)

  • 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

  • - 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?)?

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

    I have no clue, but it obviously doesn't work.

    I wrote two overlays for I2C0 and I2C2 like so http://ix.io/2WSc (and same for I2C2). Then I included them to extlinux.conf like so FDTOVERLAYS /overlays/sun50i-h6-i2c0.dtbo /overlays/sun50i-h6-i2c2.dtbo. Now I have:

    Code
    LibreELEC:~ # i2cdetect -l
    i2c-3   i2c             DesignWare HDMI                         I2C adapter
    i2c-1   i2c             mv64xxx_i2c adapter                     I2C adapter
    i2c-2   i2c             mv64xxx_i2c adapter                     I2C adapter
    i2c-0   i2c             mv64xxx_i2c adapter                     I2C adapter

    Note - this is on PineH64 model B, but I don't see any reason why it wouldn't work on OPi3.

    Binary version of overlays: Index of /overlays/

  • 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.

  • 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?

  • Fortunately, I also have OrangePi 3 :) I tested with fresh installation and overlays work. Try to flash latest nightly image to spare card and see if it changes anything.

    For reference, my extlinux.conf:

    Code
    LABEL LibreELEC
      LINUX /KERNEL
      FDT /sun50i-h6-orangepi-3.dtb
      FDTOVERLAYS /overlays/sun50i-h6-i2c0.dtbo /overlays/sun50i-h6-i2c2.dtbo
      APPEND boot=UUID=2204-3027 disk=UUID=c1742531-5dac-434c-8390-f1decb06f821 quiet console=ttyS0,115200 console=tty1

    NOTE: Your UUIDs will be different.

    If that doesn't work, then I have no idea.

  • 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.