128x64 OLED I2C Adafruit screen on raspberry Pi

  • Hello,

    I searched inside the forum but nothing seems to work for me.

    I have a scree Adafruit 0.96" I2C IIC OLED SSD1306.

    I want to make it works with my LibreELEC. For this moment, I only want to display the current hour but I want to display more later.

    I have LibreELEC 9.0.2

    I installed the Adafruit Librairies v9.0.107 and Raspberry Pi Tools v9.0.106 and System Tools v9.0.111

    I tested my screen with Raspbian and the screen was working well. So, I know that the device is plugged correctly and working.

    When I switched to LibreELEC : nothing run... And I reboot many times.

    I set the /flash/config.txt file to add :

    dtparam=i2c_arm=on

    I test the I2C device with : i2cdetect -y 1 and I got this result:

    Code
    0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:          -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- 3c -- -- --
    40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --

    I tested many scripts, but the following below is my "test only" script.

    When I run it, I get not error but the screen I2C stays black.

    I'm programming with many languages but I never use Python, it's my first time. So, probably I missed something simple..

    I need help...

    Thanks.

  • So, like I said before, I'm not a Python coder and my error was in the code.

    I don't know why, but it seems that it has a discrepancy between the Adafruit I used in Raspbian and the LibreELEC's Adafruit Addon.

    I changed my code to remove the first "disp.clear()" and "disp.display()" that were placed just after "disp.begin()".

    It seems that the we need to have something to display before to use this function. If not, that bugs...

    Thanks anyway!! ^^

    I don't see if I can close myself this post.Could you close it as "Resolved"