OLEDproc add-on

  • I just finished one little project. The work took me several weeks, but I believe it was worth it.

    There are many OLED graphic displays on the market that are cheaper and look better than traditional (character) LCD displays.

    I was sorry that so far these displays could not be used as a display for the Kodi multimedia center.

    That is why I set myself the task of remedying this shortcoming. I am presenting the result of my work to you today.

    The core of the solution is a new add-on called OLEDproc. As the name suggests, it is similar to the LCDproc add-on (which is used to control LCD character displays).

    It is therefore clear that the OLEDproc add-on also needs the XBMC LCDproc add-on (which is the data source) for its work.

    However, the XBMC LCDproc add-on needs one small modification to work properly with OLEDproc - adding UTF-8 encoding support.

    The modified add-on is part of the attached SW package. At the same time, I asked the author of the add-on to include the modifications in the repository version. However, the author has not yet responded.

    OLEDproc also depends on script.module.luma, script.module.smbus2, and script.module.cbor2.

    I also created these add-ons and they are also part of the attached SW package.

    In the current version, OLEDproc only supports I2C displays. It may not be difficult to support SPI displays. However, I do not have any at my disposal.

    I tried the add-on with LibreELEC 10.0.2.

    I tried two SBCs: RPi4B (4GB) and Orange Pi PC (1GB). The tests were successful on both SBCs, the add-on worked as expected.

    I tried two displays:

    One with the SH1106 chip (I can't give a specific link, the seller no longer offers the product)

    and one with SH1107 chip (eg https://www.aliexpress.com/item/4000547865501.html).

    In the case of RPi4B, the I2C interface must be enabled by adding rows

    Code
    dtparam=i2c1=on
    dtparam=i2c_arm=on

    to the config.txt file.

    In the case of OPi PC, the file sun8i-h3-i2c0.dtbo should be stored in the /overlays directory and the line FDTOVERLAYS /overlays/sun8i-h3-i2c0.dtbo should be added to the extlinux.conf file.

    I'm hoping someone will be interested.

    SW package

  • Thank you for your response, but I need clarification. Which GitHub repository specifically do you mean? I'm not sure I understand well (unfortunately my English is terrible, but at my age it won't get any better).

    Do you mean any of my own repositories or do you mean the LibreELEC repository or some completely different one?

    Note:

    I created a PR for GitHub repository herrnst/script.xbmc.lcdproc, where I summarized the changes needed to add UTF-8 encoding support.

    I also created a PR for GitHub repository rm-hull/luma.oled, where I added support for displays with the SH1107 chip.

  • @Pretoriano

    Thank you for trying and positive response. Also thank you for pointing out the missing port in the I2C menu. I'll add to it in the next version. BTW: what type of display (driver chip) do you use?

    Edited once, last by LuRu: Typo (May 2, 2022 at 6:46 AM).

  • LuRu i'm using the SH1106 (got it from Aliexpress an year ago).

    As for the i2c bus (port), setting it to "2" in my config.txt doesn't seem to create any issue/conflict, but iirc people (based on some raspberry pi documentation) recommend to use a bus number higher than "2" because the lower ones might be reserved for other things (e.g. for eeprom).

  • I built the display into the cabinet with the Orange Pi PC board and took a few photos to see what it looks like in operation.

  • Thanks for trying, so far I have very little feedback. I have (since June 6) ordered the same display. The only difference is that the connection terminals are on the shorter side of the display. When I get it, I will try to solve the SPI interface in the add-on.

  • I just received an ordered display so I can start working on it. But it is already clear that it will be a little more complicated than I expected. As for the display with the SSD1322 chip, I would do that anyway - all SPI displays that are supported by the luma.oled library should be added.

    I hope it works out.

  • Thank you, this is the display I use for something else, picoreplayer, but I want to see also for libreelec.

    Maybe it helps what was done:

    GitHub - peteS-UK/EvoSabre-DAC-PCP: Script and extensions required to configure piCorePlayer 8 on a Audiophonics EVO-SABRE 2xES9038Q2M DAC
    Script and extensions required to configure piCorePlayer 8 on a Audiophonics EVO-SABRE 2xES9038Q2M DAC - GitHub - peteS-UK/EvoSabre-DAC-PCP: Script and…
    github.com
  • The time has come to publish the result of my efforts. From today, the OLEDproc add-on supports displays with both types of interfaces (I2C and SPI).

    I am developing the plugin on an SBC Orange Pi (SoC Allwinner). Fortunately, I can use these boards without restrictions and have an easily accessible GPIO connector. It's completely different with the RPi4 board. I can only borrow it for a short time and I have to disassemble the box to get to the GPIO connector.

    Unfortunately, it turned out that there were a number of difficulties to overcome to get the SPI interface working on the Orange Pi SBC, which is why it took me so long. In the end, however, it succeeded. But there is a small drawback - it was only possible with the LE11 system. On the contrary - on RPi boards, the add-on should work both with LE11 and LE10 (I only tried it on RPi4 with LE10).

    I created a total of 6 SW packages that contain the necessary files. Two for Orange Pi boards (one for H3 boards, one for H6 boards) and four for RPi boards: RPi4-LE10, RPi2-LE10, RPi4-LE11, RPi2-LE11.

    Since the SW packages exceed the allowed size, it was not possible to attach them here. So I saved them to my google drive.

    Note 1.

    The following text talks about (in the case of RPi) editing the config.txt file or (in the case of OPi boards) editing the /flash/extlinux.conf file and adding overlay files to the /flash/overlays directory. All described files and directories are located in the flash partition, which is mounted as read only in normal operation.

    Here you can read how to proceed. Although the manual only talks about the config.txt file, the procedure is exactly the same for OPi boards.

    Note 2.

    The add-on is capable of displaying texts in Kodi's native encoding (UTF-8). Unfortunately, the official version of the XBMC LCDproc add-on does not support this encoding at this time. The modification is very simple and I asked the author to include it in the official version. Before that happens, please download the modified version here.

    Installation instructions:

    1. Enable I2C or SPI interface (this of course depends on your display type)

    1.1 RPi

    1.1.1 I2C interface

    In the case of RPi, the I2C interface must be enabled by adding rows to the config.txt file.

    dtparam=i2c1=on

    dtparam=i2c_arm=on

    1.1.2 SPI/spidev interface

    In the case of RPi, the SPI interface must be enabled by adding row to the config.txt file.

    dtoverlay=spi0-1cs

    1.2 OPi H3

    1.2.1 I2C interface

    In this case, the file sun8i-h3-i2c0.dtbo should be stored in the /flash/overlays directory and the line FDTOVERLAYS /overlays/sun8i-h3-i2c0.dtbo should be added to the extlinux.conf file.

    1.2.2 SPI/spidev interface

    In this case, the file sun8i-h3-spi-spidev0.dtbo should be stored in the /flash/overlays directory and the line FDTOVERLAYS /overlays/sun8i-h3-spi-spidev0.dtbo should be added to the extlinux.conf file.

    1.3 OPi H6

    1.3.1 I2C interface

    In this case, the file sun50i-h6-i2c0.dtbo should be stored in the /flash/overlays directory and the line FDTOVERLAYS /overlays/sun50i-h6-i2c0.dtbo should be added to the extlinux.conf file.

    1.3.2 SPI/spidev interface

    Depending on the specific board type, you need to choose the right overlay file. Here is an example for the OPi 3 and OPi Lite 2 boards:

    In the case of OPi 3, the file sun50i-h6-spi-spidev1.dtbo should be stored in the /flash/overlays directory and the line FDTOVERLAYS /overlays/sun50i-h6-spi-spidev1.dtbo should be added to the extlinux.conf file.

    In the case of OPi Lite 2, the file sun50i-h6-spi-spidev0.dtbo should be stored in the /flash/overlays directory and the line FDTOVERLAYS /overlays/sun50i-h6-spi-spidev0.dtbo should be added to the extlinux.conf file.

    2. Installing add-ons (install in the order listed)

    2.1 RPi

    2.1.1 Raspberry Pi Tools

    Add-ons - Install from repository - LibreELEC Add-ons - Program add-ons - Raspberry Pi Tools

    2.1.2 Add-ons from the attached SW package

    script.module.cbor2

    script.module.smbus2

    script.module.spidev

    script.module.luma

    service.oled

    In the case of the service.oled add-on, a configuration dialog opens immediately after installation.

    According to the type of your display, fill in the data in the Display and Connection tabs.

    2.1.3 Modified XBMC LCDproc addon

    After installing the add-on (from the downloaded zip file), open the configuration dialog and in the first tab (Behaviour) turn on the Use alternate charset switch. Then set the Charset to UTF-8.

    2.2 OPi

    2.2.1 Add-ons from the attached SW package

    script.module.cbor2

    script.module.smbus2

    script.module.spidev

    script.module.luma

    virtual.opi-tools

    service.oled

    In the case of the service.oled add-on, a configuration dialog opens immediately after installation.

    According to the type of your display and SBC, fill in the data in the Display and Connection tabs. On the Connection tab - don't forget to select the type of your SBC.

    2.2.2 Modified XBMC LCDproc addon

    After installing the add-on (from the downloaded zip file), open the configuration dialog and in the first tab (Behaviour) turn on the Use alternate charset switch. Then set the Charset to UTF-8.

    If the display is properly connected and all data is set correctly, the display should work at this point.

    The content of the display is (thanks to the use of the XBMC LCDproc add-on) customizable by editing the LCD.xml file. You can find the documentation here.

  • Hi,

    I tried LE10 for Pi with no success.

    My oled has DC = 24 and RST = 25 and in configuration page there is not possible to select RST as I see 2 times DC.

    I take a look in settings.xml and did not find in "res40" the 25 value.

    Can you check please?

    Thank you

    Edited once, last by livs (July 25, 2022 at 9:09 PM).

  • BOARD numbering is used in the add-on configuration. Pin number 25 is GND so it cannot be in the pin selection menu. I recommend using the wiring whose table is visible when you work with the add-on.

  • Thank you, I was using GPIO number.

    So in the connection tab I will have GPIO24 as PIN18 and GPIO 25 as PIN22.

    In connection tab DC selection appears twice, is this correct? Should I use first DC as PIN18 and second DC as PIN22?

  • In connection tab DC selection appears twice, is this correct?

    This is my mistake, caused by copying. Thank you for the notice. Second DC should of course be RES or RST, which is connected to pin 22 by default.